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 <u.h> | 5 #include <u.h> |
6 #include <libc.h> | 6 #include <libc.h> |
7 #include "gg.h" | 7 #include "gg.h" |
8 | 8 |
9 /* | 9 /* |
10 * generate: | 10 * generate: |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 cgen_bmul(n->op, nl, nr, res); | 250 cgen_bmul(n->op, nl, nr, res); |
251 break; | 251 break; |
252 } | 252 } |
253 goto sbop; | 253 goto sbop; |
254 | 254 |
255 // asymmetric binary | 255 // asymmetric binary |
256 case OSUB: | 256 case OSUB: |
257 a = optoas(n->op, nl->type); | 257 a = optoas(n->op, nl->type); |
258 goto abop; | 258 goto abop; |
259 | 259 |
| 260 case OHMUL: |
| 261 cgen_hmul(nl, nr, res); |
| 262 break; |
| 263 |
260 case OCONV: | 264 case OCONV: |
261 if(n->type->width > nl->type->width) { | 265 if(n->type->width > nl->type->width) { |
262 // If loading from memory, do conversion during load, | 266 // If loading from memory, do conversion during load, |
263 // so as to avoid use of 8-bit register in, say, int(*by
teptr). | 267 // so as to avoid use of 8-bit register in, say, int(*by
teptr). |
264 switch(nl->op) { | 268 switch(nl->op) { |
265 case ODOT: | 269 case ODOT: |
266 case ODOTPTR: | 270 case ODOTPTR: |
267 case OINDEX: | 271 case OINDEX: |
268 case OIND: | 272 case OIND: |
269 case ONAME: | 273 case ONAME: |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 { | 525 { |
522 Node n1; | 526 Node n1; |
523 | 527 |
524 if(debug['g']) | 528 if(debug['g']) |
525 dump("cgenr-n", n); | 529 dump("cgenr-n", n); |
526 | 530 |
527 if(isfat(n->type)) | 531 if(isfat(n->type)) |
528 fatal("cgenr on fat node"); | 532 fatal("cgenr on fat node"); |
529 | 533 |
530 if(n->addable) { | 534 if(n->addable) { |
531 » » regalloc(a, types[tptr], res); | 535 » » regalloc(a, n->type, res); |
532 gmove(n, a); | 536 gmove(n, a); |
533 return; | 537 return; |
534 } | 538 } |
535 | 539 |
536 switch(n->op) { | 540 switch(n->op) { |
537 case ONAME: | 541 case ONAME: |
538 case ODOT: | 542 case ODOT: |
539 case ODOTPTR: | 543 case ODOTPTR: |
540 case OINDEX: | 544 case OINDEX: |
541 case OCALLFUNC: | 545 case OCALLFUNC: |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 regfree(&nodl); | 1654 regfree(&nodl); |
1651 return 0; | 1655 return 0; |
1652 | 1656 |
1653 yes: | 1657 yes: |
1654 if(freer) | 1658 if(freer) |
1655 regfree(&nodr); | 1659 regfree(&nodr); |
1656 if(freel) | 1660 if(freel) |
1657 regfree(&nodl); | 1661 regfree(&nodl); |
1658 return 1; | 1662 return 1; |
1659 } | 1663 } |
OLD | NEW |