Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 #undef EXTERN | 5 #undef EXTERN |
6 #define EXTERN | 6 #define EXTERN |
7 #include <u.h> | 7 #include <u.h> |
8 #include <libc.h> | 8 #include <libc.h> |
9 #include "gg.h" | 9 #include "gg.h" |
10 #include "opt.h" | 10 #include "opt.h" |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
468 return 0; | 468 return 0; |
469 if(b->op != OREGISTER) | 469 if(b->op != OREGISTER) |
470 return 0; | 470 return 0; |
471 if(a->val.u.reg != b->val.u.reg) | 471 if(a->val.u.reg != b->val.u.reg) |
472 return 0; | 472 return 0; |
473 return 1; | 473 return 1; |
474 } | 474 } |
475 | 475 |
476 /* | 476 /* |
477 * generate high multiply | 477 * generate high multiply |
478 * res = (nl * nr) >> w | 478 * res = (nl * nr) >> wordsize |
rsc
2012/11/26 16:28:34
s/w/wordsize/
remyoudompheng
2012/11/26 21:18:55
Done.
| |
479 */ | 479 */ |
480 void | 480 void |
481 cgen_hmul(Node *nl, Node *nr, Node *res) | 481 cgen_hmul(Node *nl, Node *nr, Node *res) |
482 { | 482 { |
483 int w; | 483 int w; |
484 Node n1, n2, *tmp; | 484 Node n1, n2, *tmp; |
485 Type *t; | 485 Type *t; |
486 Prog *p; | 486 Prog *p; |
487 | 487 |
488 if(nl->ullman < nr->ullman) { | 488 if(nl->ullman < nr->ullman) { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
720 p = gins(AMOVBU, &nz, &dst); | 720 p = gins(AMOVBU, &nz, &dst); |
721 p->to.type = D_OREG; | 721 p->to.type = D_OREG; |
722 p->to.offset = 1; | 722 p->to.offset = 1; |
723 p->scond |= C_PBIT; | 723 p->scond |= C_PBIT; |
724 //print("2. %P\n", p); | 724 //print("2. %P\n", p); |
725 c--; | 725 c--; |
726 } | 726 } |
727 regfree(&dst); | 727 regfree(&dst); |
728 regfree(&nz); | 728 regfree(&nz); |
729 } | 729 } |
LEFT | RIGHT |