Mercurial > hg > CbC > old > device
diff mc-code-ia32.c @ 84:1a723130a2c7
condtional
author | kono |
---|---|
date | Wed, 05 Mar 2003 10:54:33 +0900 |
parents | f3f75911d62c |
children | 3789aef7331d |
line wrap: on
line diff
--- a/mc-code-ia32.c Wed Mar 05 03:41:08 2003 +0900 +++ b/mc-code-ia32.c Wed Mar 05 10:54:33 2003 +0900 @@ -1029,32 +1029,6 @@ printf("\tj%s\t_%d\n",s,l1); } -void -drexpr(int e1, int e2,int l1, int op) -{ - g_expr(list3(DCOMP,e1,e2)); - switch(op) { - case DOP+GT: - printf("\ttestb\t$69,%%ah\n"); - printf("\tje\t_%d\n",l1); - break; - case DOP+GE: - printf("\ttestb\t$5,%%ah\n"); - printf("\tje\t_%d\n",l1); - break; - case DOP+EQ: - printf("\tandb\t$69,%%ah\n"); - printf("\txorb\t$64,%%ah\n"); - printf("\tje\t_%d\n",l1); - break; - case DOP+NEQ: - printf("\tandb\t$69,%%ah\n"); - printf("\txorb\t$64,%%ah\n"); - printf("\tjne\t_%d\n",l1); - break; - } -} - void jcond(int l, char cond) @@ -1475,7 +1449,7 @@ case DDIV: printf("\tfdivrp %%st,%%st(1)\n"); break; case DMUL: printf("\tfmulp %%st,%%st(1)\n"); break; case DCOMP: - printf("\tfxch\t%%st(1)\n"); + /* printf("\tfxch\t%%st(1)\n"); */ printf("\tfucompp\n"); printf("\tfnstsw\t%%ax\n"); break; @@ -1518,6 +1492,32 @@ /* pop */; } +void +drexpr(int e1, int e2,int l1, int op) +{ + g_expr(list3(DCOMP,e1,e2)); + switch(op) { + case DOP+GE: + printf("\ttestb\t$5,%%ah\n"); + printf("\tjne\t_%d\n",l1); + break; + case DOP+GT: + printf("\ttestb\t$69,%%ah\n"); + printf("\tjne\t_%d\n",l1); + break; + case DOP+EQ: + printf("\tandb\t$69,%%ah\n"); + printf("\txorb\t$64,%%ah\n"); + printf("\tjne\t_%d\n",l1); + break; + case DOP+NEQ: + printf("\tandb\t$69,%%ah\n"); + printf("\txorb\t$64,%%ah\n"); + printf("\tje\t_%d\n",l1); + break; + } +} + int dpop_register() { return 1;