Changeset 621

Show
Ignore:
Timestamp:
08/21/10 04:36:24 (1 year ago)
Author:
walter
Message:

more 64, mostly inline assembler

Files:

Legend:

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

    r619 r621  
    11641164 
    11651165        if (!I16 && e1isadd && (!e1->Ecount || !e1free) && 
    1166             tysize[e1ty] == REGSIZE
     1166            (tysize[e1ty] == REGSIZE || (I64 && tysize[e1ty] == 4))
    11671167        {   code *c2; 
    11681168            regm_t idxregs2; 
     
    35403540#ifdef DEBUG 
    35413541  if (debugw) 
    3542         printf("loaddata(e = %p,*pretregs = x%x)\n",e,*pretregs); 
     3542        printf("loaddata(e = %p,*pretregs = %s)\n",e,regm_str(*pretregs)); 
    35433543  //elem_print(e); 
    35443544#endif 
  • branches/dmd-1.x/src/backend/ptrntab.c

    r619 r621  
    3333// 
    3434 
    35 PTRNTAB0 aptb0AAA[] = /* AAA */ { 
    36         { 0x37, _modax }, 
    37 }; 
    38  
    39 PTRNTAB0 aptb0AAD[] = /* AAD */ { 
    40         { 0xd50a, _modax } 
    41 }; 
    42  
    43 PTRNTAB0 aptb0AAM[] = /* AAM */ { 
    44         { 0xd40a, _modax } 
    45 }; 
    46 PTRNTAB0 aptb0AAS[] = /* AAS */ { 
    47         { 0x3f, _modax } 
    48 }; 
    49 PTRNTAB0 aptb0CBW[] = /* CBW */ { 
    50         { 0x98, _16_bit | _modax } 
    51 }; 
    52 PTRNTAB0 aptb0CWDE[] = /* CWDE */ { 
    53         { 0x98, _32_bit | _I386 | _modax } 
    54 }; 
    55 PTRNTAB0 aptb0CDQE[] = /* CDQE */ { 
    56         { 0x98, _64_bit | _modax } 
    57 }; 
    58 PTRNTAB0 aptb0CLC[] =  /* CLC */ { 
    59         { 0xf8, 0 } 
    60 }; 
    61  
    62 PTRNTAB0 aptb0CLD[] = /* CLD */ { 
    63         { 0xfc, 0 } 
    64 }; 
    65 PTRNTAB0 aptb0CLI[] =  /* CLI */ { 
    66         { 0xfa, 0 } 
    67 }; 
    68  
    69 PTRNTAB0 aptb0CLTS[] =  /* CLTS */ { 
    70         { 0x0f06, 0 } 
    71 }; 
    72  
    73 PTRNTAB0 aptb0CMC[] =  /* CMC */ { 
    74         { 0xf5, 0 } 
    75 }; 
    76  
    77 PTRNTAB0 aptb0CMPSB[] =  /* CMPSB */ { 
    78         { 0xa6, _modsidi } 
    79 }; 
    80  
    81 PTRNTAB0 aptb0CMPSW[] =  /* CMPSW */ { 
    82         { 0xa7, _16_bit | _modsidi } 
    83 }; 
    84  
    85 #if 0 
    86 PTRNTAB0 aptb0CMPSD[] =  /* CMPSD */ { 
    87         { 0xa7, _32_bit | _I386 | _modsidi } 
    88 }; 
    89 #endif 
    90  
    91 PTRNTAB0 aptb0CWD[] =  /* CWD */ { 
    92         { 0x99, _16_bit | _modaxdx } 
    93 }; 
    94  
    95 PTRNTAB0 aptb0CDQ[] =  /* CDQ */ { 
    96         { 0x99, _32_bit | _I386 | _modaxdx } 
    97 }; 
    98  
    99 PTRNTAB0 aptb0CQO[] =  /* CQO */ { 
    100         { 0x99, _64_bit | _modaxdx } 
    101 }; 
    102  
    103 PTRNTAB0 aptb0DAA[] =  /* DAA */ { 
    104         { 0x27, _modax } 
    105 }; 
    106  
    107 PTRNTAB0 aptb0DAS[] =  /* DAS */ { 
    108         { 0x2f, _modax } 
    109 }; 
    110  
    111 PTRNTAB0 aptb0HLT[] =  /* HLT */ { 
    112         { 0xf4, 0 } 
    113 }; 
    114  
    115 PTRNTAB0 aptb0INSB[] =  /* INSB */ { 
    116         { 0x6c,  _I386 | _modsi } 
    117 }; 
    118  
    119 PTRNTAB0 aptb0INSW[] =  /* INSW */ { 
    120         { 0x6d, _16_bit | _I386 | _modsi } 
    121 }; 
    122  
    123 PTRNTAB0 aptb0INSD[] =  /* INSD */ { 
    124         { 0x6d, _32_bit | _I386 | _modsi } 
    125 }; 
    126  
    127 PTRNTAB0 aptb0INTO[] =  /* INTO */ { 
    128         { 0xce, 0 } 
    129 }; 
    130 PTRNTAB0 aptb0INVD[] = /* INVD */ { 
    131         { 0x0f08, _I386 }               // Actually a 486 only instruction 
    132 }; 
    133 PTRNTAB0 aptb0IRET[] =  /* IRET */ { 
    134         { 0xcf, _16_bit } 
    135 }; 
    136  
    137 PTRNTAB0 aptb0IRETD[] =  /* IRETD */ { 
    138         { 0xcf, _32_bit | _I386 } 
    139 }; 
    140  
    141 PTRNTAB0 aptb0LAHF[] =  /* LAHF */ { 
    142         { 0x9f, _modax } 
    143 }; 
    144  
    145 PTRNTAB0 aptb0LEAVE[] =  /* LEAVE */ { 
    146         { 0xc9, _I386 } 
    147 }; 
    148  
    149 PTRNTAB0 aptb0LOCK[] =  /* LOCK */ { 
    150         { 0xf0, 0 } 
    151 }; 
    152  
    153 PTRNTAB0 aptb0LODSB[] =  /* LODSB */ { 
    154         { 0xac, _modsiax } 
    155 }; 
    156  
    157 PTRNTAB0 aptb0LODSW[] =  /* LODSW */ { 
    158         { 0xad, _16_bit | _modsiax } 
    159 }; 
    160  
    161 PTRNTAB0 aptb0LODSD[] =  /* LODSD */ { 
    162         { 0xad, _32_bit | _I386 | _modsiax  } 
    163 }; 
    164  
    165 PTRNTAB0 aptb0MOVSB[] =  /* MOVSB */ { 
    166         { 0xa4, _modsidi} 
    167 }; 
    168  
    169 PTRNTAB0 aptb0MOVSW[] =  /* MOVSW */ { 
    170         { 0xa5, _16_bit | _modsidi } 
    171 }; 
     35#define OPTABLE0(str,op,mod) PTRNTAB0 aptb0##str[] = { { op, mod }, }; 
     36 
     37OPTABLE0(AAA,     0x37,_modax); 
     38OPTABLE0(AAD,     0xd50a,_modax); 
     39OPTABLE0(AAM,     0xd40a,_modax); 
     40OPTABLE0(AAS,     0x3f,_modax); 
     41OPTABLE0(CBW,     0x98,_16_bit | _modax); 
     42OPTABLE0(CWDE,    0x98,_32_bit | _I386 | _modax); 
     43OPTABLE0(CDQE,    0x98,_64_bit | _modax); 
     44OPTABLE0(CLC,     0xf8,0); 
     45OPTABLE0(CLD,     0xfc,0); 
     46OPTABLE0(CLI,     0xfa,0); 
     47OPTABLE0(CLTS,    0x0f06,0); 
     48OPTABLE0(CMC,     0xf5,0); 
     49OPTABLE0(CMPSB,   0xa6,_modsidi); 
     50OPTABLE0(CMPSW,   0xa7,_16_bit | _modsidi); 
     51//OPTABLE0(CMPSD, 0xa7,_32_bit | _I386 | _modsidi); 
     52OPTABLE0(CMPSQ,   0xa7,_64_bit | _modsidi); 
     53OPTABLE0(CWD,     0x99, _16_bit | _modaxdx); 
     54OPTABLE0(CDQ,     0x99,_32_bit | _I386 | _modaxdx); 
     55OPTABLE0(CQO,     0x99, _64_bit | _modaxdx); 
     56OPTABLE0(DAA,     0x27,_modax); 
     57OPTABLE0(DAS,     0x2f,_modax); 
     58OPTABLE0(HLT,     0xf4,0); 
     59OPTABLE0(INSB,    0x6c,_I386 | _modsi); 
     60OPTABLE0(INSW,    0x6d,_16_bit | _I386 | _modsi); 
     61OPTABLE0(INSD,    0x6d,_32_bit | _I386 | _modsi); 
     62OPTABLE0(INTO,    0xce,0); 
     63OPTABLE0(INVD,    0x0f08,_I386);               // Actually a 486 only instruction 
     64OPTABLE0(IRET,    0xcf,_16_bit); 
     65OPTABLE0(IRETD,   0xcf,_32_bit | _I386); 
     66OPTABLE0(LAHF,    0x9f,_modax); 
     67OPTABLE0(LEAVE,   0xc9,_I386); 
     68OPTABLE0(LOCK,    0xf0,0); 
     69OPTABLE0(LODSB,   0xac,_modsiax); 
     70OPTABLE0(LODSW,   0xad,_16_bit | _modsiax); 
     71OPTABLE0(LODSD,   0xad,_32_bit | _I386 | _modsiax); 
     72OPTABLE0(LODSQ,   0xad,_64_bit | _modsiax); 
     73OPTABLE0(MOVSB,   0xa4, _modsidi); 
     74OPTABLE0(MOVSW,   0xa5, _16_bit | _modsidi); 
     75OPTABLE0(MOVSQ,   0xa5, _64_bit | _modsidi); 
     76OPTABLE0(NOP,     0x90, 0); 
     77OPTABLE0(OUTSB,   0x6e, _I386 | _modsi); 
     78OPTABLE0(OUTSW,   0x6f, _16_bit | _I386 | _modsi); 
     79OPTABLE0(OUTSD,   0x6f, _32_bit | _I386 | _modsi); 
     80OPTABLE0(POPA,    0x61, _16_bit | _I386 | _modall); 
     81OPTABLE0(POPAD,   0x61, _32_bit | _I386 | _modall); 
     82OPTABLE0(POPF,    0x9d, _16_bit); 
     83OPTABLE0(POPFD,   0x9d, _32_bit | _I386); 
     84OPTABLE0(PUSHA,   0x60, _16_bit | _I386); 
     85OPTABLE0(PUSHAD,  0x60, _32_bit | _I386); 
     86OPTABLE0(PUSHF,   0x9c, _16_bit); 
     87OPTABLE0(PUSHFD,  0x9c, _32_bit | _I386); 
     88OPTABLE0(REP,     0xf3, _modcx); 
     89OPTABLE0(REPNE,   0xf2, _modcx); 
     90OPTABLE0(SAHF,    0x9e, 0); 
     91OPTABLE0(SCASB,   0xAE, _moddi); 
     92OPTABLE0(SCASW,   0xAF, _16_bit | _moddi); 
     93OPTABLE0(SCASD,   0xAF, _32_bit | _I386 | _moddi); 
     94OPTABLE0(SCASQ,   0xAF, _64_bit | _moddi); 
     95OPTABLE0(STC,     0xf9, 0); 
     96OPTABLE0(STD,     0xfd, 0); 
     97OPTABLE0(STI,     0xfb, 0); 
     98OPTABLE0(STOSB,   0xaa, _moddi); 
     99OPTABLE0(STOSW,   0xAB, _16_bit | _moddi); 
     100OPTABLE0(STOSD,   0xAB, _32_bit | _I386 | _moddi); 
     101OPTABLE0(STOSQ,   0xAB, _64_bit | _moddi); 
     102OPTABLE0(WAIT,    0x9B, 0); 
     103OPTABLE0(WBINVD,  0x0f09, _I386);                        // Really a 486 opcode 
     104OPTABLE0(XLATB,   0xd7, _modax); 
     105OPTABLE0(CPUID,   0x0fa2, _I386 | _modall); 
     106OPTABLE0(RDMSR,   0x0f32, _I386 | _modaxdx); 
     107OPTABLE0(RDPMC,   0x0f33, _I386 | _modaxdx); 
     108OPTABLE0(RDTSC,   0x0f31, _I386 | _modaxdx); 
     109OPTABLE0(WRMSR,   0x0f30, _I386); 
     110OPTABLE0(RSM,     0x0faa,   _I386); 
    172111 
    173112PTRNTAB2 aptb2MOVSD[] =  /* MOVSD */ { 
     
    177116}; 
    178117 
    179 PTRNTAB0 aptb0NOP[] =  /* NOP */ { 
    180         { 0x90, 0 } 
    181 }; 
    182  
    183 PTRNTAB0 aptb0OUTSB[] =  /* OUTSB */ { 
    184         { 0x6e, _I386 | _modsi } 
    185 }; 
    186  
    187 PTRNTAB0 aptb0OUTSW[] =  /* OUTSW */ { 
    188         { 0x6f, _16_bit | _I386 | _modsi } 
    189 }; 
    190  
    191 PTRNTAB0 aptb0OUTSD[] =  /* OUTSD */ { 
    192         { 0x6f, _32_bit | _I386 | _modsi } 
    193 }; 
    194  
    195 PTRNTAB0 aptb0POPA[] =  /* POPA */ { 
    196         { 0x61, _16_bit | _I386 | _modall } 
    197 }; 
    198  
    199 PTRNTAB0 aptb0POPAD[] =  /* POPAD */ { 
    200         { 0x61, _32_bit | _I386 | _modall } 
    201 }; 
    202  
    203 PTRNTAB0 aptb0POPF[] =  /* POPF */ { 
    204         { 0x9d, _16_bit } 
    205 }; 
    206  
    207 PTRNTAB0 aptb0POPFD[] =  /* POPFD */ { 
    208         { 0x9d, _32_bit | _I386 } 
    209 }; 
    210  
    211 PTRNTAB0 aptb0PUSHA[] =  /* PUSHA */ { 
    212         { 0x60, _16_bit | _I386 } 
    213 }; 
    214  
    215 PTRNTAB0 aptb0PUSHAD[] =  /* PUSHAD */ { 
    216         { 0x60, _32_bit | _I386 } 
    217 }; 
    218  
    219 PTRNTAB0 aptb0PUSHF[]= /* PUSHF */ { 
    220         {0x9c, _16_bit } 
    221 }; 
    222  
    223 PTRNTAB0 aptb0PUSHFD[] =  /* PUSHFD */ { 
    224         { 0x9c, _32_bit | _I386 } 
    225 }; 
    226  
    227 PTRNTAB0 aptb0REP[] = /* REP */ { 
    228         { 0xf3, _modcx } 
    229 }; 
    230  
    231 PTRNTAB0 aptb0REPNE[] = /* REPNE */ { 
    232         { 0xf2, _modcx } 
    233 }; 
    234  
    235 PTRNTAB0 aptb0SAHF[] = /* SAHF */ { 
    236         { 0x9e, 0 } 
    237 }; 
    238  
    239 PTRNTAB0 aptb0SCASB[] = /* SCASB */ { 
    240         { 0xAE, _moddi } 
    241 }; 
    242  
    243 PTRNTAB0 aptb0SCASW[] = /* SCASW */ { 
    244         { 0xAF, _16_bit | _moddi} 
    245 }; 
    246  
    247 PTRNTAB0 aptb0SCASD[] = /* SCASD */ { 
    248         { 0xAF, _32_bit | _I386 | _moddi } 
    249 }; 
    250  
    251 PTRNTAB0 aptb0STC[] = /* STC */ { 
    252         { 0xf9, 0 } 
    253 }; 
    254  
    255 PTRNTAB0 aptb0STD[] = /* STD */ { 
    256         { 0xfd, 0 } 
    257 }; 
    258  
    259 PTRNTAB0 aptb0STI[] = /* STI */ { 
    260         { 0xfb, 0 } 
    261 }; 
    262 PTRNTAB0 aptb0STOSB[] = /* STOSB */ { 
    263         { 0xaa, _moddi } 
    264 }; 
    265  
    266 PTRNTAB0 aptb0STOSW[] = /* STOSW */ { 
    267         { 0xAB, _16_bit | _moddi } 
    268 }; 
    269  
    270 PTRNTAB0 aptb0STOSD[] = /* STOSD */ { 
    271         { 0xAB, _32_bit | _I386 | _moddi } 
    272 }; 
    273  
    274 PTRNTAB0 aptb0WAIT[] = /* WAIT */ { 
    275         { 0x9B, 0 } 
    276 }; 
    277 PTRNTAB0 aptb0WBINVD[] = /* WBINVD */ { 
    278         { 0xf09, _I386 }                        // Really a 486 opcode 
    279 }; 
    280 PTRNTAB0 aptb0XLATB[] = /* XLATB */ { 
    281         { 0xd7, _modax } 
    282 }; 
    283 PTRNTAB0 aptb0CPUID[] = { 
    284     { 0x0fa2, _I386 | _modall } 
    285 }; 
    286  
    287 PTRNTAB0 aptb0RDMSR[] = { 
    288     { 0x0f32, _I386 | _modaxdx } 
    289 }; 
    290  
    291 PTRNTAB0 aptb0RDPMC[] = { 
    292     { 0x0f33, _I386 | _modaxdx } 
    293 }; 
    294  
    295 PTRNTAB0 aptb0RDTSC[] = { 
    296     { 0x0f31, _I386 | _modaxdx } 
    297 }; 
    298  
    299 PTRNTAB0 aptb0WRMSR[] = { 
    300     { 0x0f30, _I386 } 
    301 }; 
    302  
    303 PTRNTAB0 aptb0RSM[] = { 
    304     { 0x0faa,   _I386 } 
    305 }; 
    306118// 
    307119// Now come the one operand instructions 
     
    323135        { 0xe8, _cd | _modall , _rel32  }, 
    324136        { 0xff, _2 | _32_bit | _modall ,        _r32  }, 
     137        { 0xff, _2 | _64_bit | _modall ,        _r64  }, 
    325138        { 0xff, _2 | _modall ,  _m32  }, 
     139        { 0xff, _2 | _64_bit | _modall ,  _m64  }, 
    326140        { 0x9a, _cp | _modall , _p1632 }, 
    327141        { 0xff, _3 | _modall ,  _m1632  }, 
     
    333147        { 0xff, _1 | _16_bit,           _m16 },         // Also _r16 synonym 
    334148        { 0xff, _1 | _32_bit,           _m32 },         // Also _r32 synonym 
     149        { 0xff, _1 | _64_bit,           _rm64 },        // Also _r64 synonym 
    335150        { 0x48, _rw | _16_bit,          _r16 | _plus_r }, 
    336151        { 0x48, _rw | _32_bit,          _r32 | _plus_r }, 
     
    342157        { 0xff, _0 | _16_bit,   _m16 },                 // Also _r16 synonym 
    343158        { 0xff, _0 | _32_bit,   _m32 },                 // Also _r32 synonym 
     159        { 0xff, _0 | _64_bit,   _rm64 },                // Also _r64 synonym 
    344160        { 0x40, _rw | _16_bit,_r16 | _plus_r }, 
    345161        { 0x40, _rd | _32_bit,_r32 | _plus_r }, 
     
    359175}; 
    360176 
    361 PTRNTAB1 aptb1JB[] = /* JB */ { 
    362         { 0x72, _cb,_rel8 }, 
    363         { 0x0f82,       _cw,_rel16 }, 
    364         { 0x0f82,       _cd,_rel32 }, 
    365         { ASM_END, 0, 0 } 
    366 }; 
    367 PTRNTAB1 aptb1JBE[] = /* JBE */ { 
    368         { 0x76, _cb,_rel8 }, 
    369         { 0x0f86,       _cw,_rel16 }, 
    370         { 0x0f86,       _cd,_rel32 }, 
    371         { ASM_END, 0, 0 } 
    372 }; 
     177#define OPTABLE(str,op) \ 
     178PTRNTAB1 aptb1##str[] = {               \ 
     179        { 0x70|op,   _cb,_rel8 },       \ 
     180        { 0x0f80|op, _cw,_rel16 },      \ 
     181        { 0x0f80|op, _cd,_rel32 },      \ 
     182        { ASM_END, 0, 0 }               \ 
     183
     184 
     185OPTABLE(JO,0); 
     186OPTABLE(JNO,1); 
     187OPTABLE(JB,2); 
     188OPTABLE(JNB,3); 
     189OPTABLE(JZ,4); 
     190OPTABLE(JNZ,5); 
     191OPTABLE(JBE,6); 
     192OPTABLE(JNBE,7); 
     193OPTABLE(JS,8); 
     194OPTABLE(JNS,9); 
     195OPTABLE(JP,0xA); 
     196OPTABLE(JNP,0xB); 
     197OPTABLE(JL,0xC); 
     198OPTABLE(JNL,0xD); 
     199OPTABLE(JLE,0xE); 
     200OPTABLE(JNLE,0xF); 
     201 
     202#undef OPTABLE 
     203 
    373204PTRNTAB1 aptb1JCXZ[] = /* JCXZ */ { 
    374205        { 0xe3, _cb | _16_bit_addr,_rel8 }, 
     
    377208PTRNTAB1 aptb1JECXZ[] = /* JECXZ */ { 
    378209        { 0xe3, _cb | _32_bit_addr | _I386,_rel8 }, 
    379         { ASM_END, 0, 0 } 
    380 }; 
    381 PTRNTAB1 aptb1JZ[] = /* JZ */ { 
    382         { 0x74, _cb,_rel8 }, 
    383         { 0x0f84,       _cw,_rel16 }, 
    384         { 0x0f84,       _cd,_rel32 }, 
    385         { ASM_END, 0, 0 } 
    386 }; 
    387 PTRNTAB1 aptb1JL[] = /* JL */ { 
    388         { 0x7c, _cb,_rel8 }, 
    389         { 0x0f8c,       _cw,_rel16 }, 
    390         { 0x0f8c,       _cd,_rel32 }, 
    391         { ASM_END, 0, 0 } 
    392 }; 
    393 PTRNTAB1 aptb1JLE[] = /* JLE */ { 
    394         { 0x7e, _cb,_rel8 }, 
    395         { 0x0f8e,       _cw,_rel16 }, 
    396         { 0x0f8e,       _cd,_rel32 }, 
    397         { ASM_END, 0, 0 } 
    398 }; 
    399 PTRNTAB1 aptb1JNB[] = /* JNB */ { 
    400         { 0x73, _cb,_rel8 }, 
    401         { 0x0f83,       _cw,_rel16 }, 
    402         { 0x0f83,       _cd,_rel32 }, 
    403         { ASM_END, 0, 0 } 
    404 }; 
    405 PTRNTAB1 aptb1JNBE[] = /* JNBE */ { 
    406         { 0x77, _cb,_rel8 }, 
    407         { 0x0f87,       _cw,_rel16 }, 
    408         { 0x0f87,       _cd,_rel32 }, 
    409         { ASM_END, 0, 0 } 
    410 }; 
    411 PTRNTAB1 aptb1JNL[] = /* JNL */ { 
    412         { 0x7d, _cb,_rel8 }, 
    413         { 0x0f8d,       _cw,_rel16 }, 
    414         { 0x0f8d,       _cd,_rel32 }, 
    415         { ASM_END, 0, 0 } 
    416 }; 
    417 PTRNTAB1 aptb1JNLE[] = /* JNLE */ { 
    418         { 0x7f, _cb,_rel8 }, 
    419         { 0x0f8f,       _cw,_rel16 }, 
    420         { 0x0f8f,       _cd,_rel32 }, 
    421         { ASM_END, 0, 0 } 
    422 }; 
    423 PTRNTAB1 aptb1JNO[] = /* JNO */ { 
    424         { 0x71, _cb,_rel8 }, 
    425         { 0x0f81,       _cw,_rel16 }, 
    426         { 0x0f81,       _cd,_rel32 }, 
    427         { ASM_END, 0, 0 } 
    428 }; 
    429 PTRNTAB1 aptb1JNP[] = /* JNP */ { 
    430         { 0x7b, _cb,_rel8 }, 
    431         { 0x0f8b,       _cw,_rel16 }, 
    432         { 0x0f8b,       _cd,_rel32 }, 
    433         { ASM_END, 0, 0 } 
    434 }; 
    435 PTRNTAB1 aptb1JNS[] = /* JNS */ { 
    436         { 0x79, _cb,_rel8 }, 
    437         { 0x0f89,       _cw,_rel16 }, 
    438         { 0x0f89,       _cd,_rel32 }, 
    439         { ASM_END, 0, 0 } 
    440 }; 
    441 PTRNTAB1 aptb1JNZ[] = /* JNZ */ { 
    442         { 0x75, _cb,_rel8 }, 
    443         { 0x0f85,       _cw,_rel16 }, 
    444         { 0x0f85,       _cd,_rel32 }, 
    445         { ASM_END, 0, 0 } 
    446 }; 
    447 PTRNTAB1 aptb1JO[] = /* JO */ { 
    448         { 0x70, _cb,_rel8 }, 
    449         { 0x0f80,       _cw,_rel16 }, 
    450         { 0x0f80,       _cd,_rel32 }, 
    451         { ASM_END, 0, 0 } 
    452 }; 
    453 PTRNTAB1 aptb1JP[] = /* JP */ { 
    454         { 0x7a, _cb,_rel8 }, 
    455         { 0x0f8a,       _cw,_rel16 }, 
    456         { 0x0f8a,       _cd,_rel32 }, 
    457         { ASM_END, 0, 0 } 
    458 }; 
    459 PTRNTAB1 aptb1JS[] = /* JS */ { 
    460         { 0x78, _cb,_rel8 }, 
    461         { 0x0f88,       _cw,_rel16 }, 
    462         { 0x0f88,       _cd,_rel32 }, 
    463210        { ASM_END, 0, 0 } 
    464211}; 
     
    501248        { ASM_END, 0, 0 } 
    502249}; 
    503 PTRNTAB1 aptb1LOOPE[] = /* LOOPE */ { 
     250PTRNTAB1 aptb1LOOPE[] = /* LOOPE/LOOPZ */ { 
    504251        { 0xe1, _cb | _modcx,_rel8 }, 
    505252        { ASM_END, 0, 0 } 
    506253}; 
    507 PTRNTAB1 aptb1LOOPZ[] = /* LOOPZ */ { 
    508         { 0xe1, _cb | _modcx,_rel8 }, 
    509         { ASM_END, 0, 0 } 
    510 }; 
    511 PTRNTAB1 aptb1LOOPNE[] = /* LOOPNE */ { 
    512         { 0xe0, _cb | _modcx,_rel8 }, 
    513         { ASM_END, 0, 0 } 
    514 }; 
    515 PTRNTAB1 aptb1LOOPNZ[] = /* LOOPNZ */ { 
     254PTRNTAB1 aptb1LOOPNE[] = /* LOOPNE/LOOPNZ */ { 
    516255        { 0xe0, _cb | _modcx,_rel8 }, 
    517256        { ASM_END, 0, 0 } 
     
    532271        { 0xf7, _2 | _16_bit,   _rm16 }, 
    533272        { 0xf7, _2 | _32_bit,   _rm32 }, 
     273        { 0xf7, _2 | _64_bit,   _rm64 }, 
    534274        { ASM_END, 0, 0 } 
    535275}; 
     
    584324}; 
    585325 
    586 PTRNTAB1 aptb1SETB[] = /* SETB */ { 
    587         { 0xf92, _cb, _rm8 }, 
    588         { ASM_END, 0, 0 } 
    589 }; 
    590 PTRNTAB1  aptb1SETBE[] = /* SETBE */ { 
    591         { 0xf96, _cb, _rm8 }, 
    592         { ASM_END, 0, 0 } 
    593 }; 
    594 PTRNTAB1  aptb1SETL[] = /* SETL */ { 
    595         { 0xf9c, _cb, _rm8 }, 
    596         { ASM_END, 0, 0 } 
    597 }; 
    598 PTRNTAB1  aptb1SETLE[] = /* SETLE */ { 
    599         { 0xf9e, _cb, _rm8 }, 
    600         { ASM_END, 0, 0 } 
    601 }; 
    602 PTRNTAB1  aptb1SETNB[] = /* SETNB */ { 
    603         { 0xf93, _cb, _rm8 }, 
    604         { ASM_END, 0, 0 } 
    605 }; 
    606 PTRNTAB1  aptb1SETNBE[] = /* SETNBE */ { 
    607         { 0xf97, _cb, _rm8 }, 
    608         { ASM_END, 0, 0 } 
    609 }; 
    610 PTRNTAB1  aptb1SETNL[] = /* SETNL */ { 
    611         { 0xf9d, _cb, _rm8 }, 
    612         { ASM_END, 0, 0 } 
    613 }; 
    614 PTRNTAB1  aptb1SETNLE[] = /* SETNLE */ { 
    615         { 0xf9f, _cb, _rm8 }, 
    616         { ASM_END, 0, 0 } 
    617 }; 
    618 PTRNTAB1  aptb1SETNO[] = /* SETNO */ { 
    619         { 0xf91, _cb, _rm8 }, 
    620         { ASM_END, 0, 0 } 
    621 }; 
    622 PTRNTAB1  aptb1SETNP[] = /* SETNP */ { 
    623         { 0xf9b, _cb, _rm8 }, 
    624         { ASM_END, 0, 0 } 
    625 }; 
    626 PTRNTAB1  aptb1SETNS[] = /* SETNS */ { 
    627         { 0xf99, _cb, _rm8 }, 
    628         { ASM_END, 0, 0 } 
    629 }; 
    630 PTRNTAB1  aptb1SETNZ[] = /* SETNZ */ { 
    631         { 0xf95, _cb, _rm8 }, 
    632         { ASM_END, 0, 0 } 
    633 }; 
    634 PTRNTAB1  aptb1SETO[] = /* SETO */ { 
    635         { 0xf90, _cb, _rm8 }, 
    636         { ASM_END, 0, 0 } 
    637 }; 
    638 PTRNTAB1  aptb1SETP[] = /* SETP */ { 
    639         { 0xf9a, _cb, _rm8 }, 
    640         { ASM_END, 0, 0 } 
    641 }; 
    642 PTRNTAB1  aptb1SETS[] = /* SETS */ { 
    643         { 0xf98, _cb, _rm8 }, 
    644         { ASM_END, 0, 0 } 
    645 }; 
    646 PTRNTAB1  aptb1SETZ[] = /* SETZ */ { 
    647         { 0xf94, _cb, _rm8 }, 
    648         { ASM_END, 0, 0 } 
    649 }; 
     326#define OPTABLE(str,op) \ 
     327PTRNTAB1 aptb1##str[] = {       \ 
     328        { 0xf90|op, _cb, _rm8 },        \ 
     329        { ASM_END, 0, 0 }       \ 
     330
     331 
     332OPTABLE(SETO,0); 
     333OPTABLE(SETNO,1); 
     334OPTABLE(SETB,2); 
     335OPTABLE(SETNB,3); 
     336OPTABLE(SETZ,4); 
     337OPTABLE(SETNZ,5); 
     338OPTABLE(SETBE,6); 
     339OPTABLE(SETNBE,7); 
     340OPTABLE(SETS,8); 
     341OPTABLE(SETNS,9); 
     342OPTABLE(SETP,0xA); 
     343OPTABLE(SETNP,0xB); 
     344OPTABLE(SETL,0xC); 
     345OPTABLE(SETNL,0xD); 
     346OPTABLE(SETLE,0xE); 
     347OPTABLE(SETNLE,0xF); 
     348 
     349#undef OPTABLE 
     350 
    650351PTRNTAB1  aptb1SGDT[]= /* SGDT */ { 
    651352        { 0xf01, _0, _m48 }, 
     
    692393        { ASM_END, 0, 0 } 
    693394}; 
    694 PTRNTAB2  aptb2ADC[] = /* ADC */ { 
    695         { 0x14, _ib,                _al,                _imm8 }, 
    696         { 0x83, _2|_ib|_16_bit,     _rm16,      _imm8 }, 
    697         { 0x15, _iw|_16_bit,        _ax,                _imm16 }, 
    698         { 0x83, _2|_ib|_32_bit,     _rm32,  _imm8 }, 
    699         { 0x15, _id|_32_bit,        _eax,       _imm32 }, 
    700         { 0x80, _2|_ib,             _rm8,       _imm8 }, 
    701         { 0x81, _2|_iw|_16_bit,     _rm16,      _imm16 }, 
    702         { 0x81, _2|_id|_32_bit,     _rm32,  _imm32 }, 
    703         { 0x10, _r,                 _rm8,       _r8 }, 
    704         { 0x11, _r|_16_bit,         _rm16,      _r16 }, 
    705         { 0x11, _r|_32_bit,         _rm32,      _r32 }, 
    706         { 0x12, _r,                 _r8,        _rm8 }, 
    707         { 0x13, _r|_16_bit,         _r16,       _rm16 }, 
    708         { 0x13, _r|_32_bit,         _r32,       _rm32 }, 
    709         { ASM_END, 0, 0, 0 } 
    710 }; 
    711 PTRNTAB2  aptb2ADD[] = /* ADD */ { 
    712         { 0x04, _ib,            _al,    _imm8 }, 
    713         { 0x83, _0|_ib|_16_bit, _rm16,  _imm8 }, 
    714         { 0x05, _iw | _16_bit,  _ax,    _imm16 }, 
    715         { 0x83, _0|_ib|_32_bit, _rm32,  _imm8 }, 
    716         { 0x05, _id | _32_bit,  _eax,   _imm32 }, 
    717         { 0x80, _0|_ib,         _rm8,   _imm8 }, 
    718         { 0x81, _0|_iw|_16_bit, _rm16,  _imm16 }, 
    719         { 0x81, _0|_id|_32_bit, _rm32,  _imm32 }, 
    720         { 0x00, _r,             _rm8,   _r8 }, 
    721         { 0x01, _r|_16_bit,     _rm16,  _r16 }, 
    722         { 0x01, _r|_32_bit,     _rm32,  _r32 }, 
    723         { 0x2,  _r,             _r8,    _rm8 }, 
    724         { 0x3,  _r|_16_bit,     _r16,   _rm16 }, 
    725         { 0x3,  _r|_32_bit,     _r32,   _rm32 }, 
    726         { ASM_END, 0, 0, 0 } 
    727 }; 
    728  
    729 PTRNTAB2  aptb2AND[] = /* AND */ { 
    730         { 0x24, _ib,            _al,    _imm8 }, 
    731         { 0x83, _4|_ib|_16_bit, _rm16,  _imm8 }, 
    732         { 0x25, _iw|_16_bit,    _ax,    _imm16 }, 
    733         { 0x83, _4|_ib|_32_bit, _rm32,  _imm8 }, 
    734         { 0x25, _id|_32_bit,    _eax,   _imm32 }, 
    735         { 0x80, _4|_ib,         _rm8,   _imm8 }, 
    736         { 0x81, _4|_iw|_16_bit, _rm16,  _imm16 }, 
    737         { 0x81, _4|_id|_32_bit, _rm32,  _imm32 }, 
    738         { 0x20, _r,             _rm8,   _r8 }, 
    739         { 0x21, _r|_16_bit,     _rm16,  _r16 }, 
    740         { 0x21, _r|_32_bit,     _rm32,  _r32 }, 
    741         { 0x22, _r,             _r8,    _rm8 }, 
    742         { 0x23, _r|_16_bit,     _r16,   _rm16 }, 
    743         { 0x23, _r|_32_bit,     _r32,   _rm32 }, 
    744         { ASM_END, 0, 0, 0 } 
    745 }; 
     395 
     396#define OPTABLE(str,op,rr,m) \ 
     397PTRNTAB2  aptb2##str[] = {                                      \ 
     398        { op+4,  _ib|m,                _al,        _imm8 },     \ 
     399        { 0x83, rr|_ib|_16_bit|m,     _rm16,      _imm8 },      \ 
     400        { op+5, _iw|_16_bit|m,        _ax,        _imm16 },     \ 
     401        { 0x83, rr|_ib|_32_bit|m,     _rm32,      _imm8 },      \ 
     402        { 0x83, rr|_ib|_64_bit|m,     _rm64,      _imm8 },      \ 
     403        { op+5, _id|_32_bit|m,        _eax,       _imm32 },     \ 
     404        { op+5, _id|_64_bit|m,        _rax,       _imm32 },     \ 
     405        { 0x80, rr|_ib|m,             _rm8,       _imm8 },      \ 
     406        { 0x81, rr|_iw|_16_bit|m,     _rm16,      _imm16 },     \ 
     407        { 0x81, rr|_id|_32_bit|m,     _rm32,      _imm32 },     \ 
     408        { 0x81, rr|_id|_64_bit|m,     _rm64,      _imm32 },     \ 
     409        { op+0, _r|m,                 _rm8,       _r8 },        \ 
     410        { op+1, _r|_16_bit|m,         _rm16,      _r16 },       \ 
     411        { op+1, _r|_32_bit|m,         _rm32,      _r32 },       \ 
     412        { op+1, _r|_64_bit|m,         _rm64,      _r64 },       \ 
     413        { op+2, _r|m,                 _r8,        _rm8 },       \ 
     414        { op+3, _r|_16_bit|m,         _r16,       _rm16 },      \ 
     415        { op+3, _r|_32_bit|m,         _r32,       _rm32 },      \ 
     416        { op+3, _r|_64_bit|m,         _r64,       _rm64 },      \ 
     417        { ASM_END, 0, 0, 0 }                                    \ 
     418
     419 
     420OPTABLE(ADD,0x00,_0,0); 
     421OPTABLE(OR, 0x08,_1,0); 
     422OPTABLE(ADC,0x10,_2,0); 
     423OPTABLE(SBB,0x18,_3,0); 
     424OPTABLE(AND,0x20,_4,0); 
     425OPTABLE(SUB,0x28,_5,0); 
     426OPTABLE(XOR,0x30,_6,0); 
     427OPTABLE(CMP,0x38,_7,_modnot1); 
     428 
     429#undef OPTABLE 
     430 
    746431PTRNTAB2  aptb2ARPL[] = /* ARPL */ { 
    747432        { 0x63, _r,                     _rm16,  _r16 }, 
     
    756441        { 0x0fbc,       _cw | _16_bit,          _r16,   _rm16 }, 
    757442        { 0x0fbc,       _cd|_32_bit,            _r32,   _rm32 }, 
     443        { 0x0fbc,       _cd|_64_bit,            _r64,   _rm64 }, 
    758444        { ASM_END, 0, 0, 0 } 
    759445}; 
     
    761447        { 0x0fbd,       _cw|_16_bit,            _r16,   _rm16 }, 
    762448        { 0x0fbd,       _cd|_32_bit,            _r32,   _rm32 }, 
     449        { 0x0fbd,       _cd|_64_bit,            _r64,   _rm64 }, 
    763450        { ASM_END, 0, 0, 0 } 
    764451}; 
     
    766453        { 0x0fa3,       _cw|_16_bit|_modnot1,           _rm16,  _r16 }, 
    767454        { 0x0fa3,       _cd|_32_bit|_modnot1,           _rm32,  _r32 }, 
     455        { 0x0fa3,       _cd|_64_bit|_modnot1,           _rm64,  _r64 }, 
    768456        { 0x0fba,       _4|_ib|_16_bit|_modnot1,        _rm16,  _imm8 }, 
    769457        { 0x0fba,       _4|_ib|_32_bit|_modnot1,        _rm32,  _imm8 }, 
     458        { 0x0fba,       _4|_ib|_64_bit|_modnot1,        _rm64,  _imm8 }, 
    770459        { ASM_END, 0, 0, 0 } 
    771460}; 
     
    773462        { 0x0fbb,       _cw|_16_bit,            _rm16,  _r16 }, 
    774463        { 0x0fbb,       _cd|_32_bit,            _rm32,  _r32 }, 
     464        { 0x0fbb,       _cd|_64_bit,            _rm64,  _r64 }, 
    775465        { 0x0fba,       _7|_ib|_16_bit, _rm16,  _imm8 }, 
    776466        { 0x0fba,       _7|_ib|_32_bit, _rm32,  _imm8 }, 
     467        { 0x0fba,       _7|_ib|_64_bit, _rm64,  _imm8 }, 
    777468        { ASM_END, 0, 0, 0 } 
    778469}; 
     
    780471        { 0x0fb3,       _cw|_16_bit,            _rm16,  _r16 }, 
    781472        { 0x0fb3,       _cd|_32_bit,            _rm32,  _r32 }, 
     473        { 0x0fb3,       _cd|_64_bit,            _rm64,  _r64 }, 
    782474        { 0x0fba,       _6|_ib|_16_bit,         _rm16,  _imm8 }, 
    783475        { 0x0fba,       _6|_ib|_32_bit,         _rm32,  _imm8 }, 
     476        { 0x0fba,       _6|_ib|_64_bit,         _rm64,  _imm8 }, 
    784477        { ASM_END, 0, 0, 0 } 
    785478}; 
     
    787480        { 0x0fab,       _cw|_16_bit,            _rm16,  _r16 }, 
    788481        { 0x0fab,       _cd|_32_bit,            _rm32,  _r32 }, 
     482        { 0x0fab,       _cd|_64_bit,            _rm64,  _r64 }, 
    789483        { 0x0fba,       _5|_ib|_16_bit,         _rm16,  _imm8 }, 
    790484        { 0x0fba,       _5|_ib|_32_bit,         _rm32,  _imm8 }, 
    791         { ASM_END, 0, 0, 0 } 
    792 }; 
    793 PTRNTAB2  aptb2CMP[] = /* CMP */ { 
    794         { 0x3c, _ib|_modnot1,           _al,    _imm8 }, 
    795         { 0x83, _7|_ib|_16_bit|_modnot1,        _rm16,  _imm8 }, 
    796         { 0x3d, _iw|_16_bit|_modnot1,   _ax,    _imm16 }, 
    797         { 0x83, _7|_ib|_32_bit|_modnot1,        _rm32,  _imm8 }, 
    798         { 0x3d, _id|_32_bit|_modnot1,   _eax,   _imm32 }, 
    799         { 0x80, _7|_ib|_modnot1,                _rm8,   _imm8 }, 
    800         { 0x81, _7|_iw|_16_bit|_modnot1,        _rm16,  _imm16 }, 
    801         { 0x81, _7|_id|_32_bit|_modnot1,        _rm32,  _imm32 }, 
    802         { 0x38, _r|_modnot1,            _rm8,   _r8 }, 
    803         { 0x39, _r|_16_bit|_modnot1,    _rm16,  _r16 }, 
    804         { 0x39, _r|_32_bit|_modnot1,    _rm32,  _r32 }, 
    805         { 0x3a, _r|_modnot1,            _r8,    _rm8 }, 
    806         { 0x3b, _r|_16_bit|_modnot1,    _r16,   _rm16 }, 
    807         { 0x3b, _r|_32_bit|_modnot1,    _r32,   _rm32 }, 
     485        { 0x0fba,       _5|_ib|_64_bit,         _rm64,  _imm8 }, 
    808486        { ASM_END, 0, 0, 0 } 
    809487}; 
     
    931609        { 0xb8, _rw | _16_bit,  _r16 | _plus_r, _imm16          }, 
    932610        { 0xb8, _rd|_32_bit,    _r32 | _plus_r, _imm32          }, 
     611        { 0xb8, _rd|_64_bit,    _r64 | _plus_r, _imm32          }, 
    933612        { 0xc6, _cb,            _rm8,           _imm8           }, 
    934613        { 0xc7, _cw|_16_bit,    _rm16,          _imm16          }, 
     
    987666        { ASM_END, 0, 0, 0 } 
    988667}; 
    989 PTRNTAB2  aptb2OR[] = /* OR */ { 
    990         { 0x0c, _ib,            _al,    _imm8 }, 
    991         { 0x83, _1|_ib|_16_bit,         _rm16,  _imm8 }, 
    992         { 0x0d, _iw|_16_bit,            _ax,    _imm16 }, 
    993         { 0x83, _1|_ib|_32_bit,         _rm32,  _imm8 }, 
    994         { 0x0d, _id|_32_bit,            _eax,   _imm32 }, 
    995         { 0x80, _1|_ib,         _rm8,   _imm8 }, 
    996         { 0x81, _1|_iw|_16_bit,         _rm16,  _imm16 }, 
    997         { 0x81, _1|_id|_32_bit,         _rm32,  _imm32 }, 
    998         { 0x08, _r,                     _rm8,   _r8 }, 
    999         { 0x09, _r|_16_bit,                     _rm16,  _r16 }, 
    1000         { 0x09, _r|_32_bit,                     _rm32,  _r32 }, 
    1001         { 0x0a, _r,                     _r8,    _rm8 }, 
    1002         { 0x0b, _r|_16_bit,                     _r16,   _rm16 }, 
    1003         { 0x0b, _r|_32_bit,                     _r32,   _rm32 }, 
    1004         { ASM_END, 0, 0, 0 } 
    1005 }; 
    1006668PTRNTAB2  aptb2OUT[] = { 
    1007669        { 0xe6, _ib,            _imm8,  _al }, 
     
    1019681        { ASM_END, 0, 0, 0 } 
    1020682}; 
    1021 PTRNTAB2  aptb2RCL[] = /* RCL */{ 
    1022 //      { 0xd0, _2,                     _rm8,   0 }, 
    1023         { 0xd2, _2,                     _rm8,   _cl }, 
    1024         { 0xc0, _2|_ib,         _rm8,   _imm8 }, 
    1025 //      { 0xd1, _2|_16_bit,                     _rm16,  0 }, 
    1026         { 0xd3, _2|_16_bit,                     _rm16,  _cl }, 
    1027         { 0xc1, _2|_ib|_16_bit,         _rm16,  _imm8 }, 
    1028 //      { 0xd1, _2|_32_bit,                     _rm32,  0 }, 
    1029         { 0xd3, _2|_32_bit,                     _rm32,  _cl }, 
    1030         { 0xc1, _2|_ib|_32_bit,         _rm32,  _imm8, }, 
    1031         { ASM_END, 0, 0, 0 } 
    1032 }; 
    1033 PTRNTAB2  aptb2RCR[] = /* RCR */ { 
    1034 //      { 0xd0, _3,                     _rm8,   0 }, 
    1035         { 0xd2, _3,                     _rm8,   _cl }, 
    1036         { 0xc0, _3|_ib,         _rm8,   _imm8 }, 
    1037 //      { 0xd1, _3|_16_bit,                     _rm16,  0 }, 
    1038         { 0xd3, _3|_16_bit,                     _rm16,  _cl }, 
    1039         { 0xc1, _3|_ib|_16_bit,         _rm16,  _imm8 }, 
    1040 //      { 0xd1, _3|_32_bit,                     _rm32,  0 }, 
    1041         { 0xd3, _3|_32_bit,                     _rm32,  _cl }, 
    1042         { 0xc1, _3|_ib|_32_bit,         _rm32,  _imm8 }, 
    1043         { ASM_END, 0, 0, 0 } 
    1044 }; 
    1045 PTRNTAB2  aptb2ROL[] = /* ROL */ { 
    1046 //      { 0xd0, _0,                     _rm8,   0 }, 
    1047         { 0xd2, _0,                     _rm8,   _cl }, 
    1048         { 0xc0, _0,                     _rm8,   _imm8 }, 
    1049 //      { 0xd1, _0|_16_bit,                     _rm16,  0 }, 
    1050         { 0xd3, _0|_16_bit,                     _rm16,  _cl }, 
    1051         { 0xc1, _0|_16_bit,                     _rm16,  _imm8 }, 
    1052 //      { 0xd1, _0|_32_bit,                     _rm32,  0 }, 
    1053         { 0xd3, _0|_32_bit,                     _rm32,  _cl }, 
    1054         { 0xc1, _0|_32_bit,                     _rm32,  _imm8 }, 
    1055         { ASM_END, 0, 0, 0 } 
    1056 }; 
    1057 PTRNTAB2  aptb2ROR[] = /* ROR */ { 
    1058 //      { 0xd0, _1,                     _rm8, 0 }, 
    1059         { 0xd2, _1,                     _rm8, _cl }, 
    1060         { 0xc0, _1,                     _rm8, _imm8 }, 
    1061 //      { 0xd1, _1|_16_bit,                     _rm16, 0 }, 
    1062         { 0xd3, _1|_16_bit,                     _rm16, _cl }, 
    1063         { 0xc1, _1|_16_bit,                     _rm16, _imm8 }, 
    1064 //      { 0xd1, _1|_32_bit,                     _rm32, 0 }, 
    1065         { 0xd3, _1|_32_bit,                     _rm32, _cl }, 
    1066         { 0xc1, _1|_32_bit,                     _rm32,  _imm8 }, 
    1067         { ASM_END, 0, 0, 0 } 
    1068 }; 
    1069 PTRNTAB2  aptb2SAL[] = /* SAL */ { 
    1070 //      { 0xd0, _4,                     _rm8, 0 }, 
    1071         { 0xd2, _4,                     _rm8, _cl }, 
    1072         { 0xc0, _4,                     _rm8, _imm8 }, 
    1073 //      { 0xd1, _4|_16_bit,                     _rm16, 0 }, 
    1074         { 0xd3, _4|_16_bit,                     _rm16, _cl }, 
    1075         { 0xc1, _4|_16_bit,                     _rm16, _imm8 }, 
    1076 //      { 0xd1, _4|_32_bit,                     _rm32, 0 }, 
    1077         { 0xd3, _4|_32_bit,                     _rm32, _cl }, 
    1078         { 0xc1, _4|_32_bit,                     _rm32,  _imm8 }, 
    1079         { ASM_END, 0, 0, 0 } 
    1080 }; 
    1081 PTRNTAB2  aptb2SBB[] = /* SBB */ { 
    1082         { 0x1c, _ib,            _al,    _imm8 }, 
    1083         { 0x83, _3|_16_bit,                     _rm16,  _imm8 }, 
    1084         { 0x1d, _iw|_16_bit,            _ax,    _imm16 }, 
    1085         { 0x83, _3|_32_bit,                     _rm32,  _imm8 }, 
    1086         { 0x1d, _id|_32_bit,            _eax,   _imm32 }, 
    1087         { 0x80, _3 | _ib,       _rm8,   _imm8 }, 
    1088         { 0x81, _3 | _iw|_16_bit,       _rm16,  _imm16 }, 
    1089         { 0x81, _3 | _id|_32_bit,       _rm32,  _imm32 }, 
    1090         { 0x18, _r,                     _rm8,   _r8 }, 
    1091         { 0x19, _r|_16_bit,                     _rm16,  _r16 }, 
    1092         { 0x19, _r|_32_bit,                     _rm32,  _r32 }, 
    1093         { 0x1A, _r,                     _r8,    _rm8 }, 
    1094         { 0x1B, _r|_16_bit,                     _r16,   _rm16 }, 
    1095         { 0x1B, _r|_32_bit,                     _r32,   _rm32 }, 
    1096         { ASM_END, 0, 0, 0 } 
    1097 }; 
    1098  
    1099  
    1100 PTRNTAB2  aptb2SAR[] = /* SAR */ { 
    1101 //      { 0xd0, _7,                     _rm8, 0 }, 
    1102         { 0xd2, _7,                     _rm8, _cl }, 
    1103         { 0xc0, _7,                     _rm8, _imm8 }, 
    1104 //      { 0xd1, _7|_16_bit,                     _rm16, 0 }, 
    1105         { 0xd3, _7|_16_bit,                     _rm16, _cl }, 
    1106         { 0xc1, _7|_16_bit,                     _rm16, _imm8 }, 
    1107 //      { 0xd1, _7|_32_bit,                     _rm32, 0 }, 
    1108         { 0xd3, _7|_32_bit,                     _rm32, _cl }, 
    1109         { 0xc1, _7|_32_bit,                     _rm32,  _imm8 }, 
    1110         { ASM_END, 0, 0, 0 } 
    1111 }; 
    1112 PTRNTAB2  aptb2SHL[] = /* SHL */ { 
    1113 //      { 0xd0, _4,                     _rm8, 0 }, 
    1114         { 0xd2, _4,                     _rm8, _cl }, 
    1115         { 0xc0, _4,                     _rm8, _imm8 }, 
    1116 //      { 0xd1, _4|_16_bit,                     _rm16, 0 }, 
    1117         { 0xd3, _4|_16_bit,                     _rm16, _cl }, 
    1118         { 0xc1, _4|_16_bit,                     _rm16, _imm8 }, 
    1119 //      { 0xd1, _4|_32_bit,                     _rm32, 0 }, 
    1120         { 0xd3, _4|_32_bit,                     _rm32, _cl }, 
    1121         { 0xc1, _4|_32_bit,                     _rm32,  _imm8 }, 
    1122         { ASM_END, 0, 0, 0 } 
    1123 }; 
    1124 PTRNTAB2  aptb2SHR[] = /* SHR */ { 
    1125 //      { 0xd0, _5,                     _rm8, 0 }, 
    1126         { 0xd2, _5,                     _rm8, _cl }, 
    1127         { 0xc0, _5,                     _rm8, _imm8 }, 
    1128 //      { 0xd1, _5|_16_bit,                     _rm16, 0 }, 
    1129         { 0xd3, _5|_16_bit,                     _rm16, _cl }, 
    1130         { 0xc1, _5|_16_bit,                     _rm16, _imm8 }, 
    1131 //      { 0xd1, _5|_32_bit,                     _rm32, 0 }, 
    1132         { 0xd3, _5|_32_bit,                     _rm32, _cl }, 
    1133         { 0xc1, _5|_32_bit,                     _rm32,  _imm8 }, 
    1134         { ASM_END, 0, 0, 0 } 
    1135 }; 
    1136 PTRNTAB2  aptb2SUB[] = /* SUB */ { 
    1137         { 0x2c, _ib,            _al,    _imm8 }, 
    1138         { 0x83, _5|_16_bit,                     _rm16,  _imm8 }, 
    1139         { 0x2d, _iw|_16_bit,            _ax,    _imm16 }, 
    1140         { 0x83, _5|_32_bit,                     _rm32,  _imm8 }, 
    1141         { 0x2d, _id|_32_bit,            _eax,   _imm32 }, 
    1142         { 0x80, _5 | _ib,       _rm8,   _imm8 }, 
    1143         { 0x81, _5 | _iw|_16_bit,       _rm16,  _imm16 }, 
    1144         { 0x81, _5 | _id|_32_bit,       _rm32,  _imm32 }, 
    1145         { 0x28, _r,                     _rm8,   _r8 }, 
    1146         { 0x29, _r|_16_bit,                     _rm16,  _r16 }, 
    1147         { 0x29, _r|_32_bit,                     _rm32,  _r32 }, 
    1148         { 0x2A, _r,                     _r8,    _rm8 }, 
    1149         { 0x2B, _r|_16_bit,                     _r16,   _rm16 }, 
    1150         { 0x2B, _r|_32_bit,                     _r32,   _rm32 }, 
    1151         { ASM_END, 0, 0, 0 } 
    1152 }; 
     683 
     684#define OPTABLE(str,op) \ 
     685PTRNTAB2  aptb2##str[] = {      \ 
     686        { 0xd2, op,             _rm8,   _cl },  \ 
     687        { 0xc0, op|_ib,         _rm8,   _imm8 },        \ 
     688        { 0xd3, op|_16_bit,     _rm16,  _cl },  \ 
     689        { 0xc1, op|_ib|_16_bit, _rm16,  _imm8 },        \ 
     690        { 0xd3, op|_32_bit,     _rm32,  _cl },  \ 
     691        { 0xc1, op|_ib|_32_bit, _rm32,  _imm8, },       \ 
     692        { 0xd3, op|_64_bit,     _rm64,  _cl },  \ 
     693        { 0xc1, op|_ib|_64_bit, _rm64,  _imm8, },       \ 
     694        { ASM_END, 0, 0, 0 }    \ 
     695
     696 
     697OPTABLE(ROL,_0); 
     698OPTABLE(ROR,_1); 
     699OPTABLE(RCL,_2); 
     700OPTABLE(RCR,_3); 
     701OPTABLE(SHL,_4); 
     702OPTABLE(SHR,_5); 
     703OPTABLE(SAR,_7); 
     704 
     705#undef OPTABLE 
     706 
    1153707PTRNTAB2  aptb2TEST[] = /* TEST */ { 
    1154708        { 0xa8, _ib|_modnot1,           _al,    _imm8 }, 
     
    1185739        { ASM_END, 0, 0, 0 } 
    1186740}; 
    1187 PTRNTAB2  aptb2XOR[] = { 
    1188         { 0x34, _ib,    _al,    _imm8 }, 
    1189         { 0x83, _6|_16_bit,             _rm16,  _imm8 }, 
    1190         { 0x35, _iw|_16_bit,    _ax,    _imm16 }, 
    1191         { 0x83, _6|_32_bit,             _rm32,  _imm8 }, 
    1192         { 0x35, _id|_32_bit,    _eax,   _imm32 }, 
    1193         { 0x80, _6,             _rm8,   _imm8 }, 
    1194         { 0x81, _6|_16_bit,             _rm16,  _imm16 }, 
    1195         { 0x81, _6|_32_bit,             _rm32,  _imm32 }, 
    1196         { 0x30, _r,             _rm8, _r8 }, 
    1197         { 0x31, _r|_16_bit,             _rm16, _r16 }, 
    1198         { 0x31, _r|_32_bit,             _rm32, _r32 }, 
    1199         { 0x32, _r,             _r8,    _rm8 }, 
    1200         { 0x33, _r|_16_bit,             _r16,   _rm16 }, 
    1201         { 0x33, _r|_32_bit,             _r32,   _rm32 }, 
    1202         { ASM_END, 0, 0, 0 } 
    1203 }; 
    1204  
    1205 PTRNTAB2  aptb2CMOVO[] = { 
    1206         { 0x0F40, _r|_16_bit,   _r16,   _rm16 }, 
    1207         { 0x0F40, _r|_32_bit,   _r32,   _rm32 }, 
    1208         { ASM_END, 0, 0, 0 } 
    1209 }; 
    1210 PTRNTAB2  aptb2CMOVNO[] = { 
    1211         { 0x0F41, _r|_16_bit,   _r16,   _rm16 }, 
    1212         { 0x0F41, _r|_32_bit,   _r32,   _rm32 }, 
    1213         { ASM_END, 0, 0, 0 } 
    1214 }; 
    1215 PTRNTAB2  aptb2CMOVB[] = { 
    1216         { 0x0F42, _r|_16_bit,   _r16,   _rm16 }, 
    1217         { 0x0F42, _r|_32_bit,   _r32,   _rm32 }, 
    1218         { ASM_END, 0, 0, 0 } 
    1219 }; 
    1220 PTRNTAB2  aptb2CMOVNB[] = { 
    1221         { 0x0F43, _r|_16_bit,   _r16,   _rm16 }, 
    1222         { 0x0F43, _r|_32_bit,   _r32,   _rm32 }, 
    1223         { ASM_END, 0, 0, 0 } 
    1224 }; 
    1225 PTRNTAB2  aptb2CMOVZ[] = { 
    1226         { 0x0F44, _r|_16_bit,   _r16,   _rm16 }, 
    1227         { 0x0F44, _r|_32_bit,   _r32,   _rm32 }, 
    1228         { ASM_END, 0, 0, 0 } 
    1229 }; 
    1230 PTRNTAB2  aptb2CMOVNZ[] = { 
    1231         { 0x0F45, _r|_16_bit,   _r16,   _rm16 }, 
    1232         { 0x0F45, _r|_32_bit,   _r32,   _rm32 }, 
    1233         { ASM_END, 0, 0, 0 } 
    1234 }; 
    1235 PTRNTAB2  aptb2CMOVBE[] = { 
    1236         { 0x0F46, _r|_16_bit,   _r16,   _rm16 }, 
    1237         { 0x0F46, _r|_32_bit,   _r32,   _rm32 }, 
    1238         { ASM_END, 0, 0, 0 } 
    1239 }; 
    1240 PTRNTAB2  aptb2CMOVNBE[] = { 
    1241         { 0x0F47, _r|_16_bit,   _r16,   _rm16 }, 
    1242         { 0x0F47, _r|_32_bit,   _r32,   _rm32 }, 
    1243         { ASM_END, 0, 0, 0 } 
    1244 }; 
    1245 PTRNTAB2  aptb2CMOVS[] = { 
    1246         { 0x0F48, _r|_16_bit,   _r16,   _rm16 }, 
    1247         { 0x0F48, _r|_32_bit,   _r32,   _rm32 }, 
    1248         { ASM_END, 0, 0, 0 } 
    1249 }; 
    1250 PTRNTAB2  aptb2CMOVNS[] = { 
    1251         { 0x0F49, _r|_16_bit,   _r16,   _rm16 }, 
    1252         { 0x0F49, _r|_32_bit,   _r32,   _rm32 }, 
    1253         { ASM_END, 0, 0, 0 } 
    1254 }; 
    1255 PTRNTAB2  aptb2CMOVP[] = { 
    1256         { 0x0F4A, _r|_16_bit,   _r16,   _rm16 }, 
    1257         { 0x0F4A, _r|_32_bit,   _r32,   _rm32 }, 
    1258         { ASM_END, 0, 0, 0 } 
    1259 }; 
    1260 PTRNTAB2  aptb2CMOVNP[] = { 
    1261         { 0x0F4B, _r|_16_bit,   _r16,   _rm16 }, 
    1262         { 0x0F4B, _r|_32_bit,   _r32,   _rm32 }, 
    1263         { ASM_END, 0, 0, 0 } 
    1264 }; 
    1265 PTRNTAB2  aptb2CMOVL[] = { 
    1266         { 0x0F4C, _r|_16_bit,   _r16,   _rm16 }, 
    1267         { 0x0F4C, _r|_32_bit,   _r32,   _rm32 }, 
    1268         { ASM_END, 0, 0, 0 } 
    1269 }; 
    1270 PTRNTAB2  aptb2CMOVNL[] = { 
    1271         { 0x0F4D, _r|_16_bit,   _r16,   _rm16 }, 
    1272         { 0x0F4D, _r|_32_bit,   _r32,   _rm32 }, 
    1273         { ASM_END, 0, 0, 0 } 
    1274 }; 
    1275 PTRNTAB2  aptb2CMOVLE[] = { 
    1276         { 0x0F4E, _r|_16_bit,   _r16,   _rm16 }, 
    1277         { 0x0F4E, _r|_32_bit,   _r32,   _rm32 }, 
    1278         { ASM_END, 0, 0, 0 } 
    1279 }; 
    1280 PTRNTAB2  aptb2CMOVNLE[] = { 
    1281         { 0x0F4F, _r|_16_bit,   _r16,   _rm16 }, 
    1282         { 0x0F4F, _r|_32_bit,   _r32,   _rm32 }, 
    1283         { ASM_END, 0, 0, 0 } 
    1284 }; 
     741 
     742#define OPTABLE(str,op) \ 
     743PTRNTAB2  aptb2##str[] = {      \ 
     744        { 0x0F40|op, _r|_16_bit,   _r16,   _rm16 },     \ 
     745        { 0x0F40|op, _r|_32_bit,   _r32,   _rm32 },     \ 
     746        { 0x0F40|op, _r|_64_bit,   _r64,   _rm64 },     \ 
     747        { ASM_END, 0, 0, 0 }    \ 
     748
     749 
     750OPTABLE(CMOVO,0); 
     751OPTABLE(CMOVNO,1); 
     752OPTABLE(CMOVB,2); 
     753OPTABLE(CMOVNB,3); 
     754OPTABLE(CMOVZ,4); 
     755OPTABLE(CMOVNZ,5); 
     756OPTABLE(CMOVBE,6); 
     757OPTABLE(CMOVNBE,7); 
     758OPTABLE(CMOVS,8); 
     759OPTABLE(CMOVNS,9); 
     760OPTABLE(CMOVP,0xA); 
     761OPTABLE(CMOVNP,0xB); 
     762OPTABLE(CMOVL,0xC); 
     763OPTABLE(CMOVNL,0xD); 
     764OPTABLE(CMOVLE,0xE); 
     765OPTABLE(CMOVNLE,0xF); 
     766 
     767#undef OPTABLE 
    1285768 
    1286769PTRNTAB3  aptb3IMUL[] = /* IMUL */ { 
     
    1323806// interpretations 
    1324807// 
    1325 PTRNTAB0  aptb0F2XM1[] = /* F2XM1 */ { 
    1326         { 0xd9f0, 0 } 
    1327 }; 
    1328 PTRNTAB0  aptb0FABS[] = /* FABS */ { 
    1329         { 0xd9e1, 0 } 
    1330 }; 
    1331 PTRNTAB0  aptb0FCHS[] = /* FCHS */ { 
    1332         { 0xd9e0, 0 } 
    1333 }; 
    1334 PTRNTAB0  aptb0FCLEX[] = /* FCLEX */ { 
    1335         { 0xdbe2, _fwait } 
    1336 }; 
    1337 PTRNTAB0  aptb0FNCLEX[] = /* FNCLEX */ { 
    1338         { 0xdbe2, _nfwait } 
    1339 }; 
    1340 PTRNTAB0  aptb0FCOMPP[] = /* FCOMPP */ { 
    1341         { 0xded9, 0 } 
    1342 }; 
    1343 PTRNTAB0  aptb0FCOS[] = /* FCOS */ { 
    1344         { 0xd9ff, 0 } 
    1345 }; 
    1346 PTRNTAB0  aptb0FUCOMPP[] = /* FUCOMPP */ { 
    1347         { 0xdae9, 0 } 
    1348 }; 
    1349 PTRNTAB0  aptb0FDECSTP[] = /* FDECSTP */ { 
    1350         { 0xd9f6, 0 } 
    1351 }; 
    1352 PTRNTAB0  aptb0FINCSTP[] = /* FINCSTP */ { 
    1353         { 0xd9f7, 0 } 
    1354 }; 
    1355 PTRNTAB0  aptb0FINIT[] = /* FINIT */ { 
    1356         { 0xdbe3, _fwait } 
    1357 }; 
    1358 PTRNTAB0  aptb0FNINIT[] = /* FNINIT */ { 
    1359         { 0xdbe3, _nfwait } 
    1360 }; 
    1361 PTRNTAB0  aptb0FENI[] = /* FENI */ { 
    1362         { 0xdbe0, _fwait } 
    1363 }; 
    1364 PTRNTAB0  aptb0FNENI[] = /* FNENI */ { 
    1365         { 0xdbe0, _nfwait } 
    1366 }; 
    1367 PTRNTAB0  aptb0FDISI[] = /* FDISI */ { 
    1368         { 0xdbe1, _fwait } 
    1369 }; 
    1370 PTRNTAB0  aptb0FNDISI[] = /* FNDISI */ { 
    1371         { 0xdbe1, _nfwait } 
    1372 }; 
    1373 PTRNTAB0  aptb0FLD1[] = /* FLD1 */ { 
    1374         { 0xd9e8, 0 } 
    1375 }; 
    1376 PTRNTAB0  aptb0FLDL2T[] = /* FLDL2T */ { 
    1377         { 0xd9e9, 0 } 
    1378 }; 
    1379 PTRNTAB0  aptb0FLDL2E[] = /* FLDL2E */ { 
    1380         { 0xd9ea, 0 } 
    1381 }; 
    1382 PTRNTAB0  aptb0FLDPI[] = /* FLDPI */ { 
    1383         { 0xd9eb, 0 } 
    1384 }; 
    1385 PTRNTAB0  aptb0FLDLG2[] = /* FLDLG2 */ { 
    1386         { 0xd9ec, 0 } 
    1387 }; 
    1388 PTRNTAB0  aptb0FLDLN2[] = /* FLDLN2 */ { 
    1389         { 0xd9ed, 0 } 
    1390 }; 
    1391 PTRNTAB0  aptb0FLDZ[] = /* FLDZ */ { 
    1392         { 0xd9ee, 0 } 
    1393 }; 
    1394 PTRNTAB0  aptb0FNOP[] = /* FNOP */ { 
    1395         { 0xd9d0, 0 } 
    1396 }; 
    1397 PTRNTAB0  aptb0FPATAN[] = /* FPATAN */ { 
    1398         { 0xd9f3, 0 } 
    1399 }; 
    1400 PTRNTAB0  aptb0FPREM[] = /* FPREM */ { 
    1401         { 0xd9f8, 0 } 
    1402 }; 
    1403 PTRNTAB0  aptb0FPREM1[] = /* FPREM1 */ { 
    1404         { 0xd9f5, 0 } 
    1405 }; 
    1406 PTRNTAB0  aptb0FPTAN[] = /* FPTAN */ { 
    1407         { 0xd9f2, 0 } 
    1408 }; 
    1409 PTRNTAB0  aptb0FRNDINT[] = /* FRNDINT */ { 
    1410         { 0xd9fc, 0 } 
    1411 }; 
    1412 PTRNTAB0  aptb0FSCALE[] = /* FSCALE */ { 
    1413         { 0xd9fd, 0 } 
    1414 }; 
    1415 PTRNTAB0  aptb0FSETPM[] = /* FSETPM */ { 
    1416         { 0xdbe4, 0 } 
    1417 }; 
    1418 PTRNTAB0  aptb0FSIN[] = /* FSIN */ { 
    1419         { 0xd9fe, 0 } 
    1420 }; 
    1421 PTRNTAB0  aptb0FSINCOS[] = /* FSINCOS */ { 
    1422         { 0xd9fb, 0 } 
    1423 }; 
    1424 PTRNTAB0  aptb0FSQRT[] = /* FSQRT */ { 
    1425         { 0xd9fa, 0 } 
    1426 }; 
    1427 PTRNTAB0  aptb0FTST[] = /* FTST */ { 
    1428         { 0xd9e4, 0 } 
    1429 }; 
    1430 PTRNTAB0  aptb0FWAIT[] = /* FWAIT */ { 
    1431         { 0x9b, 0 } 
    1432 }; 
    1433 PTRNTAB0  aptb0FXAM[] = /* FXAM */ { 
    1434         { 0xd9e5, 0 } 
    1435 }; 
    1436 PTRNTAB0  aptb0FXTRACT[] = /* FXTRACT */ { 
    1437         { 0xd9f4, 0 } 
    1438 }; 
    1439 PTRNTAB0  aptb0FYL2X[] = /* FYL2X */ { 
    1440         { 0xd9f1, 0 } 
    1441 }; 
    1442 PTRNTAB0  aptb0FYL2XP1[] = /* FYL2XP1 */ { 
    1443         { 0xd9f9, 0 } 
    1444 }; 
     808 
     809OPTABLE0(F2XM1,    0xd9f0,0); 
     810OPTABLE0(FABS,     0xd9e1,0); 
     811OPTABLE0(FCHS,     0xd9e0,0); 
     812OPTABLE0(FCLEX,    0xdbe2,_fwait); 
     813OPTABLE0(FNCLEX,   0xdbe2, _nfwait); 
     814OPTABLE0(FCOMPP,   0xded9, 0); 
     815OPTABLE0(FCOS,     0xd9ff, 0); 
     816OPTABLE0(FUCOMPP,  0xdae9, 0); 
     817OPTABLE0(FDECSTP,  0xd9f6, 0); 
     818OPTABLE0(FINCSTP,  0xd9f7, 0); 
     819OPTABLE0(FINIT,    0xdbe3, _fwait); 
     820OPTABLE0(FNINIT,   0xdbe3, _nfwait); 
     821OPTABLE0(FENI,     0xdbe0, _fwait); 
     822OPTABLE0(FNENI,    0xdbe0, _nfwait); 
     823OPTABLE0(FDISI,    0xdbe1, _fwait); 
     824OPTABLE0(FNDISI,   0xdbe1, _nfwait); 
     825OPTABLE0(FLD1,     0xd9e8, 0); 
     826OPTABLE0(FLDL2T,   0xd9e9, 0); 
     827OPTABLE0(FLDL2E,   0xd9ea, 0); 
     828OPTABLE0(FLDPI,    0xd9eb, 0); 
     829OPTABLE0(FLDLG2,   0xd9ec, 0); 
     830OPTABLE0(FLDLN2,   0xd9ed, 0); 
     831OPTABLE0(FLDZ,     0xd9ee, 0); 
     832OPTABLE0(FNOP,     0xd9d0, 0); 
     833OPTABLE0(FPATAN,   0xd9f3, 0); 
     834OPTABLE0(FPREM,    0xd9f8, 0); 
     835OPTABLE0(FPREM1,   0xd9f5, 0); 
     836OPTABLE0(FPTAN,    0xd9f2, 0); 
     837OPTABLE0(FRNDINT,  0xd9fc, 0); 
     838OPTABLE0(FSCALE,   0xd9fd, 0); 
     839OPTABLE0(FSETPM,   0xdbe4, 0); 
     840OPTABLE0(FSIN,     0xd9fe, 0); 
     841OPTABLE0(FSINCOS,  0xd9fb, 0); 
     842OPTABLE0(FSQRT,    0xd9fa, 0); 
     843OPTABLE0(FTST,     0xd9e4, 0); 
     844OPTABLE0(FWAIT,    0x9b, 0); 
     845OPTABLE0(FXAM,     0xd9e5, 0); 
     846OPTABLE0(FXTRACT,  0xd9f4, 0); 
     847OPTABLE0(FYL2X,    0xd9f1, 0); 
     848OPTABLE0(FYL2XP1,  0xd9f9, 0); 
    1445849// 
    1446850// Floating point instructions which have entirely different flag 
     
    32212625        /*X("cmpsd",    0,              aptb0CMPSD )*/ \ 
    32222626        X("cmpsd",      ITopt|3,        (P) aptb3CMPSD ) \ 
     2627        X("cmpsq",      0,              aptb0CMPSQ ) \ 
    32232628        X("cmpss",      3,              (P) aptb3CMPSS ) \ 
    32242629        X("cmpsw",      0,              aptb0CMPSW ) \ 
     
    34502855        X("lodsb",      0,              aptb0LODSB ) \ 
    34512856        X("lodsd",      0,              aptb0LODSD ) \ 
     2857        X("lodsq",      0,              aptb0LODSQ ) \ 
    34522858        X("lodsw",      0,              aptb0LODSW ) \ 
    34532859        X("loop",       ITjump | 1,     (P) aptb1LOOP ) \ 
    34542860        X("loope",      ITjump | 1,     (P) aptb1LOOPE ) \ 
    34552861        X("loopne",     ITjump | 1,     (P) aptb1LOOPNE ) \ 
    3456         X("loopnz",     ITjump | 1,     (P) aptb1LOOPNZ ) \ 
    3457         X("loopz",      ITjump | 1,     (P) aptb1LOOPZ ) \ 
     2862        X("loopnz",     ITjump | 1,     (P) aptb1LOOPNE ) \ 
     2863        X("loopz",      ITjump | 1,     (P) aptb1LOOPE ) \ 
    34582864        X("lsl",        2,              (P) aptb2LSL ) \ 
    34592865        X("lss",        2,              (P) aptb2LSS ) \ 
     
    34992905        X("movshdup",   2,              (P) aptb2MOVSHDUP ) \ 
    35002906        X("movsldup",   2,              (P) aptb2MOVSLDUP ) \ 
     2907        X("movsq",      0,              aptb0MOVSQ ) \ 
    35012908        X("movss",      2,              (P) aptb2MOVSS ) \ 
    35022909        X("movsw",      0,              aptb0MOVSW ) \ 
     
    36453052        X("rsqrtss",    2,              (P) aptb2RSQRTSS ) \ 
    36463053        X("sahf",       0,              aptb0SAHF ) \ 
    3647         X("sal",        ITshift | 2,    (P) aptb2SAL ) \ 
     3054        X("sal",        ITshift | 2,    (P) aptb2SHL ) \ 
    36483055        X("sar",        ITshift | 2,    (P) aptb2SAR ) \ 
    36493056        X("sbb",        2,              (P) aptb2SBB ) \ 
     
    36513058        X("scasb",      0,              aptb0SCASB ) \ 
    36523059        X("scasd",      0,              aptb0SCASD ) \ 
     3060        X("scasq",      0,              aptb0SCASQ ) \ 
    36533061        X("scasw",      0,              aptb0SCASW ) \ 
    36543062        X("seta",       1,              (P) aptb1SETNBE ) \ 
     
    37043112        X("stosb",      0,              aptb0STOSB ) \ 
    37053113        X("stosd",      0,              aptb0STOSD ) \ 
     3114        X("stosq",      0,              aptb0STOSQ ) \ 
    37063115        X("stosw",      0,              aptb0STOSW ) \ 
    37073116        X("str",        1,              (P) aptb1STR ) \ 
  • branches/dmd-1.x/src/e2ir.c

    r618 r621  
    41504150        n1 = array_toPtr(t1, n1); 
    41514151 
    4152         {   elem *escale; 
    4153  
    4154             escale = el_long(TYint, t1->nextOf()->size()); 
    4155             n2 = el_bin(OPmul, TYint, n2, escale); 
     4152        { 
     4153            elem *escale = el_long(TYsize_t, t1->nextOf()->size()); 
     4154            n2 = el_bin(OPmul, TYsize_t, n2, escale); 
    41564155            e = el_bin(OPadd, TYnptr, n1, n2); 
    41574156            e = el_una(OPind, type->totym(), e); 
  • branches/dmd-1.x/src/impcnvgen.c

    r428 r621  
    382382    Y(Tuns64, Tdchar) 
    383383 
    384     Y(Tint64, Tuns64) 
    385     Y(Tuns64, Tint64) 
     384//    Y(Tint64, Tuns64) 
     385//    Y(Tuns64, Tint64) 
    386386 
    387387    for (i = 0; i < TMAX; i++) 
  • trunk/src/backend/cod1.c

    r619 r621  
    11641164 
    11651165        if (!I16 && e1isadd && (!e1->Ecount || !e1free) && 
    1166             tysize[e1ty] == REGSIZE
     1166            (tysize[e1ty] == REGSIZE || (I64 && tysize[e1ty] == 4))
    11671167        {   code *c2; 
    11681168            regm_t idxregs2; 
     
    35403540#ifdef DEBUG 
    35413541  if (debugw) 
    3542         printf("loaddata(e = %p,*pretregs = x%x)\n",e,*pretregs); 
     3542        printf("loaddata(e = %p,*pretregs = %s)\n",e,regm_str(*pretregs)); 
    35433543  //elem_print(e); 
    35443544#endif 
  • trunk/src/backend/ptrntab.c

    r619 r621  
    3333// 
    3434 
    35 PTRNTAB0 aptb0AAA[] = /* AAA */ { 
    36         { 0x37, _modax }, 
    37 }; 
    38  
    39 PTRNTAB0 aptb0AAD[] = /* AAD */ { 
    40         { 0xd50a, _modax } 
    41 }; 
    42  
    43 PTRNTAB0 aptb0AAM[] = /* AAM */ { 
    44         { 0xd40a, _modax } 
    45 }; 
    46 PTRNTAB0 aptb0AAS[] = /* AAS */ { 
    47         { 0x3f, _modax } 
    48 }; 
    49 PTRNTAB0 aptb0CBW[] = /* CBW */ { 
    50         { 0x98, _16_bit | _modax } 
    51 }; 
    52 PTRNTAB0 aptb0CWDE[] = /* CWDE */ { 
    53         { 0x98, _32_bit | _I386 | _modax } 
    54 }; 
    55 PTRNTAB0 aptb0CDQE[] = /* CDQE */ { 
    56         { 0x98, _64_bit | _modax } 
    57 }; 
    58 PTRNTAB0 aptb0CLC[] =  /* CLC */ { 
    59         { 0xf8, 0 } 
    60 }; 
    61  
    62 PTRNTAB0 aptb0CLD[] = /* CLD */ { 
    63         { 0xfc, 0 } 
    64 }; 
    65 PTRNTAB0 aptb0CLI[] =  /* CLI */ { 
    66         { 0xfa, 0 } 
    67 }; 
    68  
    69 PTRNTAB0 aptb0CLTS[] =  /* CLTS */ { 
    70         { 0x0f06, 0 } 
    71 }; 
    72  
    73 PTRNTAB0 aptb0CMC[] =  /* CMC */ { 
    74         { 0xf5, 0 } 
    75 }; 
    76  
    77 PTRNTAB0 aptb0CMPSB[] =  /* CMPSB */ { 
    78         { 0xa6, _modsidi } 
    79 }; 
    80  
    81 PTRNTAB0 aptb0CMPSW[] =  /* CMPSW */ { 
    82         { 0xa7, _16_bit | _modsidi } 
    83 }; 
    84  
    85 #if 0 
    86 PTRNTAB0 aptb0CMPSD[] =  /* CMPSD */ { 
    87         { 0xa7, _32_bit | _I386 | _modsidi } 
    88 }; 
    89 #endif 
    90  
    91 PTRNTAB0 aptb0CWD[] =  /* CWD */ { 
    92         { 0x99, _16_bit | _modaxdx } 
    93 }; 
    94  
    95 PTRNTAB0 aptb0CDQ[] =  /* CDQ */ { 
    96         { 0x99, _32_bit | _I386 | _modaxdx } 
    97 }; 
    98  
    99 PTRNTAB0 aptb0CQO[] =  /* CQO */ { 
    100         { 0x99, _64_bit | _modaxdx } 
    101 }; 
    102  
    103 PTRNTAB0 aptb0DAA[] =  /* DAA */ { 
    104         { 0x27, _modax } 
    105 }; 
    106  
    107 PTRNTAB0 aptb0DAS[] =  /* DAS */ { 
    108         { 0x2f, _modax } 
    109 }; 
    110  
    111 PTRNTAB0 aptb0HLT[] =  /* HLT */ { 
    112         { 0xf4, 0 } 
    113 }; 
    114  
    115 PTRNTAB0 aptb0INSB[] =  /* INSB */ { 
    116         { 0x6c,  _I386 | _modsi } 
    117 }; 
    118  
    119 PTRNTAB0 aptb0INSW[] =  /* INSW */ { 
    120         { 0x6d, _16_bit | _I386 | _modsi } 
    121 }; 
    122  
    123 PTRNTAB0 aptb0INSD[] =  /* INSD */ { 
    124         { 0x6d, _32_bit | _I386 | _modsi } 
    125 }; 
    126  
    127 PTRNTAB0 aptb0INTO[] =  /* INTO */ { 
    128         { 0xce, 0 } 
    129 }; 
    130 PTRNTAB0 aptb0INVD[] = /* INVD */ { 
    131         { 0x0f08, _I386 }               // Actually a 486 only instruction 
    132 }; 
    133 PTRNTAB0 aptb0IRET[] =  /* IRET */ { 
    134         { 0xcf, _16_bit } 
    135 }; 
    136  
    137 PTRNTAB0 aptb0IRETD[] =  /* IRETD */ { 
    138         { 0xcf, _32_bit | _I386 } 
    139 }; 
    140  
    141 PTRNTAB0 aptb0LAHF[] =  /* LAHF */ { 
    142         { 0x9f, _modax } 
    143 }; 
    144  
    145 PTRNTAB0 aptb0LEAVE[] =  /* LEAVE */ { 
    146         { 0xc9, _I386 } 
    147 }; 
    148  
    149 PTRNTAB0 aptb0LOCK[] =  /* LOCK */ { 
    150         { 0xf0, 0 } 
    151 }; 
    152  
    153 PTRNTAB0 aptb0LODSB[] =  /* LODSB */ { 
    154         { 0xac, _modsiax } 
    155 }; 
    156  
    157 PTRNTAB0 aptb0LODSW[] =  /* LODSW */ { 
    158         { 0xad, _16_bit | _modsiax } 
    159 }; 
    160  
    161 PTRNTAB0 aptb0LODSD[] =  /* LODSD */ { 
    162         { 0xad, _32_bit | _I386 | _modsiax  } 
    163 }; 
    164  
    165 PTRNTAB0 aptb0MOVSB[] =  /* MOVSB */ { 
    166         { 0xa4, _modsidi} 
    167 }; 
    168  
    169 PTRNTAB0 aptb0MOVSW[] =  /* MOVSW */ { 
    170         { 0xa5, _16_bit | _modsidi } 
    171 }; 
     35#define OPTABLE0(str,op,mod) PTRNTAB0 aptb0##str[] = { { op, mod }, }; 
     36 
     37OPTABLE0(AAA,     0x37,_modax); 
     38OPTABLE0(AAD,     0xd50a,_modax); 
     39OPTABLE0(AAM,     0xd40a,_modax); 
     40OPTABLE0(AAS,     0x3f,_modax); 
     41OPTABLE0(CBW,     0x98,_16_bit | _modax); 
     42OPTABLE0(CWDE,    0x98,_32_bit | _I386 | _modax); 
     43OPTABLE0(CDQE,    0x98,_64_bit | _modax); 
     44OPTABLE0(CLC,     0xf8,0); 
     45OPTABLE0(CLD,     0xfc,0); 
     46OPTABLE0(CLI,     0xfa,0); 
     47OPTABLE0(CLTS,    0x0f06,0); 
     48OPTABLE0(CMC,     0xf5,0); 
     49OPTABLE0(CMPSB,   0xa6,_modsidi); 
     50OPTABLE0(CMPSW,   0xa7,_16_bit | _modsidi); 
     51//OPTABLE0(CMPSD, 0xa7,_32_bit | _I386 | _modsidi); 
     52OPTABLE0(CMPSQ,   0xa7,_64_bit | _modsidi); 
     53OPTABLE0(CWD,     0x99, _16_bit | _modaxdx); 
     54OPTABLE0(CDQ,     0x99,_32_bit | _I386 | _modaxdx); 
     55OPTABLE0(CQO,     0x99, _64_bit | _modaxdx); 
     56OPTABLE0(DAA,     0x27,_modax); 
     57OPTABLE0(DAS,     0x2f,_modax); 
     58OPTABLE0(HLT,     0xf4,0); 
     59OPTABLE0(INSB,    0x6c,_I386 | _modsi); 
     60OPTABLE0(INSW,    0x6d,_16_bit | _I386 | _modsi); 
     61OPTABLE0(INSD,    0x6d,_32_bit | _I386 | _modsi); 
     62OPTABLE0(INTO,    0xce,0); 
     63OPTABLE0(INVD,    0x0f08,_I386);               // Actually a 486 only instruction 
     64OPTABLE0(IRET,    0xcf,_16_bit); 
     65OPTABLE0(IRETD,   0xcf,_32_bit | _I386); 
     66OPTABLE0(LAHF,    0x9f,_modax); 
     67OPTABLE0(LEAVE,   0xc9,_I386); 
     68OPTABLE0(LOCK,    0xf0,0); 
     69OPTABLE0(LODSB,   0xac,_modsiax); 
     70OPTABLE0(LODSW,   0xad,_16_bit | _modsiax); 
     71OPTABLE0(LODSD,   0xad,_32_bit | _I386 | _modsiax); 
     72OPTABLE0(LODSQ,   0xad,_64_bit | _modsiax); 
     73OPTABLE0(MOVSB,   0xa4, _modsidi); 
     74OPTABLE0(MOVSW,   0xa5, _16_bit | _modsidi); 
     75OPTABLE0(MOVSQ,   0xa5, _64_bit | _modsidi); 
     76OPTABLE0(NOP,     0x90, 0); 
     77OPTABLE0(OUTSB,   0x6e, _I386 | _modsi); 
     78OPTABLE0(OUTSW,   0x6f, _16_bit | _I386 | _modsi); 
     79OPTABLE0(OUTSD,   0x6f, _32_bit | _I386 | _modsi); 
     80OPTABLE0(POPA,    0x61, _16_bit | _I386 | _modall); 
     81OPTABLE0(POPAD,   0x61, _32_bit | _I386 | _modall); 
     82OPTABLE0(POPF,    0x9d, _16_bit); 
     83OPTABLE0(POPFD,   0x9d, _32_bit | _I386); 
     84OPTABLE0(PUSHA,   0x60, _16_bit | _I386); 
     85OPTABLE0(PUSHAD,  0x60, _32_bit | _I386); 
     86OPTABLE0(PUSHF,   0x9c, _16_bit); 
     87OPTABLE0(PUSHFD,  0x9c, _32_bit | _I386); 
     88OPTABLE0(REP,     0xf3, _modcx); 
     89OPTABLE0(REPNE,   0xf2, _modcx); 
     90OPTABLE0(SAHF,    0x9e, 0); 
     91OPTABLE0(SCASB,   0xAE, _moddi); 
     92OPTABLE0(SCASW,   0xAF, _16_bit | _moddi); 
     93OPTABLE0(SCASD,   0xAF, _32_bit | _I386 | _moddi); 
     94OPTABLE0(SCASQ,   0xAF, _64_bit | _moddi); 
     95OPTABLE0(STC,     0xf9, 0); 
     96OPTABLE0(STD,     0xfd, 0); 
     97OPTABLE0(STI,     0xfb, 0); 
     98OPTABLE0(STOSB,   0xaa, _moddi); 
     99OPTABLE0(STOSW,   0xAB, _16_bit | _moddi); 
     100OPTABLE0(STOSD,   0xAB, _32_bit | _I386 | _moddi); 
     101OPTABLE0(STOSQ,   0xAB, _64_bit | _moddi); 
     102OPTABLE0(WAIT,    0x9B, 0); 
     103OPTABLE0(WBINVD,  0x0f09, _I386);                        // Really a 486 opcode 
     104OPTABLE0(XLATB,   0xd7, _modax); 
     105OPTABLE0(CPUID,   0x0fa2, _I386 | _modall); 
     106OPTABLE0(RDMSR,   0x0f32, _I386 | _modaxdx); 
     107OPTABLE0(RDPMC,   0x0f33, _I386 | _modaxdx); 
     108OPTABLE0(RDTSC,   0x0f31, _I386 | _modaxdx); 
     109OPTABLE0(WRMSR,   0x0f30, _I386); 
     110OPTABLE0(RSM,     0x0faa,   _I386); 
    172111 
    173112PTRNTAB2 aptb2MOVSD[] =  /* MOVSD */ { 
     
    177116}; 
    178117 
    179 PTRNTAB0 aptb0NOP[] =  /* NOP */ { 
    180         { 0x90, 0 } 
    181 }; 
    182  
    183 PTRNTAB0 aptb0OUTSB[] =  /* OUTSB */ { 
    184         { 0x6e, _I386 | _modsi } 
    185 }; 
    186  
    187 PTRNTAB0 aptb0OUTSW[] =  /* OUTSW */ { 
    188         { 0x6f, _16_bit | _I386 | _modsi } 
    189 }; 
    190  
    191 PTRNTAB0 aptb0OUTSD[] =  /* OUTSD */ { 
    192         { 0x6f, _32_bit | _I386 | _modsi } 
    193 }; 
    194  
    195 PTRNTAB0 aptb0POPA[] =  /* POPA */ { 
    196         { 0x61, _16_bit | _I386 | _modall } 
    197 }; 
    198  
    199 PTRNTAB0 aptb0POPAD[] =  /* POPAD */ { 
    200         { 0x61, _32_bit | _I386 | _modall } 
    201 }; 
    202  
    203 PTRNTAB0 aptb0POPF[] =  /* POPF */ { 
    204         { 0x9d, _16_bit } 
    205 }; 
    206  
    207 PTRNTAB0 aptb0POPFD[] =  /* POPFD */ { 
    208         { 0x9d, _32_bit | _I386 } 
    209 }; 
    210  
    211 PTRNTAB0 aptb0PUSHA[] =  /* PUSHA */ { 
    212         { 0x60, _16_bit | _I386 } 
    213 }; 
    214  
    215 PTRNTAB0 aptb0PUSHAD[] =  /* PUSHAD */ { 
    216         { 0x60, _32_bit | _I386 } 
    217 }; 
    218  
    219 PTRNTAB0 aptb0PUSHF[]= /* PUSHF */ { 
    220         {0x9c, _16_bit } 
    221 }; 
    222  
    223 PTRNTAB0 aptb0PUSHFD[] =  /* PUSHFD */ { 
    224         { 0x9c, _32_bit | _I386 } 
    225 }; 
    226  
    227 PTRNTAB0 aptb0REP[] = /* REP */ { 
    228         { 0xf3, _modcx } 
    229 }; 
    230  
    231 PTRNTAB0 aptb0REPNE[] = /* REPNE */ { 
    232         { 0xf2, _modcx } 
    233 }; 
    234  
    235 PTRNTAB0 aptb0SAHF[] = /* SAHF */ { 
    236         { 0x9e, 0 } 
    237 }; 
    238  
    239 PTRNTAB0 aptb0SCASB[] = /* SCASB */ { 
    240         { 0xAE, _moddi } 
    241 }; 
    242  
    243 PTRNTAB0 aptb0SCASW[] = /* SCASW */ { 
    244         { 0xAF, _16_bit | _moddi} 
    245 }; 
    246  
    247 PTRNTAB0 aptb0SCASD[] = /* SCASD */ { 
    248         { 0xAF, _32_bit | _I386 | _moddi } 
    249 }; 
    250  
    251 PTRNTAB0 aptb0STC[] = /* STC */ { 
    252         { 0xf9, 0 } 
    253 }; 
    254  
    255 PTRNTAB0 aptb0STD[] = /* STD */ { 
    256         { 0xfd, 0 } 
    257 }; 
    258  
    259 PTRNTAB0 aptb0STI[] = /* STI */ { 
    260         { 0xfb, 0 } 
    261 }; 
    262 PTRNTAB0 aptb0STOSB[] = /* STOSB */ { 
    263         { 0xaa, _moddi } 
    264 }; 
    265  
    266 PTRNTAB0 aptb0STOSW[] = /* STOSW */ { 
    267         { 0xAB, _16_bit | _moddi } 
    268 }; 
    269  
    270 PTRNTAB0 aptb0STOSD[] = /* STOSD */ { 
    271         { 0xAB, _32_bit | _I386 | _moddi } 
    272 }; 
    273  
    274 PTRNTAB0 aptb0WAIT[] = /* WAIT */ { 
    275         { 0x9B, 0 } 
    276 }; 
    277 PTRNTAB0 aptb0WBINVD[] = /* WBINVD */ { 
    278         { 0xf09, _I386 }                        // Really a 486 opcode 
    279 }; 
    280 PTRNTAB0 aptb0XLATB[] = /* XLATB */ { 
    281         { 0xd7, _modax } 
    282 }; 
    283 PTRNTAB0 aptb0CPUID[] = { 
    284     { 0x0fa2, _I386 | _modall } 
    285 }; 
    286  
    287 PTRNTAB0 aptb0RDMSR[] = { 
    288     { 0x0f32, _I386 | _modaxdx } 
    289 }; 
    290  
    291 PTRNTAB0 aptb0RDPMC[] = { 
    292     { 0x0f33, _I386 | _modaxdx } 
    293 }; 
    294  
    295 PTRNTAB0 aptb0RDTSC[] = { 
    296     { 0x0f31, _I386 | _modaxdx } 
    297 }; 
    298  
    299 PTRNTAB0 aptb0WRMSR[] = { 
    300     { 0x0f30, _I386 } 
    301 }; 
    302  
    303 PTRNTAB0 aptb0RSM[] = { 
    304     { 0x0faa,   _I386 } 
    305 }; 
    306118// 
    307119// Now come the one operand instructions 
     
    323135        { 0xe8, _cd | _modall , _rel32  }, 
    324136        { 0xff, _2 | _32_bit | _modall ,        _r32  }, 
     137        { 0xff, _2 | _64_bit | _modall ,        _r64  }, 
    325138        { 0xff, _2 | _modall ,  _m32  }, 
     139        { 0xff, _2 | _64_bit | _modall ,  _m64  }, 
    326140        { 0x9a, _cp | _modall , _p1632 }, 
    327141        { 0xff, _3 | _modall ,  _m1632  }, 
     
    333147        { 0xff, _1 | _16_bit,           _m16 },         // Also _r16 synonym 
    334148        { 0xff, _1 | _32_bit,           _m32 },         // Also _r32 synonym 
     149        { 0xff, _1 | _64_bit,           _rm64 },        // Also _r64 synonym 
    335150        { 0x48, _rw | _16_bit,          _r16 | _plus_r }, 
    336151        { 0x48, _rw | _32_bit,          _r32 | _plus_r }, 
     
    342157        { 0xff, _0 | _16_bit,   _m16 },                 // Also _r16 synonym 
    343158        { 0xff, _0 | _32_bit,   _m32 },                 // Also _r32 synonym 
     159        { 0xff, _0 | _64_bit,   _rm64 },                // Also _r64 synonym 
    344160        { 0x40, _rw | _16_bit,_r16 | _plus_r }, 
    345161        { 0x40, _rd | _32_bit,_r32 | _plus_r }, 
     
    359175}; 
    360176 
    361 PTRNTAB1 aptb1JB[] = /* JB */ { 
    362         { 0x72, _cb,_rel8 }, 
    363         { 0x0f82,       _cw,_rel16 }, 
    364         { 0x0f82,       _cd,_rel32 }, 
    365         { ASM_END, 0, 0 } 
    366 }; 
    367 PTRNTAB1 aptb1JBE[] = /* JBE */ { 
    368         { 0x76, _cb,_rel8 }, 
    369         { 0x0f86,       _cw,_rel16 }, 
    370         { 0x0f86,       _cd,_rel32 }, 
    371         { ASM_END, 0, 0 } 
    372 }; 
     177#define OPTABLE(str,op) \ 
     178PTRNTAB1 aptb1##str[] = {               \ 
     179        { 0x70|op,   _cb,_rel8 },       \ 
     180        { 0x0f80|op, _cw,_rel16 },      \ 
     181        { 0x0f80|op, _cd,_rel32 },      \ 
     182        { ASM_END, 0, 0 }               \ 
     183
     184 
     185OPTABLE(JO,0); 
     186OPTABLE(JNO,1); 
     187OPTABLE(JB,2); 
     188OPTABLE(JNB,3); 
     189OPTABLE(JZ,4); 
     190OPTABLE(JNZ,5); 
     191OPTABLE(JBE,6); 
     192OPTABLE(JNBE,7); 
     193OPTABLE(JS,8); 
     194OPTABLE(JNS,9); 
     195OPTABLE(JP,0xA); 
     196OPTABLE(JNP,0xB); 
     197OPTABLE(JL,0xC); 
     198OPTABLE(JNL,0xD); 
     199OPTABLE(JLE,0xE); 
     200OPTABLE(JNLE,0xF); 
     201 
     202#undef OPTABLE 
     203 
    373204PTRNTAB1 aptb1JCXZ[] = /* JCXZ */ { 
    374205        { 0xe3, _cb | _16_bit_addr,_rel8 }, 
     
    377208PTRNTAB1 aptb1JECXZ[] = /* JECXZ */ { 
    378209        { 0xe3, _cb | _32_bit_addr | _I386,_rel8 }, 
    379         { ASM_END, 0, 0 } 
    380 }; 
    381 PTRNTAB1 aptb1JZ[] = /* JZ */ { 
    382         { 0x74, _cb,_rel8 }, 
    383         { 0x0f84,       _cw,_rel16 }, 
    384         { 0x0f84,       _cd,_rel32 }, 
    385         { ASM_END, 0, 0 } 
    386 }; 
    387 PTRNTAB1 aptb1JL[] = /* JL */ { 
    388         { 0x7c, _cb,_rel8 }, 
    389         { 0x0f8c,       _cw,_rel16 }, 
    390         { 0x0f8c,       _cd,_rel32 }, 
    391         { ASM_END, 0, 0 } 
    392 }; 
    393 PTRNTAB1 aptb1JLE[] = /* JLE */ { 
    394         { 0x7e, _cb,_rel8 }, 
    395         { 0x0f8e,       _cw,_rel16 }, 
    396         { 0x0f8e,       _cd,_rel32 }, 
    397         { ASM_END, 0, 0 } 
    398 }; 
    399 PTRNTAB1 aptb1JNB[] = /* JNB */ { 
    400         { 0x73, _cb,_rel8 }, 
    401         { 0x0f83,       _cw,_rel16 }, 
    402         { 0x0f83,       _cd,_rel32 }, 
    403         { ASM_END, 0, 0 } 
    404 }; 
    405 PTRNTAB1 aptb1JNBE[] = /* JNBE */ { 
    406         { 0x77, _cb,_rel8 }, 
    407         { 0x0f87,       _cw,_rel16 }, 
    408         { 0x0f87,       _cd,_rel32 }, 
    409         { ASM_END, 0, 0 } 
    410 }; 
    411 PTRNTAB1 aptb1JNL[] = /* JNL */ { 
    412         { 0x7d, _cb,_rel8 }, 
    413         { 0x0f8d,       _cw,_rel16 }, 
    414         { 0x0f8d,       _cd,_rel32 }, 
    415         { ASM_END, 0, 0 } 
    416 }; 
    417 PTRNTAB1 aptb1JNLE[] = /* JNLE */ { 
    418         { 0x7f, _cb,_rel8 }, 
    419         { 0x0f8f,       _cw,_rel16 }, 
    420         { 0x0f8f,       _cd,_rel32 }, 
    421         { ASM_END, 0, 0 } 
    422 }; 
    423 PTRNTAB1 aptb1JNO[] = /* JNO */ { 
    424         { 0x71, _cb,_rel8 }, 
    425         { 0x0f81,       _cw,_rel16 }, 
    426         { 0x0f81,       _cd,_rel32 }, 
    427         { ASM_END, 0, 0 } 
    428 }; 
    429 PTRNTAB1 aptb1JNP[] = /* JNP */ { 
    430         { 0x7b, _cb,_rel8 }, 
    431         { 0x0f8b,       _cw,_rel16 }, 
    432         { 0x0f8b,       _cd,_rel32 }, 
    433         { ASM_END, 0, 0 } 
    434 }; 
    435 PTRNTAB1 aptb1JNS[] = /* JNS */ { 
    436         { 0x79, _cb,_rel8 }, 
    437         { 0x0f89,       _cw,_rel16 }, 
    438         { 0x0f89,       _cd,_rel32 }, 
    439         { ASM_END, 0, 0 } 
    440 }; 
    441 PTRNTAB1 aptb1JNZ[] = /* JNZ */ { 
    442         { 0x75, _cb,_rel8 }, 
    443         { 0x0f85,       _cw,_rel16 }, 
    444         { 0x0f85,       _cd,_rel32 }, 
    445         { ASM_END, 0, 0 } 
    446 }; 
    447 PTRNTAB1 aptb1JO[] = /* JO */ { 
    448         { 0x70, _cb,_rel8 }, 
    449         { 0x0f80,       _cw,_rel16 }, 
    450         { 0x0f80,       _cd,_rel32 }, 
    451         { ASM_END, 0, 0 } 
    452 }; 
    453 PTRNTAB1 aptb1JP[] = /* JP */ { 
    454         { 0x7a, _cb,_rel8 }, 
    455         { 0x0f8a,       _cw,_rel16 }, 
    456         { 0x0f8a,       _cd,_rel32 }, 
    457         { ASM_END, 0, 0 } 
    458 }; 
    459 PTRNTAB1 aptb1JS[] = /* JS */ { 
    460         { 0x78, _cb,_rel8 }, 
    461         { 0x0f88,       _cw,_rel16 }, 
    462         { 0x0f88,       _cd,_rel32 }, 
    463210        { ASM_END, 0, 0 } 
    464211}; 
     
    501248        { ASM_END, 0, 0 } 
    502249}; 
    503 PTRNTAB1 aptb1LOOPE[] = /* LOOPE */ { 
     250PTRNTAB1 aptb1LOOPE[] = /* LOOPE/LOOPZ */ { 
    504251        { 0xe1, _cb | _modcx,_rel8 }, 
    505252        { ASM_END, 0, 0 } 
    506253}; 
    507 PTRNTAB1 aptb1LOOPZ[] = /* LOOPZ */ { 
    508         { 0xe1, _cb | _modcx,_rel8 }, 
    509         { ASM_END, 0, 0 } 
    510 }; 
    511 PTRNTAB1 aptb1LOOPNE[] = /* LOOPNE */ { 
    512         { 0xe0, _cb | _modcx,_rel8 }, 
    513         { ASM_END, 0, 0 } 
    514 }; 
    515 PTRNTAB1 aptb1LOOPNZ[] = /* LOOPNZ */ { 
     254PTRNTAB1 aptb1LOOPNE[] = /* LOOPNE/LOOPNZ */ { 
    516255        { 0xe0, _cb | _modcx,_rel8 }, 
    517256        { ASM_END, 0, 0 } 
     
    532271        { 0xf7, _2 | _16_bit,   _rm16 }, 
    533272        { 0xf7, _2 | _32_bit,   _rm32 }, 
     273        { 0xf7, _2 | _64_bit,   _rm64 }, 
    534274        { ASM_END, 0, 0 } 
    535275}; 
     
    584324}; 
    585325 
    586 PTRNTAB1 aptb1SETB[] = /* SETB */ { 
    587         { 0xf92, _cb, _rm8 }, 
    588         { ASM_END, 0, 0 } 
    589 }; 
    590 PTRNTAB1  aptb1SETBE[] = /* SETBE */ { 
    591         { 0xf96, _cb, _rm8 }, 
    592         { ASM_END, 0, 0 } 
    593 }; 
    594 PTRNTAB1  aptb1SETL[] = /* SETL */ { 
    595         { 0xf9c, _cb, _rm8 }, 
    596         { ASM_END, 0, 0 } 
    597 }; 
    598 PTRNTAB1  aptb1SETLE[] = /* SETLE */ { 
    599         { 0xf9e, _cb, _rm8 }, 
    600         { ASM_END, 0, 0 } 
    601 }; 
    602 PTRNTAB1  aptb1SETNB[] = /* SETNB */ { 
    603         { 0xf93, _cb, _rm8 }, 
    604         { ASM_END, 0, 0 } 
    605 }; 
    606 PTRNTAB1  aptb1SETNBE[] = /* SETNBE */ { 
    607         { 0xf97, _cb, _rm8 }, 
    608         { ASM_END, 0, 0 } 
    609 }; 
    610 PTRNTAB1  aptb1SETNL[] = /* SETNL */ { 
    611         { 0xf9d, _cb, _rm8 }, 
    612         { ASM_END, 0, 0 } 
    613 }; 
    614 PTRNTAB1  aptb1SETNLE[] = /* SETNLE */ { 
    615         { 0xf9f, _cb, _rm8 }, 
    616         { ASM_END, 0, 0 } 
    617 }; 
    618 PTRNTAB1  aptb1SETNO[] = /* SETNO */ { 
    619         { 0xf91, _cb, _rm8 }, 
    620         { ASM_END, 0, 0 } 
    621 }; 
    622 PTRNTAB1  aptb1SETNP[] = /* SETNP */ { 
    623         { 0xf9b, _cb, _rm8 }, 
    624         { ASM_END, 0, 0 } 
    625 }; 
    626 PTRNTAB1  aptb1SETNS[] = /* SETNS */ { 
    627         { 0xf99, _cb, _rm8 }, 
    628         { ASM_END, 0, 0 } 
    629 }; 
    630 PTRNTAB1  aptb1SETNZ[] = /* SETNZ */ { 
    631         { 0xf95, _cb, _rm8 }, 
    632         { ASM_END, 0, 0 } 
    633 }; 
    634 PTRNTAB1  aptb1SETO[] = /* SETO */ { 
    635         { 0xf90, _cb, _rm8 }, 
    636         { ASM_END, 0, 0 } 
    637 }; 
    638 PTRNTAB1  aptb1SETP[] = /* SETP */ { 
    639         { 0xf9a, _cb, _rm8 }, 
    640         { ASM_END, 0, 0 } 
    641 }; 
    642 PTRNTAB1  aptb1SETS[] = /* SETS */ { 
    643         { 0xf98, _cb, _rm8 }, 
    644         { ASM_END, 0, 0 } 
    645 }; 
    646 PTRNTAB1  aptb1SETZ[] = /* SETZ */ { 
    647         { 0xf94, _cb, _rm8 }, 
    648         { ASM_END, 0, 0 } 
    649 }; 
     326#define OPTABLE(str,op) \ 
     327PTRNTAB1 aptb1##str[] = {       \ 
     328        { 0xf90|op, _cb, _rm8 },        \ 
     329        { ASM_END, 0, 0 }       \ 
     330
     331 
     332OPTABLE(SETO,0); 
     333OPTABLE(SETNO,1); 
     334OPTABLE(SETB,2); 
     335OPTABLE(SETNB,3); 
     336OPTABLE(SETZ,4); 
     337OPTABLE(SETNZ,5); 
     338OPTABLE(SETBE,6); 
     339OPTABLE(SETNBE,7); 
     340OPTABLE(SETS,8); 
     341OPTABLE(SETNS,9); 
     342OPTABLE(SETP,0xA); 
     343OPTABLE(SETNP,0xB); 
     344OPTABLE(SETL,0xC); 
     345OPTABLE(SETNL,0xD); 
     346OPTABLE(SETLE,0xE); 
     347OPTABLE(SETNLE,0xF); 
     348 
     349#undef OPTABLE 
     350 
    650351PTRNTAB1  aptb1SGDT[]= /* SGDT */ { 
    651352        { 0xf01, _0, _m48 }, 
     
    692393        { ASM_END, 0, 0 } 
    693394}; 
    694 PTRNTAB2  aptb2ADC[] = /* ADC */ { 
    695         { 0x14, _ib,                _al,                _imm8 }, 
    696         { 0x83, _2|_ib|_16_bit,     _rm16,      _imm8 }, 
    697         { 0x15, _iw|_16_bit,        _ax,                _imm16 }, 
    698         { 0x83, _2|_ib|_32_bit,     _rm32,  _imm8 }, 
    699         { 0x15, _id|_32_bit,        _eax,       _imm32 }, 
    700         { 0x80, _2|_ib,             _rm8,       _imm8 }, 
    701         { 0x81, _2|_iw|_16_bit,     _rm16,      _imm16 }, 
    702         { 0x81, _2|_id|_32_bit,     _rm32,  _imm32 }, 
    703         { 0x10, _r,                 _rm8,       _r8 }, 
    704         { 0x11, _r|_16_bit,         _rm16,      _r16 }, 
    705         { 0x11, _r|_32_bit,         _rm32,      _r32 }, 
    706         { 0x12, _r,                 _r8,        _rm8 }, 
    707         { 0x13, _r|_16_bit,         _r16,       _rm16 }, 
    708         { 0x13, _r|_32_bit,         _r32,       _rm32 }, 
    709         { ASM_END, 0, 0, 0 } 
    710 }; 
    711 PTRNTAB2  aptb2ADD[] = /* ADD */ { 
    712         { 0x04, _ib,            _al,    _imm8 }, 
    713         { 0x83, _0|_ib|_16_bit, _rm16,  _imm8 }, 
    714         { 0x05, _iw | _16_bit,  _ax,    _imm16 }, 
    715         { 0x83, _0|_ib|_32_bit, _rm32,  _imm8 }, 
    716         { 0x05, _id | _32_bit,  _eax,   _imm32 }, 
    717         { 0x80, _0|_ib,         _rm8,   _imm8 }, 
    718         { 0x81, _0|_iw|_16_bit, _rm16,  _imm16 }, 
    719         { 0x81, _0|_id|_32_bit, _rm32,  _imm32 }, 
    720         { 0x00, _r,             _rm8,   _r8 }, 
    721         { 0x01, _r|_16_bit,     _rm16,  _r16 }, 
    722         { 0x01, _r|_32_bit,     _rm32,  _r32 }, 
    723         { 0x2,  _r,             _r8,    _rm8 }, 
    724         { 0x3,  _r|_16_bit,     _r16,   _rm16 }, 
    725         { 0x3,  _r|_32_bit,     _r32,   _rm32 }, 
    726         { ASM_END, 0, 0, 0 } 
    727 }; 
    728  
    729 PTRNTAB2  aptb2AND[] = /* AND */ { 
    730         { 0x24, _ib,            _al,    _imm8 }, 
    731         { 0x83, _4|_ib|_16_bit, _rm16,  _imm8 }, 
    732         { 0x25, _iw|_16_bit,    _ax,    _imm16 }, 
    733         { 0x83, _4|_ib|_32_bit, _rm32,  _imm8 }, 
    734         { 0x25, _id|_32_bit,    _eax,   _imm32 }, 
    735         { 0x80, _4|_ib,         _rm8,   _imm8 }, 
    736         { 0x81, _4|_iw|_16_bit, _rm16,  _imm16 }, 
    737         { 0x81, _4|_id|_32_bit, _rm32,  _imm32 }, 
    738         { 0x20, _r,             _rm8,   _r8 }, 
    739         { 0x21, _r|_16_bit,     _rm16,  _r16 }, 
    740         { 0x21, _r|_32_bit,     _rm32,  _r32 }, 
    741         { 0x22, _r,             _r8,    _rm8 }, 
    742         { 0x23, _r|_16_bit,     _r16,   _rm16 }, 
    743         { 0x23, _r|_32_bit,     _r32,   _rm32 }, 
    744         { ASM_END, 0, 0, 0 } 
    745 }; 
     395 
     396#define OPTABLE(str,op,rr,m) \ 
     397PTRNTAB2  aptb2##str[] = {                                      \ 
     398        { op+4,  _ib|m,                _al,        _imm8 },     \ 
     399        { 0x83, rr|_ib|_16_bit|m,     _rm16,      _imm8 },      \ 
     400        { op+5, _iw|_16_bit|m,        _ax,        _imm16 },     \ 
     401        { 0x83, rr|_ib|_32_bit|m,     _rm32,      _imm8 },      \ 
     402        { 0x83, rr|_ib|_64_bit|m,     _rm64,      _imm8 },      \ 
     403        { op+5, _id|_32_bit|m,        _eax,       _imm32 },     \ 
     404        { op+5, _id|_64_bit|m,        _rax,       _imm32 },     \ 
     405        { 0x80, rr|_ib|m,             _rm8,       _imm8 },      \ 
     406        { 0x81, rr|_iw|_16_bit|m,     _rm16,      _imm16 },     \ 
     407        { 0x81, rr|_id|_32_bit|m,     _rm32,      _imm32 },     \ 
     408        { 0x81, rr|_id|_64_bit|m,     _rm64,      _imm32 },     \ 
     409        { op+0, _r|m,                 _rm8,       _r8 },        \ 
     410        { op+1, _r|_16_bit|m,         _rm16,      _r16 },       \ 
     411        { op+1, _r|_32_bit|m,         _rm32,      _r32 },       \ 
     412        { op+1, _r|_64_bit|m,         _rm64,      _r64 },       \ 
     413        { op+2, _r|m,                 _r8,        _rm8 },       \ 
     414        { op+3, _r|_16_bit|m,         _r16,       _rm16 },      \ 
     415        { op+3, _r|_32_bit|m,         _r32,       _rm32 },      \ 
     416        { op+3, _r|_64_bit|m,         _r64,       _rm64 },      \ 
     417        { ASM_END, 0, 0, 0 }                                    \ 
     418
     419 
     420OPTABLE(ADD,0x00,_0,0); 
     421OPTABLE(OR, 0x08,_1,0); 
     422OPTABLE(ADC,0x10,_2,0); 
     423OPTABLE(SBB,0x18,_3,0); 
     424OPTABLE(AND,0x20,_4,0); 
     425OPTABLE(SUB,0x28,_5,0); 
     426OPTABLE(XOR,0x30,_6,0); 
     427OPTABLE(CMP,0x38,_7,_modnot1); 
     428 
     429#undef OPTABLE 
     430 
    746431PTRNTAB2  aptb2ARPL[] = /* ARPL */ { 
    747432        { 0x63, _r,                     _rm16,  _r16 }, 
     
    756441        { 0x0fbc,       _cw | _16_bit,          _r16,   _rm16 }, 
    757442        { 0x0fbc,       _cd|_32_bit,            _r32,   _rm32 }, 
     443        { 0x0fbc,       _cd|_64_bit,            _r64,   _rm64 }, 
    758444        { ASM_END, 0, 0, 0 } 
    759445}; 
     
    761447        { 0x0fbd,       _cw|_16_bit,            _r16,   _rm16 }, 
    762448        { 0x0fbd,       _cd|_32_bit,            _r32,   _rm32 }, 
     449        { 0x0fbd,       _cd|_64_bit,            _r64,   _rm64 }, 
    763450        { ASM_END, 0, 0, 0 } 
    764451}; 
     
    766453        { 0x0fa3,       _cw|_16_bit|_modnot1,           _rm16,  _r16 }, 
    767454        { 0x0fa3,       _cd|_32_bit|_modnot1,           _rm32,  _r32 }, 
     455        { 0x0fa3,       _cd|_64_bit|_modnot1,           _rm64,  _r64 }, 
    768456        { 0x0fba,       _4|_ib|_16_bit|_modnot1,        _rm16,  _imm8 }, 
    769457        { 0x0fba,       _4|_ib|_32_bit|_modnot1,        _rm32,  _imm8 }, 
     458        { 0x0fba,       _4|_ib|_64_bit|_modnot1,        _rm64,  _imm8 }, 
    770459        { ASM_END, 0, 0, 0 } 
    771460}; 
     
    773462        { 0x0fbb,       _cw|_16_bit,            _rm16,  _r16 }, 
    774463        { 0x0fbb,       _cd|_32_bit,            _rm32,  _r32 }, 
     464        { 0x0fbb,       _cd|_64_bit,            _rm64,  _r64 }, 
    775465        { 0x0fba,       _7|_ib|_16_bit, _rm16,  _imm8 }, 
    776466        { 0x0fba,       _7|_ib|_32_bit, _rm32,  _imm8 }, 
     467        { 0x0fba,       _7|_ib|_64_bit, _rm64,  _imm8 }, 
    777468        { ASM_END, 0, 0, 0 } 
    778469}; 
     
    780471        { 0x0fb3,       _cw|_16_bit,            _rm16,  _r16 }, 
    781472        { 0x0fb3,       _cd|_32_bit,            _rm32,  _r32 }, 
     473        { 0x0fb3,       _cd|_64_bit,            _rm64,  _r64 }, 
    782474        { 0x0fba,       _6|_ib|_16_bit,         _rm16,  _imm8 }, 
    783475        { 0x0fba,       _6|_ib|_32_bit,         _rm32,  _imm8 }, 
     476        { 0x0fba,       _6|_ib|_64_bit,         _rm64,  _imm8 }, 
    784477        { ASM_END, 0, 0, 0 } 
    785478}; 
     
    787480        { 0x0fab,       _cw|_16_bit,            _rm16,  _r16 }, 
    788481        { 0x0fab,       _cd|_32_bit,            _rm32,  _r32 }, 
     482        { 0x0fab,       _cd|_64_bit,            _rm64,  _r64 }, 
    789483        { 0x0fba,       _5|_ib|_16_bit,         _rm16,  _imm8 }, 
    790484        { 0x0fba,       _5|_ib|_32_bit,         _rm32,  _imm8 }, 
    791         { ASM_END, 0, 0, 0 } 
    792 }; 
    793 PTRNTAB2  aptb2CMP[] = /* CMP */ { 
    794         { 0x3c, _ib|_modnot1,           _al,    _imm8 }, 
    795         { 0x83, _7|_ib|_16_bit|_modnot1,        _rm16,  _imm8 }, 
    796         { 0x3d, _iw|_16_bit|_modnot1,   _ax,    _imm16 }, 
    797         { 0x83, _7|_ib|_32_bit|_modnot1,        _rm32,  _imm8 }, 
    798         { 0x3d, _id|_32_bit|_modnot1,   _eax,   _imm32 }, 
    799         { 0x80, _7|_ib|_modnot1,                _rm8,   _imm8 }, 
    800         { 0x81, _7|_iw|_16_bit|_modnot1,        _rm16,  _imm16 }, 
    801         { 0x81, _7|_id|_32_bit|_modnot1,        _rm32,  _imm32 }, 
    802         { 0x38, _r|_modnot1,            _rm8,   _r8 }, 
    803         { 0x39, _r|_16_bit|_modnot1,    _rm16,  _r16 }, 
    804         { 0x39, _r|_32_bit|_modnot1,    _rm32,  _r32 }, 
    805         { 0x3a, _r|_modnot1,            _r8,    _rm8 }, 
    806         { 0x3b, _r|_16_bit|_modnot1,    _r16,   _rm16 }, 
    807         { 0x3b, _r|_32_bit|_modnot1,    _r32,   _rm32 }, 
     485        { 0x0fba,       _5|_ib|_64_bit,         _rm64,  _imm8 }, 
    808486        { ASM_END, 0, 0, 0 } 
    809487}; 
     
    931609        { 0xb8, _rw | _16_bit,  _r16 | _plus_r, _imm16          }, 
    932610        { 0xb8, _rd|_32_bit,    _r32 | _plus_r, _imm32          }, 
     611        { 0xb8, _rd|_64_bit,    _r64 | _plus_r, _imm32          }, 
    933612        { 0xc6, _cb,            _rm8,           _imm8           }, 
    934613        { 0xc7, _cw|_16_bit,    _rm16,          _imm16          }, 
     
    987666        { ASM_END, 0, 0, 0 } 
    988667}; 
    989 PTRNTAB2  aptb2OR[] = /* OR */ { 
    990         { 0x0c, _ib,            _al,    _imm8 }, 
    991         { 0x83, _1|_ib|_16_bit,         _rm16,  _imm8 }, 
    992         { 0x0d, _iw|_16_bit,            _ax,    _imm16 }, 
    993         { 0x83, _1|_ib|_32_bit,         _rm32,  _imm8 }, 
    994         { 0x0d, _id|_32_bit,            _eax,   _imm32 }, 
    995         { 0x80, _1|_ib,         _rm8,   _imm8 }, 
    996         { 0x81, _1|_iw|_16_bit,         _rm16,  _imm16 }, 
    997         { 0x81, _1|_id|_32_bit,         _rm32,  _imm32 }, 
    998         { 0x08, _r,                     _rm8,   _r8 }, 
    999         { 0x09, _r|_16_bit,                     _rm16,  _r16 }, 
    1000         { 0x09, _r|_32_bit,                     _rm32,  _r32 }, 
    1001         { 0x0a, _r,                     _r8,    _rm8 }, 
    1002         { 0x0b, _r|_16_bit,                     _r16,   _rm16 }, 
    1003         { 0x0b, _r|_32_bit,                     _r32,   _rm32 }, 
    1004         { ASM_END, 0, 0, 0 } 
    1005 }; 
    1006668PTRNTAB2  aptb2OUT[] = { 
    1007669        { 0xe6, _ib,            _imm8,  _al }, 
     
    1019681        { ASM_END, 0, 0, 0 } 
    1020682}; 
    1021 PTRNTAB2  aptb2RCL[] = /* RCL */{ 
    1022 //      { 0xd0, _2,                     _rm8,   0 }, 
    1023         { 0xd2, _2,                     _rm8,   _cl }, 
    1024         { 0xc0, _2|_ib,         _rm8,   _imm8 }, 
    1025 //      { 0xd1, _2|_16_bit,                     _rm16,  0 }, 
    1026         { 0xd3, _2|_16_bit,                     _rm16,  _cl }, 
    1027         { 0xc1, _2|_ib|_16_bit,         _rm16,  _imm8 }, 
    1028 //      { 0xd1, _2|_32_bit,                     _rm32,  0 }, 
    1029         { 0xd3, _2|_32_bit,                     _rm32,  _cl }, 
    1030         { 0xc1, _2|_ib|_32_bit,         _rm32,  _imm8, }, 
    1031         { ASM_END, 0, 0, 0 } 
    1032 }; 
    1033 PTRNTAB2  aptb2RCR[] = /* RCR */ { 
    1034 //      { 0xd0, _3,                     _rm8,   0 }, 
    1035         { 0xd2, _3,                     _rm8,   _cl }, 
    1036         { 0xc0, _3|_ib,         _rm8,   _imm8 }, 
    1037 //      { 0xd1, _3|_16_bit,                     _rm16,  0 }, 
    1038         { 0xd3, _3|_16_bit,                     _rm16,  _cl }, 
    1039         { 0xc1, _3|_ib|_16_bit,         _rm16,  _imm8 }, 
    1040 //      { 0xd1, _3|_32_bit,                     _rm32,  0 }, 
    1041         { 0xd3, _3|_32_bit,                     _rm32,  _cl }, 
    1042         { 0xc1, _3|_ib|_32_bit,         _rm32,  _imm8 }, 
    1043         { ASM_END, 0, 0, 0 } 
    1044 }; 
    1045 PTRNTAB2  aptb2ROL[] = /* ROL */ { 
    1046 //      { 0xd0, _0,                     _rm8,   0 }, 
    1047         { 0xd2, _0,                     _rm8,   _cl }, 
    1048         { 0xc0, _0,                     _rm8,   _imm8 }, 
    1049 //      { 0xd1, _0|_16_bit,                     _rm16,  0 }, 
    1050         { 0xd3, _0|_16_bit,                     _rm16,  _cl }, 
    1051         { 0xc1, _0|_16_bit,                     _rm16,  _imm8 }, 
    1052 //      { 0xd1, _0|_32_bit,                     _rm32,  0 }, 
    1053         { 0xd3, _0|_32_bit,                     _rm32,  _cl }, 
    1054         { 0xc1, _0|_32_bit,                     _rm32,  _imm8 }, 
    1055         { ASM_END, 0, 0, 0 } 
    1056 }; 
    1057 PTRNTAB2  aptb2ROR[] = /* ROR */ { 
    1058 //      { 0xd0, _1,                     _rm8, 0 }, 
    1059         { 0xd2, _1,                     _rm8, _cl }, 
    1060         { 0xc0, _1,                     _rm8, _imm8 }, 
    1061 //      { 0xd1, _1|_16_bit,                     _rm16, 0 }, 
    1062         { 0xd3, _1|_16_bit,                     _rm16, _cl }, 
    1063         { 0xc1, _1|_16_bit,                     _rm16, _imm8 }, 
    1064 //      { 0xd1, _1|_32_bit,                     _rm32, 0 }, 
    1065         { 0xd3, _1|_32_bit,                     _rm32, _cl }, 
    1066         { 0xc1, _1|_32_bit,                     _rm32,  _imm8 }, 
    1067         { ASM_END, 0, 0, 0 } 
    1068 }; 
    1069 PTRNTAB2  aptb2SAL[] = /* SAL */ { 
    1070 //      { 0xd0, _4,                     _rm8, 0 }, 
    1071         { 0xd2, _4,                     _rm8, _cl }, 
    1072         { 0xc0, _4,                     _rm8, _imm8 }, 
    1073 //      { 0xd1, _4|_16_bit,                     _rm16, 0 }, 
    1074         { 0xd3, _4|_16_bit,                     _rm16, _cl }, 
    1075         { 0xc1, _4|_16_bit,                     _rm16, _imm8 }, 
    1076 //      { 0xd1, _4|_32_bit,                     _rm32, 0 }, 
    1077         { 0xd3, _4|_32_bit,                     _rm32, _cl }, 
    1078         { 0xc1, _4|_32_bit,                     _rm32,  _imm8 }, 
    1079         { ASM_END, 0, 0, 0 } 
    1080 }; 
    1081 PTRNTAB2  aptb2SBB[] = /* SBB */ { 
    1082         { 0x1c, _ib,            _al,    _imm8 }, 
    1083         { 0x83, _3|_16_bit,                     _rm16,  _imm8 }, 
    1084         { 0x1d, _iw|_16_bit,            _ax,    _imm16 }, 
    1085         { 0x83, _3|_32_bit,                     _rm32,  _imm8 }, 
    1086         { 0x1d, _id|_32_bit,            _eax,   _imm32 }, 
    1087         { 0x80, _3 | _ib,       _rm8,   _imm8 }, 
    1088         { 0x81, _3 | _iw|_16_bit,       _rm16,  _imm16 }, 
    1089         { 0x81, _3 | _id|_32_bit,       _rm32,  _imm32 }, 
    1090         { 0x18, _r,                     _rm8,   _r8 }, 
    1091         { 0x19, _r|_16_bit,                     _rm16,  _r16 }, 
    1092         { 0x19, _r|_32_bit,                     _rm32,  _r32 }, 
    1093         { 0x1A, _r,                     _r8,    _rm8 }, 
    1094         { 0x1B, _r|_16_bit,                     _r16,   _rm16 }, 
    1095         { 0x1B, _r|_32_bit,                     _r32,   _rm32 }, 
    1096         { ASM_END, 0, 0, 0 } 
    1097 }; 
    1098  
    1099  
    1100 PTRNTAB2  aptb2SAR[] = /* SAR */ { 
    1101 //      { 0xd0, _7,                     _rm8, 0 }, 
    1102         { 0xd2, _7,                     _rm8, _cl }, 
    1103         { 0xc0, _7,                     _rm8, _imm8 }, 
    1104 //      { 0xd1, _7|_16_bit,                     _rm16, 0 }, 
    1105         { 0xd3, _7|_16_bit,                     _rm16, _cl }, 
    1106         { 0xc1, _7|_16_bit,                     _rm16, _imm8 }, 
    1107 //      { 0xd1, _7|_32_bit,                     _rm32, 0 }, 
    1108         { 0xd3, _7|_32_bit,                     _rm32, _cl }, 
    1109         { 0xc1, _7|_32_bit,                     _rm32,  _imm8 }, 
    1110         { ASM_END, 0, 0, 0 } 
    1111 }; 
    1112 PTRNTAB2  aptb2SHL[] = /* SHL */ { 
    1113 //      { 0xd0, _4,                     _rm8, 0 }, 
    1114         { 0xd2, _4,                     _rm8, _cl }, 
    1115         { 0xc0, _4,                     _rm8, _imm8 }, 
    1116 //      { 0xd1, _4|_16_bit,                     _rm16, 0 }, 
    1117         { 0xd3, _4|_16_bit,                     _rm16, _cl }, 
    1118         { 0xc1, _4|_16_bit,                     _rm16, _imm8 }, 
    1119 //      { 0xd1, _4|_32_bit,                     _rm32, 0 }, 
    1120         { 0xd3, _4|_32_bit,                     _rm32, _cl }, 
    1121         { 0xc1, _4|_32_bit,                     _rm32,  _imm8 }, 
    1122         { ASM_END, 0, 0, 0 } 
    1123 }; 
    1124 PTRNTAB2  aptb2SHR[] = /* SHR */ { 
    1125 //      { 0xd0, _5,                     _rm8, 0 }, 
    1126         { 0xd2, _5,                     _rm8, _cl }, 
    1127         { 0xc0, _5,                     _rm8, _imm8 }, 
    1128 //      { 0xd1, _5|_16_bit,                     _rm16, 0 }, 
    1129         { 0xd3, _5|_16_bit,                     _rm16, _cl }, 
    1130         { 0xc1, _5|_16_bit,                     _rm16, _imm8 }, 
    1131 //      { 0xd1, _5|_32_bit,                     _rm32, 0 }, 
    1132         { 0xd3, _5|_32_bit,                     _rm32, _cl }, 
    1133         { 0xc1, _5|_32_bit,                     _rm32,  _imm8 }, 
    1134         { ASM_END, 0, 0, 0 } 
    1135 }; 
    1136 PTRNTAB2  aptb2SUB[] = /* SUB */ { 
    1137         { 0x2c, _ib,            _al,    _imm8 }, 
    1138         { 0x83, _5|_16_bit,                     _rm16,  _imm8 }, 
    1139         { 0x2d, _iw|_16_bit,            _ax,    _imm16 }, 
    1140         { 0x83, _5|_32_bit,                     _rm32,  _imm8 }, 
    1141         { 0x2d, _id|_32_bit,            _eax,   _imm32 }, 
    1142         { 0x80, _5 | _ib,       _rm8,   _imm8 }, 
    1143         { 0x81, _5 | _iw|_16_bit,       _rm16,  _imm16 }, 
    1144         { 0x81, _5 | _id|_32_bit,       _rm32,  _imm32 }, 
    1145         { 0x28, _r,                     _rm8,   _r8 }, 
    1146         { 0x29, _r|_16_bit,                     _rm16,  _r16 }, 
    1147         { 0x29, _r|_32_bit,                     _rm32,  _r32 }, 
    1148         { 0x2A, _r,                     _r8,    _rm8 }, 
    1149         { 0x2B, _r|_16_bit,                     _r16,   _rm16 }, 
    1150         { 0x2B, _r|_32_bit,                     _r32,   _rm32 }, 
    1151         { ASM_END, 0, 0, 0 } 
    1152 }; 
     683 
     684#define OPTABLE(str,op) \ 
     685PTRNTAB2  aptb2##str[] = {      \ 
     686        { 0xd2, op,             _rm8,   _cl },  \ 
     687        { 0xc0, op|_ib,         _rm8,   _imm8 },        \ 
     688        { 0xd3, op|_16_bit,     _rm16,  _cl },  \ 
     689        { 0xc1, op|_ib|_16_bit, _rm16,  _imm8 },        \ 
     690        { 0xd3, op|_32_bit,     _rm32,  _cl },  \ 
     691        { 0xc1, op|_ib|_32_bit, _rm32,  _imm8, },       \ 
     692        { 0xd3, op|_64_bit,     _rm64,  _cl },  \ 
     693        { 0xc1, op|_ib|_64_bit, _rm64,  _imm8, },       \ 
     694        { ASM_END, 0, 0, 0 }    \ 
     695
     696 
     697OPTABLE(ROL,_0); 
     698OPTABLE(ROR,_1); 
     699OPTABLE(RCL,_2); 
     700OPTABLE(RCR,_3); 
     701OPTABLE(SHL,_4); 
     702OPTABLE(SHR,_5); 
     703OPTABLE(SAR,_7); 
     704 
     705#undef OPTABLE 
     706 
    1153707PTRNTAB2  aptb2TEST[] = /* TEST */ { 
    1154708        { 0xa8, _ib|_modnot1,           _al,    _imm8 }, 
     
    1185739        { ASM_END, 0, 0, 0 } 
    1186740}; 
    1187 PTRNTAB2  aptb2XOR[] = { 
    1188         { 0x34, _ib,    _al,    _imm8 }, 
    1189         { 0x83, _6|_16_bit,             _rm16,  _imm8 }, 
    1190         { 0x35, _iw|_16_bit,    _ax,    _imm16 }, 
    1191         { 0x83, _6|_32_bit,             _rm32,  _imm8 }, 
    1192         { 0x35, _id|_32_bit,    _eax,   _imm32 }, 
    1193         { 0x80, _6,             _rm8,   _imm8 }, 
    1194         { 0x81, _6|_16_bit,             _rm16,  _imm16 }, 
    1195         { 0x81, _6|_32_bit,             _rm32,  _imm32 }, 
    1196         { 0x30, _r,             _rm8, _r8 }, 
    1197         { 0x31, _r|_16_bit,             _rm16, _r16 }, 
    1198         { 0x31, _r|_32_bit,             _rm32, _r32 }, 
    1199         { 0x32, _r,             _r8,    _rm8 }, 
    1200         { 0x33, _r|_16_bit,             _r16,   _rm16 }, 
    1201         { 0x33, _r|_32_bit,             _r32,   _rm32 }, 
    1202         { ASM_END, 0, 0, 0 } 
    1203 }; 
    1204  
    1205 PTRNTAB2  aptb2CMOVO[] = { 
    1206         { 0x0F40, _r|_16_bit,   _r16,   _rm16 }, 
    1207         { 0x0F40, _r|_32_bit,   _r32,   _rm32 }, 
    1208         { ASM_END, 0, 0, 0 } 
    1209 }; 
    1210 PTRNTAB2  aptb2CMOVNO[] = { 
    1211         { 0x0F41, _r|_16_bit,   _r16,   _rm16 }, 
    1212         { 0x0F41, _r|_32_bit,   _r32,   _rm32 }, 
    1213         { ASM_END, 0, 0, 0 } 
    1214 }; 
    1215 PTRNTAB2  aptb2CMOVB[] = { 
    1216         { 0x0F42, _r|_16_bit,   _r16,   _rm16 }, 
    1217         { 0x0F42, _r|_32_bit,   _r32,   _rm32 }, 
    1218         { ASM_END, 0, 0, 0 } 
    1219 }; 
    1220 PTRNTAB2  aptb2CMOVNB[] = { 
    1221         { 0x0F43, _r|_16_bit,   _r16,   _rm16 }, 
    1222         { 0x0F43, _r|_32_bit,   _r32,   _rm32 }, 
    1223         { ASM_END, 0, 0, 0 } 
    1224 }; 
    1225 PTRNTAB2  aptb2CMOVZ[] = { 
    1226         { 0x0F44, _r|_16_bit,   _r16,   _rm16 }, 
    1227         { 0x0F44, _r|_32_bit,   _r32,   _rm32 }, 
    1228         { ASM_END, 0, 0, 0 } 
    1229 }; 
    1230 PTRNTAB2  aptb2CMOVNZ[] = { 
    1231         { 0x0F45, _r|_16_bit,   _r16,   _rm16 }, 
    1232         { 0x0F45, _r|_32_bit,   _r32,   _rm32 }, 
    1233         { ASM_END, 0, 0, 0 } 
    1234 }; 
    1235 PTRNTAB2  aptb2CMOVBE[] = { 
    1236         { 0x0F46, _r|_16_bit,   _r16,   _rm16 }, 
    1237         { 0x0F46, _r|_32_bit,   _r32,   _rm32 }, 
    1238         { ASM_END, 0, 0, 0 } 
    1239 }; 
    1240 PTRNTAB2  aptb2CMOVNBE[] = { 
    1241         { 0x0F47, _r|_16_bit,   _r16,   _rm16 }, 
    1242         { 0x0F47, _r|_32_bit,   _r32,   _rm32 }, 
    1243         { ASM_END, 0, 0, 0 } 
    1244 }; 
    1245 PTRNTAB2  aptb2CMOVS[] = { 
    1246         { 0x0F48, _r|_16_bit,   _r16,   _rm16 }, 
    1247         { 0x0F48, _r|_32_bit,   _r32,   _rm32 }, 
    1248         { ASM_END, 0, 0, 0 } 
    1249 }; 
    1250 PTRNTAB2  aptb2CMOVNS[] = { 
    1251         { 0x0F49, _r|_16_bit,   _r16,   _rm16 }, 
    1252         { 0x0F49, _r|_32_bit,   _r32,   _rm32 }, 
    1253         { ASM_END, 0, 0, 0 } 
    1254 }; 
    1255 PTRNTAB2  aptb2CMOVP[] = { 
    1256         { 0x0F4A, _r|_16_bit,   _r16,   _rm16 }, 
    1257         { 0x0F4A, _r|_32_bit,   _r32,   _rm32 }, 
    1258         { ASM_END, 0, 0, 0 } 
    1259 }; 
    1260 PTRNTAB2  aptb2CMOVNP[] = { 
    1261         { 0x0F4B, _r|_16_bit,   _r16,   _rm16 }, 
    1262         { 0x0F4B, _r|_32_bit,   _r32,   _rm32 }, 
    1263         { ASM_END, 0, 0, 0 } 
    1264 }; 
    1265 PTRNTAB2  aptb2CMOVL[] = { 
    1266         { 0x0F4C, _r|_16_bit,   _r16,   _rm16 }, 
    1267         { 0x0F4C, _r|_32_bit,   _r32,   _rm32 }, 
    1268         { ASM_END, 0, 0, 0 } 
    1269 }; 
    1270 PTRNTAB2  aptb2CMOVNL[] = { 
    1271         { 0x0F4D, _r|_16_bit,   _r16,   _rm16 }, 
    1272         { 0x0F4D, _r|_32_bit,   _r32,   _rm32 }, 
    1273         { ASM_END, 0, 0, 0 } 
    1274 }; 
    1275 PTRNTAB2  aptb2CMOVLE[] = { 
    1276         { 0x0F4E, _r|_16_bit,   _r16,   _rm16 }, 
    1277         { 0x0F4E, _r|_32_bit,   _r32,   _rm32 }, 
    1278         { ASM_END, 0, 0, 0 } 
    1279 }; 
    1280 PTRNTAB2  aptb2CMOVNLE[] = { 
    1281         { 0x0F4F, _r|_16_bit,   _r16,   _rm16 }, 
    1282         { 0x0F4F, _r|_32_bit,   _r32,   _rm32 }, 
    1283         { ASM_END, 0, 0, 0 } 
    1284 }; 
     741 
     742#define OPTABLE(str,op) \ 
     743PTRNTAB2  aptb2##str[] = {      \ 
     744        { 0x0F40|op, _r|_16_bit,   _r16,   _rm16 },     \ 
     745        { 0x0F40|op, _r|_32_bit,   _r32,   _rm32 },     \ 
     746        { 0x0F40|op, _r|_64_bit,   _r64,   _rm64 },     \ 
     747        { ASM_END, 0, 0, 0 }    \ 
     748
     749 
     750OPTABLE(CMOVO,0); 
     751OPTABLE(CMOVNO,1); 
     752OPTABLE(CMOVB,2); 
     753OPTABLE(CMOVNB,3); 
     754OPTABLE(CMOVZ,4); 
     755OPTABLE(CMOVNZ,5); 
     756OPTABLE(CMOVBE,6); 
     757OPTABLE(CMOVNBE,7); 
     758OPTABLE(CMOVS,8); 
     759OPTABLE(CMOVNS,9); 
     760OPTABLE(CMOVP,0xA); 
     761OPTABLE(CMOVNP,0xB); 
     762OPTABLE(CMOVL,0xC); 
     763OPTABLE(CMOVNL,0xD); 
     764OPTABLE(CMOVLE,0xE); 
     765OPTABLE(CMOVNLE,0xF); 
     766 
     767#undef OPTABLE 
    1285768 
    1286769PTRNTAB3  aptb3IMUL[] = /* IMUL */ { 
     
    1323806// interpretations 
    1324807// 
    1325 PTRNTAB0  aptb0F2XM1[] = /* F2XM1 */ { 
    1326         { 0xd9f0, 0 } 
    1327 }; 
    1328 PTRNTAB0  aptb0FABS[] = /* FABS */ { 
    1329         { 0xd9e1, 0 } 
    1330 }; 
    1331 PTRNTAB0  aptb0FCHS[] = /* FCHS */ { 
    1332         { 0xd9e0, 0 } 
    1333 }; 
    1334 PTRNTAB0  aptb0FCLEX[] = /* FCLEX */ { 
    1335         { 0xdbe2, _fwait } 
    1336 }; 
    1337 PTRNTAB0  aptb0FNCLEX[] = /* FNCLEX */ { 
    1338         { 0xdbe2, _nfwait } 
    1339 }; 
    1340 PTRNTAB0  aptb0FCOMPP[] = /* FCOMPP */ { 
    1341         { 0xded9, 0 } 
    1342 }; 
    1343 PTRNTAB0  aptb0FCOS[] = /* FCOS */ { 
    1344         { 0xd9ff, 0 } 
    1345 }; 
    1346 PTRNTAB0  aptb0FUCOMPP[] = /* FUCOMPP */ { 
    1347         { 0xdae9, 0 } 
    1348 }; 
    1349 PTRNTAB0  aptb0FDECSTP[] = /* FDECSTP */ { 
    1350         { 0xd9f6, 0 } 
    1351 }; 
    1352 PTRNTAB0  aptb0FINCSTP[] = /* FINCSTP */ { 
    1353         { 0xd9f7, 0 } 
    1354 }; 
    1355 PTRNTAB0  aptb0FINIT[] = /* FINIT */ { 
    1356         { 0xdbe3, _fwait } 
    1357 }; 
    1358 PTRNTAB0  aptb0FNINIT[] = /* FNINIT */ { 
    1359         { 0xdbe3, _nfwait } 
    1360 }; 
    1361 PTRNTAB0  aptb0FENI[] = /* FENI */ { 
    1362         { 0xdbe0, _fwait } 
    1363 }; 
    1364 PTRNTAB0  aptb0FNENI[] = /* FNENI */ { 
    1365         { 0xdbe0, _nfwait } 
    1366 }; 
    1367 PTRNTAB0  aptb0FDISI[] = /* FDISI */ { 
    1368         { 0xdbe1, _fwait } 
    1369 }; 
    1370 PTRNTAB0  aptb0FNDISI[] = /* FNDISI */ { 
    1371         { 0xdbe1, _nfwait } 
    1372 }; 
    1373 PTRNTAB0  aptb0FLD1[] = /* FLD1 */ { 
    1374         { 0xd9e8, 0 } 
    1375 }; 
    1376 PTRNTAB0  aptb0FLDL2T[] = /* FLDL2T */ { 
    1377         { 0xd9e9, 0 } 
    1378 }; 
    1379 PTRNTAB0  aptb0FLDL2E[] = /* FLDL2E */ { 
    1380         { 0xd9ea, 0 } 
    1381 }; 
    1382 PTRNTAB0  aptb0FLDPI[] = /* FLDPI */ { 
    1383         { 0xd9eb, 0 } 
    1384 }; 
    1385 PTRNTAB0  aptb0FLDLG2[] = /* FLDLG2 */ { 
    1386         { 0xd9ec, 0 } 
    1387 }; 
    1388 PTRNTAB0  aptb0FLDLN2[] = /* FLDLN2 */ { 
    1389         { 0xd9ed, 0 } 
    1390 }; 
    1391 PTRNTAB0  aptb0FLDZ[] = /* FLDZ */ { 
    1392         { 0xd9ee, 0 } 
    1393 }; 
    1394 PTRNTAB0  aptb0FNOP[] = /* FNOP */ { 
    1395         { 0xd9d0, 0 } 
    1396 }; 
    1397 PTRNTAB0  aptb0FPATAN[] = /* FPATAN */ { 
    1398         { 0xd9f3, 0 } 
    1399 }; 
    1400 PTRNTAB0  aptb0FPREM[] = /* FPREM */ { 
    1401         { 0xd9f8, 0 } 
    1402 }; 
    1403 PTRNTAB0  aptb0FPREM1[] = /* FPREM1 */ { 
    1404         { 0xd9f5, 0 } 
    1405 }; 
    1406 PTRNTAB0  aptb0FPTAN[] = /* FPTAN */ { 
    1407         { 0xd9f2, 0 } 
    1408 }; 
    1409 PTRNTAB0  aptb0FRNDINT[] = /* FRNDINT */ { 
    1410         { 0xd9fc, 0 } 
    1411 }; 
    1412 PTRNTAB0  aptb0FSCALE[] = /* FSCALE */ { 
    1413         { 0xd9fd, 0 } 
    1414 }; 
    1415 PTRNTAB0  aptb0FSETPM[] = /* FSETPM */ { 
    1416         { 0xdbe4, 0 } 
    1417 }; 
    1418 PTRNTAB0  aptb0FSIN[] = /* FSIN */ { 
    1419         { 0xd9fe, 0 } 
    1420 }; 
    1421 PTRNTAB0  aptb0FSINCOS[] = /* FSINCOS */ { 
    1422         { 0xd9fb, 0 } 
    1423 }; 
    1424 PTRNTAB0  aptb0FSQRT[] = /* FSQRT */ { 
    1425         { 0xd9fa, 0 } 
    1426 }; 
    1427 PTRNTAB0  aptb0FTST[] = /* FTST */ { 
    1428         { 0xd9e4, 0 } 
    1429 }; 
    1430 PTRNTAB0  aptb0FWAIT[] = /* FWAIT */ { 
    1431         { 0x9b, 0 } 
    1432 }; 
    1433 PTRNTAB0  aptb0FXAM[] = /* FXAM */ { 
    1434         { 0xd9e5, 0 } 
    1435 }; 
    1436 PTRNTAB0  aptb0FXTRACT[] = /* FXTRACT */ { 
    1437         { 0xd9f4, 0 } 
    1438 }; 
    1439 PTRNTAB0  aptb0FYL2X[] = /* FYL2X */ { 
    1440         { 0xd9f1, 0 } 
    1441 }; 
    1442 PTRNTAB0  aptb0FYL2XP1[] = /* FYL2XP1 */ { 
    1443         { 0xd9f9, 0 } 
    1444 }; 
     808 
     809OPTABLE0(F2XM1,    0xd9f0,0); 
     810OPTABLE0(FABS,     0xd9e1,0); 
     811OPTABLE0(FCHS,     0xd9e0,0); 
     812OPTABLE0(FCLEX,    0xdbe2,_fwait); 
     813OPTABLE0(FNCLEX,   0xdbe2, _nfwait); 
     814OPTABLE0(FCOMPP,   0xded9, 0); 
     815OPTABLE0(FCOS,     0xd9ff, 0); 
     816OPTABLE0(FUCOMPP,  0xdae9, 0); 
     817OPTABLE0(FDECSTP,  0xd9f6, 0); 
     818OPTABLE0(FINCSTP,  0xd9f7, 0); 
     819OPTABLE0(FINIT,    0xdbe3, _fwait); 
     820OPTABLE0(FNINIT,   0xdbe3, _nfwait); 
     821OPTABLE0(FENI,     0xdbe0, _fwait); 
     822OPTABLE0(FNENI,    0xdbe0, _nfwait); 
     823OPTABLE0(FDISI,    0xdbe1, _fwait); 
     824OPTABLE0(FNDISI,   0xdbe1, _nfwait); 
     825OPTABLE0(FLD1,     0xd9e8, 0); 
     826OPTABLE0(FLDL2T,   0xd9e9, 0); 
     827OPTABLE0(FLDL2E,   0xd9ea, 0); 
     828OPTABLE0(FLDPI,    0xd9eb, 0); 
     829OPTABLE0(FLDLG2,   0xd9ec, 0); 
     830OPTABLE0(FLDLN2,   0xd9ed, 0); 
     831OPTABLE0(FLDZ,     0xd9ee, 0); 
     832OPTABLE0(FNOP,     0xd9d0, 0); 
     833OPTABLE0(FPATAN,   0xd9f3, 0); 
     834OPTABLE0(FPREM,    0xd9f8, 0); 
     835OPTABLE0(FPREM1,   0xd9f5, 0); 
     836OPTABLE0(FPTAN,    0xd9f2, 0); 
     837OPTABLE0(FRNDINT,  0xd9fc, 0); 
     838OPTABLE0(FSCALE,   0xd9fd, 0); 
     839OPTABLE0(FSETPM,   0xdbe4, 0); 
     840OPTABLE0(FSIN,     0xd9fe, 0); 
     841OPTABLE0(FSINCOS,  0xd9fb, 0); 
     842OPTABLE0(FSQRT,    0xd9fa, 0); 
     843OPTABLE0(FTST,     0xd9e4, 0); 
     844OPTABLE0(FWAIT,    0x9b, 0); 
     845OPTABLE0(FXAM,     0xd9e5, 0); 
     846OPTABLE0(FXTRACT,  0xd9f4, 0); 
     847OPTABLE0(FYL2X,    0xd9f1, 0); 
     848OPTABLE0(FYL2XP1,  0xd9f9, 0); 
    1445849// 
    1446850// Floating point instructions which have entirely different flag 
     
    32212625        /*X("cmpsd",    0,              aptb0CMPSD )*/ \ 
    32222626        X("cmpsd",      ITopt|3,        (P) aptb3CMPSD ) \ 
     2627        X("cmpsq",      0,              aptb0CMPSQ ) \ 
    32232628        X("cmpss",      3,              (P) aptb3CMPSS ) \ 
    32242629        X("cmpsw",      0,              aptb0CMPSW ) \ 
     
    34502855        X("lodsb",      0,              aptb0LODSB ) \ 
    34512856        X("lodsd",      0,              aptb0LODSD ) \ 
     2857        X("lodsq",      0,              aptb0LODSQ ) \ 
    34522858        X("lodsw",      0,              aptb0LODSW ) \ 
    34532859        X("loop",       ITjump | 1,     (P) aptb1LOOP ) \ 
    34542860        X("loope",      ITjump | 1,     (P) aptb1LOOPE ) \ 
    34552861        X("loopne",     ITjump | 1,     (P) aptb1LOOPNE ) \ 
    3456         X("loopnz",     ITjump | 1,     (P) aptb1LOOPNZ ) \ 
    3457         X("loopz",      ITjump | 1,     (P) aptb1LOOPZ ) \ 
     2862        X("loopnz",     ITjump | 1,     (P) aptb1LOOPNE ) \ 
     2863        X("loopz",      ITjump | 1,     (P) aptb1LOOPE ) \ 
    34582864        X("lsl",        2,              (P) aptb2LSL ) \ 
    34592865        X("lss",        2,              (P) aptb2LSS ) \ 
     
    34992905        X("movshdup",   2,              (P) aptb2MOVSHDUP ) \ 
    35002906        X("movsldup",   2,              (P) aptb2MOVSLDUP ) \ 
     2907        X("movsq",      0,              aptb0MOVSQ ) \ 
    35012908        X("movss",      2,              (P) aptb2MOVSS ) \ 
    35022909        X("movsw",      0,              aptb0MOVSW ) \ 
     
    36453052        X("rsqrtss",    2,              (P) aptb2RSQRTSS ) \ 
    36463053        X("sahf",       0,              aptb0SAHF ) \ 
    3647         X("sal",        ITshift | 2,    (P) aptb2SAL ) \ 
     3054        X("sal",        ITshift | 2,    (P) aptb2SHL ) \ 
    36483055        X("sar",        ITshift | 2,    (P) aptb2SAR ) \ 
    36493056        X("sbb",        2,              (P) aptb2SBB ) \ 
     
    36513058        X("scasb",      0,              aptb0SCASB ) \ 
    36523059        X("scasd",      0,              aptb0SCASD ) \ 
     3060        X("scasq",      0,              aptb0SCASQ ) \ 
    36533061        X("scasw",      0,              aptb0SCASW ) \ 
    36543062        X("seta",       1,              (P) aptb1SETNBE ) \ 
     
    37043112        X("stosb",      0,              aptb0STOSB ) \ 
    37053113        X("stosd",      0,              aptb0STOSD ) \ 
     3114        X("stosq",      0,              aptb0STOSQ ) \ 
    37063115        X("stosw",      0,              aptb0STOSW ) \ 
    37073116        X("str",        1,              (P) aptb1STR ) \ 
  • trunk/src/e2ir.c

    r618 r621  
    44924492        n1 = array_toPtr(t1, n1); 
    44934493 
    4494         {   elem *escale; 
    4495  
    4496             escale = el_long(TYint, t1->nextOf()->size()); 
     4494        { 
     4495            elem *escale = el_long(TYsize_t, t1->nextOf()->size()); 
    44974496            n2 = el_bin(OPmul, TYint, n2, escale); 
    44984497            e = el_bin(OPadd, TYnptr, n1, n2); 
  • trunk/src/impcnvgen.c

    r428 r621  
    387387    Y(Tuns64, Tdchar) 
    388388 
    389     Y(Tint64, Tuns64) 
    390     Y(Tuns64, Tint64) 
     389//    Y(Tint64, Tuns64) 
     390//    Y(Tuns64, Tint64) 
    391391 
    392392    for (i = 0; i < TMAX; i++)