OLD | NEW |
1 // Derived from Inferno utils/5c/txt.c | 1 // Derived from Inferno utils/5c/txt.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/txt.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/txt.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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 } | 1096 } |
1097 | 1097 |
1098 /* generate a comparison | 1098 /* generate a comparison |
1099 TODO(kaib): one of the args can actually be a small constant. relax the constrai
nt and fix call sites. | 1099 TODO(kaib): one of the args can actually be a small constant. relax the constrai
nt and fix call sites. |
1100 */ | 1100 */ |
1101 Prog* | 1101 Prog* |
1102 gcmp(int as, Node *lhs, Node *rhs) | 1102 gcmp(int as, Node *lhs, Node *rhs) |
1103 { | 1103 { |
1104 Prog *p; | 1104 Prog *p; |
1105 | 1105 |
1106 » if(lhs->op != OREGISTER || rhs->op != OREGISTER) | 1106 » if(lhs->op != OREGISTER) |
1107 fatal("bad operands to gcmp: %O %O", lhs->op, rhs->op); | 1107 fatal("bad operands to gcmp: %O %O", lhs->op, rhs->op); |
1108 | 1108 |
1109 p = gins(as, rhs, N); | 1109 p = gins(as, rhs, N); |
1110 raddr(lhs, p); | 1110 raddr(lhs, p); |
1111 return p; | 1111 return p; |
1112 } | 1112 } |
1113 | 1113 |
1114 /* generate a constant shift | 1114 /* generate a constant shift |
1115 * arm encodes a shift by 32 as 0, thus asking for 0 shift is illegal. | 1115 * arm encodes a shift by 32 as 0, thus asking for 0 shift is illegal. |
1116 */ | 1116 */ |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 naddr(&n2, a, 1); | 2042 naddr(&n2, a, 1); |
2043 goto yes; | 2043 goto yes; |
2044 | 2044 |
2045 yes: | 2045 yes: |
2046 return 1; | 2046 return 1; |
2047 | 2047 |
2048 no: | 2048 no: |
2049 sudoclean(); | 2049 sudoclean(); |
2050 return 0; | 2050 return 0; |
2051 } | 2051 } |
OLD | NEW |