Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 819

Show
Ignore:
Timestamp:
12/27/10 05:44:50 (14 years ago)
Author:
walter
Message:

64 bit fix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/backend/cod1.c

    r810 r819  
    639639                {       if (regcon.cse.value[i] == e && // if register has elem 
    640640                            /* watch out for a CWD destroying DX        */ 
    641641                            !(i == DX && op == 0xF7 && desmsk & mDX)) 
    642642                        { 
    643643                                /* if ES, then it can only be a load    */ 
    644644                                if (i == ES) 
    645645                                {       if (op != 0x8B) 
    646646                                            goto L1;    /* not a load   */ 
    647647                                        cs->Iop = 0x8C; /* MOV reg,ES   */ 
    648648                                        cs->Irm = modregrm(3,0,reg & 7); 
    649649                                        if (reg & 8) 
    650650                                            code_orrex(cs, REX_B); 
    651651                                } 
    652652                                else    // XXX reg,i 
    653653                                { 
    654654                                    cs->Irm = modregrm(3,reg & 7,i & 7); 
    655655                                    if (reg & 8) 
    656656                                        cs->Irex |= REX_R; 
    657657                                    if (i & 8) 
    658658                                        cs->Irex |= REX_B; 
    659                                     if (sz == 1 && I64 && i >= 4
     659                                    if (sz == 1 && I64 && (i >= 4 || reg >= 4)
    660660                                        cs->Irex |= REX; 
    661661                                    if (I64 && (sz == 8 || sz == 16)) 
    662662                                        cs->Irex |= REX_W; 
    663663                                } 
    664664                                c = CNIL; 
    665665                                goto L2; 
    666666                        } 
    667667                        rm &= ~mask[i]; 
    668668                } 
    669669        } 
    670670  } 
    671671 
    672672L1: 
    673673  c = getlvalue(cs,e,keepmsk); 
    674674  if (offset == REGSIZE) 
    675675        getlvalue_msw(cs); 
    676676  else 
    677677        cs->IEVoffset1 += offset; 
    678678  if (I64 && reg >= 4 && sz == 1)               // if byte register 
    679679        // Can only address those 8 bit registers if a REX byte is present 
  • trunk/src/backend/cod1.c

    r810 r819  
    639639                {       if (regcon.cse.value[i] == e && // if register has elem 
    640640                            /* watch out for a CWD destroying DX        */ 
    641641                            !(i == DX && op == 0xF7 && desmsk & mDX)) 
    642642                        { 
    643643                                /* if ES, then it can only be a load    */ 
    644644                                if (i == ES) 
    645645                                {       if (op != 0x8B) 
    646646                                            goto L1;    /* not a load   */ 
    647647                                        cs->Iop = 0x8C; /* MOV reg,ES   */ 
    648648                                        cs->Irm = modregrm(3,0,reg & 7); 
    649649                                        if (reg & 8) 
    650650                                            code_orrex(cs, REX_B); 
    651651                                } 
    652652                                else    // XXX reg,i 
    653653                                { 
    654654                                    cs->Irm = modregrm(3,reg & 7,i & 7); 
    655655                                    if (reg & 8) 
    656656                                        cs->Irex |= REX_R; 
    657657                                    if (i & 8) 
    658658                                        cs->Irex |= REX_B; 
    659                                     if (sz == 1 && I64 && i >= 4
     659                                    if (sz == 1 && I64 && (i >= 4 || reg >= 4)
    660660                                        cs->Irex |= REX; 
    661661                                    if (I64 && (sz == 8 || sz == 16)) 
    662662                                        cs->Irex |= REX_W; 
    663663                                } 
    664664                                c = CNIL; 
    665665                                goto L2; 
    666666                        } 
    667667                        rm &= ~mask[i]; 
    668668                } 
    669669        } 
    670670  } 
    671671 
    672672L1: 
    673673  c = getlvalue(cs,e,keepmsk); 
    674674  if (offset == REGSIZE) 
    675675        getlvalue_msw(cs); 
    676676  else 
    677677        cs->IEVoffset1 += offset; 
    678678  if (I64 && reg >= 4 && sz == 1)               // if byte register 
    679679        // Can only address those 8 bit registers if a REX byte is present