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

Delta Between Two Patch Sets: src/cmd/5g/peep.c

Issue 92760044: code review 92760044: runtime: use duff zero and copy to initialize memory (Closed)
Left Patch Set: diff -r 9eacb9c0d810 https://khr%40golang.org@code.google.com/p/go/ Created 10 years, 11 months ago
Right Patch Set: diff -r a6cb2adc55eb https://khr%40golang.org@code.google.com/p/go/ Created 10 years, 11 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/5g/ggen.c ('k') | src/cmd/5g/prog.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Inferno utils/5c/peep.c 1 // Inferno utils/5c/peep.c
2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/peep.c 2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/peep.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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 1151
1152 if(s != nil) { 1152 if(s != nil) {
1153 if(copysub(&p->to, v, s, 1)) 1153 if(copysub(&p->to, v, s, 1))
1154 return 1; 1154 return 1;
1155 return 0; 1155 return 0;
1156 } 1156 }
1157 if(copyau(&p->to, v)) 1157 if(copyau(&p->to, v))
1158 return 4; 1158 return 4;
1159 return 3; 1159 return 3;
1160 case ADUFFZERO: 1160 case ADUFFZERO:
1161 // R0 is zero, used by DUFFZERO, cannot be substituted.
1162 // R1 is ptr to memory, used and set, cannot be substituted.
1161 if(v->type == D_REG) { 1163 if(v->type == D_REG) {
1162 if(v->reg == REGALLOC_R0) 1164 if(v->reg == REGALLOC_R0)
1163 return 1; 1165 return 1;
1164 if(v->reg == REGALLOC_R0+1) 1166 if(v->reg == REGALLOC_R0+1)
1165 return 2; 1167 return 2;
1166 } 1168 }
1167 return 0; 1169 return 0;
1168 case ADUFFCOPY: 1170 case ADUFFCOPY:
1171 // R0 is scratch, set by DUFFCOPY, cannot be substituted.
1172 // R1, R2 areptr to src, dst, used and set, cannot be substitute d.
1169 if(v->type == D_REG) { 1173 if(v->type == D_REG) {
1170 if(v->reg == REGALLOC_R0) 1174 if(v->reg == REGALLOC_R0)
1171 return 3; 1175 return 3;
1172 if(v->reg == REGALLOC_R0+1 || v->reg == REGALLOC_R0+2) 1176 if(v->reg == REGALLOC_R0+1 || v->reg == REGALLOC_R0+2)
1173 return 2; 1177 return 2;
1174 } 1178 }
1175 return 0; 1179 return 0;
1176 ························ 1180 ························
1177 case ATEXT: /* funny */ 1181 case ATEXT: /* funny */
1178 if(v->type == D_REG) 1182 if(v->type == D_REG)
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 return regtyp(a) && a->reg == REGSP; 1614 return regtyp(a) && a->reg == REGSP;
1611 } 1615 }
1612 1616
1613 int 1617 int
1614 smallindir(Addr *a, Addr *reg) 1618 smallindir(Addr *a, Addr *reg)
1615 { 1619 {
1616 return reg->type == D_REG && a->type == D_OREG && 1620 return reg->type == D_REG && a->type == D_OREG &&
1617 a->reg == reg->reg && 1621 a->reg == reg->reg &&
1618 0 <= a->offset && a->offset < 4096; 1622 0 <= a->offset && a->offset < 4096;
1619 } 1623 }
LEFTRIGHT

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