comparison mc-code-ia32.c @ 87:1738f313f98b floating-point

floating point (at most) done.
author kono
date Wed, 05 Mar 2003 21:07:20 +0900
parents 4d1275f8a5b5
children 917947ffeb7c
comparison
equal deleted inserted replaced
86:4d1275f8a5b5 87:1738f313f98b
720 nargs += size_of_double/size_of_int; 720 nargs += size_of_double/size_of_int;
721 fregv[freg]=0; 721 fregv[freg]=0;
722 continue; 722 continue;
723 } else if (t==FLOAT) { 723 } else if (t==FLOAT) {
724 g_expr(e4); 724 g_expr(e4);
725 #if 0
726 printf("\tleal\t-4(%%esp),%%esp\n\tfstps\t(%%esp)\n"); 725 printf("\tleal\t-4(%%esp),%%esp\n\tfstps\t(%%esp)\n");
727 nargs += size_of_float/size_of_int; 726 nargs += size_of_float/size_of_int;
728 #else
729 printf("\tleal\t-8(%%esp),%%esp\n\tfstpl\t(%%esp)\n");
730 nargs += size_of_double/size_of_int;
731 #endif
732 fregv[freg]=0; 727 fregv[freg]=0;
733 continue; 728 continue;
734 } else if (car(t)==STRUCT||car(t)==UNION) { 729 } else if (car(t)==STRUCT||car(t)==UNION) {
735 nargs += struct_push(e4,t); 730 nargs += struct_push(e4,t);
736 continue; 731 continue;
1496 void 1491 void
1497 code_dpreinc(int e1,int e2,int d) { 1492 code_dpreinc(int e1,int e2,int d) {
1498 g_expr(e2); 1493 g_expr(e2);
1499 printf("\t%s (%s)\n",fload(d),register_name(creg,0)); 1494 printf("\t%s (%s)\n",fload(d),register_name(creg,0));
1500 printf("\tfld1\n"); 1495 printf("\tfld1\n");
1501 if (cadr(e1)>0) 1496 if (caddr(e1)>0)
1502 printf("\tfaddp %%st,%%st(1)\n"); 1497 printf("\tfaddp %%st,%%st(1)\n");
1503 else 1498 else
1504 printf("\tfsubrp %%st,%%st(1)\n"); 1499 printf("\tfsubrp %%st,%%st(1)\n");
1505 printf("\t%s (%s)\n",fstore(d),register_name(creg,0)); 1500 printf("\t%s (%s)\n",fstore(d),register_name(creg,0));
1506 } 1501 }
1510 g_expr(e2); 1505 g_expr(e2);
1511 printf("\t%s (%s)\n",fload(d),register_name(creg,0)); 1506 printf("\t%s (%s)\n",fload(d),register_name(creg,0));
1512 if (use) 1507 if (use)
1513 printf("\t%s (%s)\n",fload(d),register_name(creg,0)); 1508 printf("\t%s (%s)\n",fload(d),register_name(creg,0));
1514 printf("\tfld1\n"); 1509 printf("\tfld1\n");
1515 if (cadr(e1)>0) 1510 if (caddr(e1)>0)
1516 printf("\tfaddp %%st,%%st(1)\n"); 1511 printf("\tfaddp %%st,%%st(1)\n");
1517 else 1512 else
1518 printf("\tfsubrp %%st,%%st(1)\n"); 1513 printf("\tfsubrp %%st,%%st(1)\n");
1519 printf("\t%s (%s)\n",fstore(d),register_name(creg,0)); 1514 printf("\t%s (%s)\n",(use?fstore_u(d):fstore(d)),register_name(creg,0));
1520 } 1515 }
1521 1516
1522 void 1517 void
1523 drexpr(int e1, int e2,int l1, int op) 1518 drexpr(int e1, int e2,int l1, int op)
1524 { 1519 {