Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.32
 
1.33
 
MAIN:ragge:20101127160429
 
local2.c
_>207207 fcomp(NODE *p)  
 208208 {
 209209 
<>210 -        if (p->n_left->n_op == REG) {
 211 -                if (p->n_su & DORIGHT)
 212 -                        expand(p, 0, "  fxch\n");
 213 -                expand(p, 0, "  fucompp\n");    /* emit compare insn  */
 214 -        } else
  210+        if (p->n_left->n_op != REG)
215211                 comperr("bad compare %p\n", p);
<>216 -        expand(p, 0, "  fnstsw %ax\n"); /* move status reg to ax */
 217 -        
 218 -        switch (p->n_op) {
 219 -        case EQ:
 220 -                expand(p, 0, "  andb $69,%ah\n  xorb $64,%ah\n  je LC\n");
 221 -                break;
 222 -        case NE:
 223 -                expand(p, 0, "  andb $69,%ah\n  xorb $64,%ah\n  jne LC\n");
 224 -                break;
 225 -        case LE:
 226 -                expand(p, 0, "  andb $69,%ah\n  xorb $1,%ah\n   jne LC\n");
 227 -                break;
 228 -        case LT:
 229 -                expand(p, 0, "  andb $69,%ah\n  je LC\n");
 230 -                break;
 231 -        case GT:
 232 -                expand(p, 0, "  andb $1,%ah\n   jne LC\n");
 233 -                break;
 234 -        case GE:
 235 -                expand(p, 0, "  andb $69,%ah\n  jne LC\n");
 236 -                break;
 237 -        default:
 238 -                comperr("fcomp op %d\n", p->n_op);
 239 -        }
  212+        if ((p->n_su & DORIGHT) == 0)
  213+                expand(p, 0, "  fxch\n");
  214+        expand(p, 0, "  fucomip %st(1),%st\n"); /* emit compare insn  */
  215+        expand(p, 0, "  fstp %st(0)\n");        /* pop fromstack */
  216+        zzzcode(p, 'U');
240217 }
 241218 
 242219 int
     
 !
497474                 static char *fpcb[] = { "jz", "jnz", "jbe", "jc", "jnc", "ja" };
 498475                 if (p->n_op < EQ || p->n_op > GT)
 499476                         comperr("bad fp branch");
<> 477+                if (p->n_op == NE || p->n_op == GT || p->n_op == GE)
  478+                        expand(p, 0, "  jp LC\n");
  479+                else if (p->n_op == EQ)
  480+                        printf("\tjp 1f\n");
500481                 printf("        %s ", fpcb[p->n_op - EQ]);
 501482                 expand(p, 0, "LC\n");
<> 483+                if (p->n_op == EQ)
  484+                        printf("1:\n");
<_502485                 break;
 503486                 }
 504487 
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-08-30 20:15 +0200