Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(458)

Side by Side Diff: src/liblink/asm5.c

Issue 108570043: code review 108570043: liblink: fix warnings on Plan 9 (Closed)
Patch Set: diff -r 36cc211b26b4 https://code.google.com/p/go Created 10 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Inferno utils/5l/span.c 1 // Inferno utils/5l/span.c
2 // http://code.google.com/p/inferno-os/source/browse/utils/5l/span.c 2 // http://code.google.com/p/inferno-os/source/browse/utils/5l/span.c
3 // 3 //
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
6 // Portions Copyright © 1997-1999 Vita Nuova Limited 6 // Portions Copyright © 1997-1999 Vita Nuova Limited
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com) 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com)
8 // Portions Copyright © 2004,2006 Bruce Ellis 8 // Portions Copyright © 2004,2006 Bruce Ellis
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 p = op; 710 p = op;
711 continue; 711 continue;
712 } 712 }
713 // can't happen: blitrl is not nil, but checkpool didn't flushpool 713 // can't happen: blitrl is not nil, but checkpool didn't flushpool
714 ctxt->diag("internal inconsistency"); 714 ctxt->diag("internal inconsistency");
715 break; 715 break;
716 } 716 }
717 ctxt->curp = p; 717 ctxt->curp = p;
718 p->pc = c; 718 p->pc = c;
719 o = oplook(ctxt, p); 719 o = oplook(ctxt, p);
720 m = o->size;
721 if(ctxt->headtype != Hnacl) { 720 if(ctxt->headtype != Hnacl) {
722 m = o->size; 721 m = o->size;
723 } else { 722 } else {
724 m = asmoutnacl(ctxt, c, p, o, nil); 723 m = asmoutnacl(ctxt, c, p, o, nil);
725 c = p->pc; // asmoutnacl might change pc for alignment 724 c = p->pc; // asmoutnacl might change pc for alignment
726 o = oplook(ctxt, p); // asmoutnacl might change p in rar e cases 725 o = oplook(ctxt, p); // asmoutnacl might change p in rar e cases
727 } 726 }
728 if(m % 4 != 0 || p->pc % 4 != 0) { 727 if(m % 4 != 0 || p->pc % 4 != 0) {
729 ctxt->diag("!pc invalid: %P size=%d", p, m); 728 ctxt->diag("!pc invalid: %P size=%d", p, m);
730 } 729 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 p->link = q; 793 p->link = q;
795 q->as = AB; 794 q->as = AB;
796 q->to.type = D_BRANCH; 795 q->to.type = D_BRANCH;
797 q->pcond = q->link->link; 796 q->pcond = q->link->link;
798 bflag = 1; 797 bflag = 1;
799 } 798 }
800 } 799 }
801 */ 800 */
802 opc = p->pc; 801 opc = p->pc;
803 if(ctxt->headtype != Hnacl) { 802 if(ctxt->headtype != Hnacl) {
804 m = o->size; 803 m = o->size;
minux 2014/07/11 20:19:50 you may as well remove the braces around this line
0intro 2014/07/11 20:24:20 Done.
805 » » » } else { 804 » » » } else
806 m = asmoutnacl(ctxt, c, p, o, nil); 805 m = asmoutnacl(ctxt, c, p, o, nil);
807 c = p->pc; // asmoutnacl might change pc for ali gnment
808 }
809 if(p->pc != opc) { 806 if(p->pc != opc) {
810 bflag = 1; 807 bflag = 1;
811 //print("%P pc changed %d to %d in iter. %d\n", p, opc, (int32)p->pc, times); 808 //print("%P pc changed %d to %d in iter. %d\n", p, opc, (int32)p->pc, times);
812 } 809 }
813 c = p->pc + m; 810 c = p->pc + m;
814 if(m % 4 != 0 || p->pc % 4 != 0) { 811 if(m % 4 != 0 || p->pc % 4 != 0) {
815 ctxt->diag("pc invalid: %P size=%d", p, m); 812 ctxt->diag("pc invalid: %P size=%d", p, m);
816 } 813 }
817 if(m > sizeof(out)) 814 if(m > sizeof(out))
818 ctxt->diag("instruction size too large: %d > %d" , m, sizeof(out)); 815 ctxt->diag("instruction size too large: %d > %d" , m, sizeof(out));
(...skipping 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after
2712 2709
2713 // rest of exp and mantissa (cd-efgh) 2710 // rest of exp and mantissa (cd-efgh)
2714 n |= (h >> 16) & 0x3f; 2711 n |= (h >> 16) & 0x3f;
2715 2712
2716 //print("match %.8lux %.8lux %d\n", l, h, n); 2713 //print("match %.8lux %.8lux %d\n", l, h, n);
2717 return n; 2714 return n;
2718 2715
2719 no: 2716 no:
2720 return -1; 2717 return -1;
2721 } 2718 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b