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:20110714074042
 
local2.c
_>314314                 }
 315315         } else {
 316316                 mneg = 0;
<>317 -                if (r->n_lval <= 63 || r->n_lval > 4294967295) {
  317+                if (r->n_lval <= 63 || r->n_lval > 4294967295LL) {
318318                         str = "movq\tAR,AL";
 319319                 } else if (r->n_lval <= 255) {
 320320                         str = "movzbl\tAR,AL\n\tclrl\tUL";
     
 !
356356                         r->n_lval = -r->n_lval;
 357357                         str = "mnegZL\tAR,AL";
 358358                 } else if (r->n_lval >= -128) {
<>359 -                        str = "cvtbZL\tAR,AL";
  359+                        if (l->n_type == CHAR)
  360+                                str = "movb\tAR,AL";
  361+                        else
  362+                                str = "cvtbZL\tAR,AL";
360363                 } else if (r->n_lval >= -32768) {
<>361 -                        str = "cvtwZL\tAR,AL";
  364+                        if (l->n_type == SHORT)
  365+                                str = "movw\tAR,AL";
  366+                        else
  367+                                str = "cvtwZL\tAR,AL";
362368                 } else
 363369                         str = "movZL\tAR,AL";
 364370         } else {
 365371                 if (r->n_lval <= 63 || r->n_lval > 65535) {
 366372                         str = "movZL\tAR,AL";
 367373                 } else if (r->n_lval <= 255) {
<>368 -                        str = "movzbZL\tAR,AL";
  374+                        str = l->n_type < SHORT ?
  375+                            "movb\tAR,AL" : "movzbZL\tAR,AL";
369376                 } else /* if (r->n_lval <= 65535) */ {
<>370 -                        str = "movzwZL\tAR,AL";
  377+                        str = l->n_type < INT ?
  378+                            "movw\tAR,AL" : "movzwZL\tAR,AL";
371379                 }
 372380         }
 373381         expand(p, FOREFF, str);
     
 !
11161124 }
 11171125 
 11181126 static void
<>1119 -optim2(NODE *p, void *arg)
  1127+mkcall(NODE *p, char *name)
11201128 {
<>1121 -        /* do local tree transformations and optimizations */
  1129+        p->n_op = CALL;
  1130+        p->n_right = mkunode(FUNARG, p->n_left, 0, p->n_left->n_type);
  1131+        p->n_left = mklnode(ICON, 0, 0, FTN|p->n_type);
  1132+        p->n_left->n_name = "__fixunsdfdi";
  1133+}
11221134 
<> 1135+/* do local tree transformations and optimizations */
  1136+static void
  1137+optim2(NODE *p, void *arg)
  1138+{
11231139         NODE *r, *s;
<> 1140+        TWORD lt;
11241141 
 11251142         switch (p->n_op) {
 11261143 
     
 !
11451162                         p->n_right = mkunode(COMPL, r, 0, r->n_type);
 11461163                 }
 11471164                 break;
<>1148 -
  1165+        case SCONV:
  1166+                lt = p->n_left->n_type;
  1167+                switch (p->n_type) {
  1168+                case LONGLONG:
  1169+                        if (lt == FLOAT)
  1170+                                mkcall(p, "__fixsfdi");
  1171+                        else if (lt == DOUBLE)
  1172+                                mkcall(p, "__fixdfdi");
  1173+                        break;
  1174+                case ULONGLONG:
  1175+                        if (lt == FLOAT)
  1176+                                mkcall(p, "__fixunssfdi");
  1177+                        else if (lt == DOUBLE)
  1178+                                mkcall(p, "__fixunsdfdi");
  1179+                        break;
  1180+                case FLOAT:
  1181+                        if (lt == LONGLONG)
  1182+                                mkcall(p, "__floatdisf");
  1183+                        else if (lt == ULONGLONG) {
  1184+                                p->n_left = mkunode(SCONV, p->n_left,0, DOUBLE);
  1185+                                p->n_type = FLOAT;
  1186+                                mkcall(p->n_left, "__floatunsdidf");
  1187+                        }
  1188+                        break;
  1189+                case DOUBLE:
  1190+                        if (lt == LONGLONG)
  1191+                                mkcall(p, "__floatdidf");
  1192+                        else if (lt == ULONGLONG)
  1193+                                mkcall(p->n_left, "__floatunsdidf");
  1194+                        break;
  1195+                        
  1196+                }
  1197+                break;
<_11491198         }
 11501199 }
 11511200 
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-22 08:13 +0200