Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.20
 
1.21
 
MAIN:ragge:20101002094520
 
local2.c
_>239239         }
 240240 }
 241241 
<>242 -
 243 -#if 0
 244 -/*
 245 - * Emit code to compare two longlong numbers.
 246 - */
 247 -static void
 248 -twollcomp(NODE *p)
 249 -{
 250 -        int o = p->n_op;
 251 -        int s = getlab2();
 252 -        int e = p->n_label;
 253 -        int cb1, cb2;
 254 -
 255 -        if (o >= ULE)
 256 -                o -= (ULE-LE);
 257 -        switch (o) {
 258 -        case NE:
 259 -                cb1 = 0;
 260 -                cb2 = NE;
 261 -                break;
 262 -        case EQ:
 263 -                cb1 = NE;
 264 -                cb2 = 0;
 265 -                break;
 266 -        case LE:
 267 -        case LT:
 268 -                cb1 = GT;
 269 -                cb2 = LT;
 270 -                break;
 271 -        case GE:
 272 -        case GT:
 273 -                cb1 = LT;
 274 -                cb2 = GT;
 275 -                break;
 276 -        
 277 -        default:
 278 -                cb1 = cb2 = 0; /* XXX gcc */
 279 -        }
 280 -        if (p->n_op >= ULE)
 281 -                cb1 += 4, cb2 += 4;
 282 -        expand(p, 0, "  cmpl UR,UL\n");
 283 -        if (cb1) cbgen(cb1, s);
 284 -        if (cb2) cbgen(cb2, e);
 285 -        expand(p, 0, "  cmpl AR,AL\n");
 286 -        cbgen(p->n_op, e);
 287 -        deflab(s);
 288 -}
 289 -#endif
 290 -
291242 int
 292243 fldexpand(NODE *p, int cookie, char **cp)
 293244 {
     
 !
353304         adrput(stdout, getlr(p, 'D'));
 354305         printf("\n");
 355306 }
<>356 -#if 0
357307 
<>358 -/*
 359 - * Push a structure on stack as argument.
 360 - * the scratch registers are already free here
 361 - */
362308 static void
<>363 -starg(NODE *p)
  309+stasg(NODE *p)
364310 {
<>365 -        FILE *fp = stdout;
 366 -
 367 -        fprintf(fp, "   subl $%d,%%esp\n", p->n_stsize);
 368 -        fprintf(fp, "   pushl $%d\n", p->n_stsize);
 369 -        expand(p, 0, "  pushl AL\n");
 370 -        expand(p, 0, "  leal 8(%esp),A1\n");
 371 -        expand(p, 0, "  pushl A1\n");
 372 -        fprintf(fp, "   call memcpy\n");
 373 -        fprintf(fp, "   addl $12,%%esp\n");
  311+        expand(p, INAREG, "     leaq AL,%rdi\n");
  312+        if (p->n_stsize >= 8)
  313+                printf("\tmovl $%d,%%ecx\n\trep movsq\n", p->n_stsize >> 3);
  314+        if (p->n_stsize & 3)
  315+                printf("\tmovsl\n");
  316+        if (p->n_stsize & 2)
  317+                printf("\tmovsw\n");
  318+        if (p->n_stsize & 1)
  319+                printf("\tmovsb\n");
374320 }
 375321 
<>376 -#endif
377322 /*
 378323  * Generate code to convert an unsigned long to xmm float/double.
 379324  */
     
 !
398343 #undef E
 399344 }
 400345 
<>401 -static int
 402 -argsiz(NODE *p)
 403 -{
 404 -        TWORD t = p->n_type;
 405 -
 406 -        if (p->n_left->n_op == REG)
 407 -                return 0; /* not on stack */
 408 -        if (t == LDOUBLE)
 409 -                return 16;
 410 -        if (t == STRTY || t == UNIONTY)
 411 -                return p->n_stsize;
 412 -        return 8;
 413 -}
 414 -
415346 void
 416347 zzzcode(NODE *p, int c)
 417348 {
     
 !
441372                 bfext(p);
 442373                 break;
 443374 
<>444 -#if 0
445375         case 'F': /* Structure argument */
<>446 -                if (p->n_stalign != 0) /* already on stack */
 447 -                        starg(p);
  376+                printf("        subq $%d,%%rsp\n", p->n_stsize);
  377+                printf("        movq %%rsp,%%rsi\n");
  378+                stasg(p);
448379                 break;
<>449 -#endif
450380 
 451381         case 'G': /* Floating point compare */
 452382                 fcomp(p);
     
 !
467397                 l->n_rval = l->n_reg = p->n_reg; /* XXX - not pretty */
 468398                 break;
 469399 
<>470 -#if 0
 471 -        case 'N': /* output extended reg name */
 472 -                printf("%s", rnames[getlr(p, '1')->n_rval]);
 473 -                break;
 474 -#endif
 475 -
476400         case 'P': /* Put hidden argument in rdi */
 477401                 printf("\tleaq -%d(%%rbp),%%rdi\n", stkpos);
 478402                 break;
 479403 
<>480 -#if 0
 481 -
 482 -        case 'S': /* emit eventual move after cast from longlong */
 483 -                pr = DECRA(p->n_reg, 0);
 484 -                lr = p->n_left->n_rval;
 485 -                switch (p->n_type) {
 486 -                case CHAR:
 487 -                case UCHAR:
 488 -                        if (rnames[pr][2] == 'l' && rnames[lr][2] == 'x' &&
 489 -                            rnames[pr][1] == rnames[lr][1])
 490 -                                break;
 491 -                        if (rnames[lr][2] == 'x') {
 492 -                                printf("\tmovb %%%cl,%s\n",
 493 -                                    rnames[lr][1], rnames[pr]);
 494 -                                break;
 495 -                        }
 496 -                        /* Must go via stack */
 497 -                        s = BITOOR(freetemp(1));
 498 -                        printf("\tmovl %%e%ci,%d(%%rbp)\n", rnames[lr][1], s);
 499 -                        printf("\tmovb %d(%%rbp),%s\n", s, rnames[pr]);
 500 -                        comperr("SCONV1 %s->%s", rnames[lr], rnames[pr]);
 501 -                        break;
 502 -
 503 -                case SHORT:
 504 -                case USHORT:
 505 -                        if (rnames[lr][1] == rnames[pr][2] &&
 506 -                            rnames[lr][2] == rnames[pr][3])
 507 -                                break;
 508 -                        printf("\tmovw %%%c%c,%%%s\n",
 509 -                            rnames[lr][1], rnames[lr][2], rnames[pr]+2);
 510 -                        comperr("SCONV2 %s->%s", rnames[lr], rnames[pr]);
 511 -                        break;
 512 -                case INT:
 513 -                case UNSIGNED:
 514 -                        if (rnames[lr][1] == rnames[pr][2] &&
 515 -                            rnames[lr][2] == rnames[pr][3])
 516 -                                break;
 517 -                        printf("\tmovl %%e%c%c,%s\n",
 518 -                                    rnames[lr][1], rnames[lr][2], rnames[pr]);
 519 -                        comperr("SCONV3 %s->%s", rnames[lr], rnames[pr]);
 520 -                        break;
 521 -
 522 -                default:
 523 -                        if (rnames[lr][1] == rnames[pr][2] &&
 524 -                            rnames[lr][2] == rnames[pr][3])
 525 -                                break;
 526 -                        comperr("SCONV4 %s->%s", rnames[lr], rnames[pr]);
 527 -                        break;
 528 -                }
 529 -                break;
 530 -#endif
531404         case 'Q': /* emit struct assign */
<>532 -                /* XXX - optimize for small structs */
 533 -                printf("\tmovq $%d,%%rdx\n", p->n_stsize);
 534 -                expand(p, INAREG, "\tmovq AR,%rsi\n");
 535 -                expand(p, INAREG, "\tleaq AL,%rdi\n\n");
 536 -                printf("\tcall memcpy\n");
  405+                stasg(p);
537406                 break;
 538407 
 539408         case 'R': /* print opname based on right type */
     
 !
925794                 return r[CLASSA] < 14;
 926795         case CLASSB:
 927796                 return r[CLASSB] < 16;
<> 797+        case CLASSC:
  798+                return r[CLASSC] < CREGCNT;
928799         }
 929800         return 0; /* XXX gcc */
 930801 }
     
 !
958829 int
 959830 gclass(TWORD t)
 960831 {
<>961 -        if (t == FLOAT || t == DOUBLE || t == LDOUBLE)
  832+        if (t == LDOUBLE)
  833+                return CLASSC;
  834+        if (t == FLOAT || t == DOUBLE)
962835                 return CLASSB;
 963836         return CLASSA;
 964837 }
 965838 
<> 839+static int
  840+argsiz(NODE *p)
  841+{
  842+        TWORD t = p->n_type;
  843+
  844+        if (p->n_left->n_op == REG)
  845+                return 0; /* not on stack */
  846+        if (t == LDOUBLE)
  847+                return 16;
  848+        if (p->n_op == STASG)
  849+                return p->n_stsize;
  850+        return 8;
  851+}
  852+
<_966853 /*
 967854  * Calculate argument sizes.
 968855  */
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-30 13:54 +0200