Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.6
 
1.7
 
MAIN:ragge:20090524084331
 
local2.c
_>403403         }
 404404 }
 405405 
<> 406+#endif
406407 /*
<>407 - * Convert an unsigned long long to floating point number.
  408+ * Generate code to convert an unsigned long to xmm float/double.
408409  */
 409410 static void
<>410 -ulltofp(NODE *p)
  411+ultofd(NODE *p)
411412 {
<>412 -        static int loadlab;
 413 -        int jmplab;
414413 
<>415 -        if (loadlab == 0) {
 416 -                loadlab = getlab2();
 417 -                expand(p, 0, "  .data\n");
 418 -                printf(LABFMT ":        .long 0,0x80000000,0x403f\n", loadlab);
 419 -                expand(p, 0, "  .text\n");
 420 -        }
 421 -        jmplab = getlab2();
 422 -        expand(p, 0, "  pushl UL\n      pushl AL\n");
 423 -        expand(p, 0, "  fildq (%esp)\n");
 424 -        expand(p, 0, "  addl $8,%esp\n");
 425 -        expand(p, 0, "  cmpl $0,UL\n");
 426 -        printf("        jge " LABFMT "\n", jmplab);
 427 -        printf("        fldt " LABFMT "\n", loadlab);
 428 -        printf("        faddp %%st,%%st(1)\n");
 429 -        printf(LABFMT ":\n", jmplab);
  414+#define E(x)    expand(p, 0, x)
  415+        E("     movq AL,A1\n");
  416+        E("     testq A1\n");
  417+        E("     js 2f\n");
  418+        E("     cvtsi2sZfq A1,A3\n");
  419+        E("     jmp 3f\n");
  420+        E("2:\n");
  421+        E("     movq A1,A2\n");
  422+        E("     shrq A2\n");
  423+        E("     andl $1,A1\n");
  424+        E("     orq A1,A2\n");
  425+        E("     cvtsi2sZfq A2,A3\n");
  426+        E("     addsZf A3,A3\n");
  427+        E("3:\n");
  428+#undef E
430429 }
<>431 -#endif
432430 
 433431 static int
 434432 argsiz(NODE *p)
     
 !
452450 zzzcode(NODE *p, int c)
 453451 {
 454452         NODE *l;
<>455 -        int pr, lr /*, s */;
  453+        int pr, lr, s;
456454 
 457455         switch (c) {
 458456 #if 0
     
 !
494492                 fcomp(p);
 495493                 break;
 496494 
<>497 -        case 'J': /* convert unsigned long long to floating point */
 498 -                ulltofp(p);
 499 -                break;
500495 #endif
<> 496+        case 'j': /* convert unsigned long to f/d */
  497+                ultofd(p);
  498+                break;
501499 
 502500         case 'M': /* Output sconv move, if needed */
 503501                 l = getlr(p, 'L');
     
 !
564562                 }
 565563                 break;
 566564 #endif
<> 565+        case 'R': /* print opname based on right type */
  566+        case 'L': /* print opname based on left type */
  567+                switch (getlr(p, c)->n_type) {
  568+                case CHAR: case UCHAR: s = 'b'; break;
  569+                case SHORT: case USHORT: s = 'w'; break;
  570+                case INT: case UNSIGNED: s = 'l'; break;
  571+                default: s = 'q'; break;
  572+                printf("%c", s);
  573+                }
  574+                break;
  575+        case '1': /* special reg name printout */
  576+                l = getlr(p, '1');
  577+                printf("%s", rlong[l->n_rval]);
  578+                break;
  579+
  580+        case 'g':
  581+                p = p->n_left;
  582+                /* FALLTHROUGH */
  583+        case 'f': /* float or double */
  584+                printf("%c", p->n_type == FLOAT ? 's' : 'd');
  585+                break;
  586+
  587+        case 'q': /* int or long */
  588+                printf("%c", p->n_left->n_type == LONG ? 'q' : ' ');
  589+                break;
  590+
567591         default:
 568592                 comperr("zzzcode %c", c);
 569593         }
     
 !
940964 };
 941965 char *rlong[] = {
 942966         "%eax", "%edx", "%ecx", "%ebx", "%esi", "%edi", "%ebp", "%esp",
<>943 -        "%r8l", "%r9l", "%r10l", "%r11l", "%r12l", "%r13l", "%r14l", "%r15l",
  967+        "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d",
<_944968 };
 945969 
 946970 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-16 02:56 +0200