OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "go.h" | 5 #include "go.h" |
6 #define TUP(x,y) (((x)<<16)|(y)) | 6 #define TUP(x,y) (((x)<<16)|(y)) |
7 | 7 |
8 static Val tocplx(Val); | 8 static Val tocplx(Val); |
9 static Val toflt(Val); | 9 static Val toflt(Val); |
10 static Val tostr(Val); | 10 static Val tostr(Val); |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 switch(simtype[n->type->etype]) { | 1085 switch(simtype[n->type->etype]) { |
1086 case TINT8: | 1086 case TINT8: |
1087 case TUINT8: | 1087 case TUINT8: |
1088 case TINT16: | 1088 case TINT16: |
1089 case TUINT16: | 1089 case TUINT16: |
1090 case TINT32: | 1090 case TINT32: |
1091 case TUINT32: | 1091 case TUINT32: |
1092 case TBOOL: | 1092 case TBOOL: |
1093 case TPTR32: | 1093 case TPTR32: |
1094 return 1; | 1094 return 1; |
| 1095 case TINT64: |
| 1096 case TUINT64: |
| 1097 if(mpcmpfixfix(n->val.u.xval, minintval[TINT32]) < 0 |
| 1098 || mpcmpfixfix(n->val.u.xval, maxintval[TINT32]) > 0) |
| 1099 break; |
| 1100 return 1; |
1095 } | 1101 } |
1096 return 0; | 1102 return 0; |
1097 } | 1103 } |
1098 | 1104 |
1099 long | 1105 long |
1100 nonnegconst(Node *n) | 1106 nonnegconst(Node *n) |
1101 { | 1107 { |
1102 if(n->op == OLITERAL && n->type != T) | 1108 if(n->op == OLITERAL && n->type != T) |
1103 switch(simtype[n->type->etype]) { | 1109 switch(simtype[n->type->etype]) { |
1104 case TINT8: | 1110 case TINT8: |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 mpmulfltflt(&ad, &rv->imag); // ad | 1272 mpmulfltflt(&ad, &rv->imag); // ad |
1267 | 1273 |
1268 mpmovefltflt(&v->real, &ac); | 1274 mpmovefltflt(&v->real, &ac); |
1269 mpaddfltflt(&v->real, &bd); // ac+bd | 1275 mpaddfltflt(&v->real, &bd); // ac+bd |
1270 mpdivfltflt(&v->real, &cc_plus_dd); // (ac+bd)/(cc+dd) | 1276 mpdivfltflt(&v->real, &cc_plus_dd); // (ac+bd)/(cc+dd) |
1271 | 1277 |
1272 mpmovefltflt(&v->imag, &bc); | 1278 mpmovefltflt(&v->imag, &bc); |
1273 mpsubfltflt(&v->imag, &ad); // bc-ad | 1279 mpsubfltflt(&v->imag, &ad); // bc-ad |
1274 mpdivfltflt(&v->imag, &cc_plus_dd); // (bc+ad)/(cc+dd) | 1280 mpdivfltflt(&v->imag, &cc_plus_dd); // (bc+ad)/(cc+dd) |
1275 } | 1281 } |
OLD | NEW |