Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

x86table.cpp

Go to the documentation of this file.
00001 /*
00002 PeRdr - PE file disassembler
00003 Copyright (C) 1999-2002 Frediano Ziglio
00004 -----
00005 
00006 This program is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 -----
00020 
00021 INFORMATION
00022   www: https://freddy77.tripod.com/perdr/
00023   e-mail: freddy77@angelfire.com
00024 */
00025 #include "global.h"
00026 #ifdef HAVE_HDRSTOP
00027 #pragma hdrstop
00028 #endif
00029 
00030 #include "x86istr.h"
00031 #include "x86table.h"
00032 #include "x86dasm.h"
00033 #include "utils/compilecheck.hpp"
00034 
00035 #define istr__ -1
00036 #define I(rtn,special,istruction) \
00037   { &InstructionDecoder::rtn, special, istr_##istruction }
00038 
00039 const InstructionDecoder::InstTable InstructionDecoder::instrTable[] =
00040 {
00041   I( mod_reg,  modregEbGb,  add    ), /* ADD     mem/reg,reg (byte) [00] */
00042   I( mod_reg,  modregEvGv,  add    ), /* ADD     mem/reg,reg (word) [01] */
00043   I( mod_reg,  modregGbEb,  add    ), /* ADD     reg,mem/reg (byte) [02] */
00044   I( mod_reg,  modregGvEv,  add    ), /* ADD     reg,mem/reg (word) [03] */
00045   I( two_byte,      regAL,  add    ), /* ADD     AL,kk              [04] */
00046   I( three_byte,    regAX,  add    ), /* ADD     AX,jjkk            [05] */
00047   I( one_byte,      regES,  push   ), /* PUSH    ES                 [06] */
00048   I( one_byte,      regES,  pop    ), /* POP     ES                 [07] */
00049   I( mod_reg,  modregEbGb,  or     ), /* OR      mem/reg,reg (byte) [08] */
00050   I( mod_reg,  modregEvGv,  or     ), /* OR      mem/reg,reg (word) [09] */
00051   I( mod_reg,  modregGbEb,  or     ), /* OR      reg,mem/reg (byte) [0A] */
00052   I( mod_reg,  modregGvEv,  or     ), /* OR      reg,mem/reg (word) [0B] */
00053   I( two_byte,      regAL,  or     ), /* OR      AL,kk              [0C] */
00054   I( three_byte,    regAX,  or     ), /* OR      AX,jjkk            [0D] */
00055   I( one_byte,      regCS,  push   ), /* PUSH    CS                 [0E] */
00056   I( extra,             0,  _      ), /* 2-byte opcode              [0F] */
00057   I( mod_reg,  modregEbGb,  adc    ), /* ADC     mem/reg,reg (byte) [10] */
00058   I( mod_reg,  modregEvGv,  adc    ), /* ADC     mem/reg,reg (word) [11] */
00059   I( mod_reg,  modregGbEb,  adc    ), /* ADC     reg,mem/reg (byte) [12] */
00060   I( mod_reg,  modregGvEv,  adc    ), /* ADC     reg,mem/reg (word) [13] */
00061   I( two_byte,      regAL,  adc    ), /* ADC     AL,kk              [14] */
00062   I( three_byte,    regAX,  adc    ), /* ADC     AX,jjkk            [15] */
00063   I( one_byte,      regSS,  push   ), /* PUSH    SS                 [16] */
00064   I( one_byte,      regSS,  pop    ), /* POP     SS                 [17] */
00065   I( mod_reg,  modregEbGb,  sbb    ), /* SBB     mem/reg,reg (byte) [18] */
00066   I( mod_reg,  modregEvGv,  sbb    ), /* SBB     mem/reg,reg (word) [19] */
00067   I( mod_reg,  modregGbEb,  sbb    ), /* SBB     reg,mem/reg (byte) [1A] */
00068   I( mod_reg,  modregGvEv,  sbb    ), /* SBB     reg,mem/reg (word) [1B] */
00069   I( two_byte,      regAL,  sbb    ), /* SBB     AL,kk              [1C] */
00070   I( three_byte,    regAX,  sbb    ), /* SBB     AX,jjkk            [1D] */
00071   I( one_byte,      regDS,  push   ), /* PUSH    DS                 [1E] */
00072   I( one_byte,      regDS,  pop    ), /* POP     DS                 [1F] */
00073   I( mod_reg,  modregEbGb,  and    ), /* AND     mem/reg,reg (byte) [20] */
00074   I( mod_reg,  modregEvGv,  and    ), /* AND     mem/reg,reg (word) [21] */
00075   I( mod_reg,  modregGbEb,  and    ), /* AND     reg,mem/reg (byte) [22] */
00076   I( mod_reg,  modregGvEv,  and    ), /* AND     reg,mem/reg (word) [23] */
00077   I( two_byte,      regAL,  and    ), /* AND     AL,kk              [24] */
00078   I( three_byte,    regAX,  and    ), /* AND     AX,jjkk            [25] */
00079   I( seg_over,          0,  _      ), /* SEGMENT OVERIDE "ES"       [26] */
00080   I( one_byte,    regNone,  daa    ), /* DAA                        [27] */
00081   I( mod_reg,  modregEbGb,  sub    ), /* SUB     mem/reg,reg (byte) [28] */
00082   I( mod_reg,  modregEvGv,  sub    ), /* SUB     mem/reg,reg (word) [29] */
00083   I( mod_reg,  modregGbEb,  sub    ), /* SUB     reg,mem/reg (byte) [2A] */
00084   I( mod_reg,  modregGvEv,  sub    ), /* SUB     reg,mem/reg (word) [2B] */
00085   I( two_byte,      regAL,  sub    ), /* SUB     AL,kk              [2C] */
00086   I( three_byte,    regAX,  sub    ), /* SUB     AX,jjkk            [2D] */
00087   I( seg_over,          0,  _      ), /* SEGMENT OVERIDE "CS"       [2E] */
00088   I( one_byte,    regNone,  das    ), /* DAS                        [2F] */
00089   I( mod_reg,  modregEbGb,  xor    ), /* XOR     mem/reg,reg (byte) [30] */
00090   I( mod_reg,  modregEvGv,  xor    ), /* XOR     mem/reg,reg (word) [31] */
00091   I( mod_reg,  modregGbEb,  xor    ), /* XOR     reg,mem/reg (byte) [32] */
00092   I( mod_reg,  modregGvEv,  xor    ), /* XOR     reg,mem/reg (word) [33] */
00093   I( two_byte,      regAL,  xor    ), /* XOR     AL,kk              [34] */
00094   I( three_byte,    regAX,  xor    ), /* XOR     AX,jjkk            [35] */
00095   I( seg_over,          0,  _      ), /* SEGMENT OVERIDE "SS"       [36] */
00096   I( one_byte,    regNone,  aaa    ), /* AAA                        [37] */
00097   I( mod_reg,  modregEbGb,  cmp    ), /* CMP     mem/reg,reg (byte) [38] */
00098   I( mod_reg,  modregEvGv,  cmp    ), /* CMP     mem/reg,reg (word) [39] */
00099   I( mod_reg,  modregGbEb,  cmp    ), /* CMP     reg,mem/reg (byte) [3A] */
00100   I( mod_reg,  modregGvEv,  cmp    ), /* CMP     reg,mem/reg (word) [3B] */
00101   I( two_byte,      regAL,  cmp    ), /* CMP     AL,kk              [3C] */
00102   I( three_byte,    regAX,  cmp    ), /* CMP     AX,jjkk            [3D] */
00103   I( seg_over,          0,  _      ), /* SEGMENT OVERIDE "DS"       [3E] */
00104   I( one_byte,    regNone,  aas    ), /* AAS                        [3F] */
00105   I( one_byte,      regAX,  inc    ), /* INC     AX                 [40] */
00106   I( one_byte,      regCX,  inc    ), /* INC     CX                 [41] */
00107   I( one_byte,      regDX,  inc    ), /* INC     DX                 [42] */
00108   I( one_byte,      regBX,  inc    ), /* INC     BX                 [43] */
00109   I( one_byte,      regSP,  inc    ), /* INC     SP                 [44] */
00110   I( one_byte,      regBP,  inc    ), /* INC     BP                 [45] */
00111   I( one_byte,      regSI,  inc    ), /* INC     SI                 [46] */
00112   I( one_byte,      regDI,  inc    ), /* INC     DI                 [47] */
00113   I( one_byte,      regAX,  dec    ), /* DEC     AX                 [48] */
00114   I( one_byte,      regCX,  dec    ), /* DEC     CX                 [49] */
00115   I( one_byte,      regDX,  dec    ), /* DEC     DX                 [4A] */
00116   I( one_byte,      regBX,  dec    ), /* DEC     BX                 [4B] */
00117   I( one_byte,      regSP,  dec    ), /* DEC     SP                 [4C] */
00118   I( one_byte,      regBP,  dec    ), /* DEC     BP                 [4D] */
00119   I( one_byte,      regSI,  dec    ), /* DEC     SI                 [4E] */
00120   I( one_byte,      regDI,  dec    ), /* DEC     DI                 [4F] */
00121   I( one_byte,      regAX,  push   ), /* PUSH    AX                 [50] */
00122   I( one_byte,      regCX,  push   ), /* PUSH    CX                 [51] */
00123   I( one_byte,      regDX,  push   ), /* PUSH    DX                 [52] */
00124   I( one_byte,      regBX,  push   ), /* PUSH    BX                 [53] */
00125   I( one_byte,      regSP,  push   ), /* PUSH    SP                 [54] */
00126   I( one_byte,      regBP,  push   ), /* PUSH    BP                 [55] */
00127   I( one_byte,      regSI,  push   ), /* PUSH    SI                 [56] */
00128   I( one_byte,      regDI,  push   ), /* PUSH    DI                 [57] */
00129   I( one_byte,      regAX,  pop    ), /* POP     AX                 [58] */
00130   I( one_byte,      regCX,  pop    ), /* POP     CX                 [59] */
00131   I( one_byte,      regDX,  pop    ), /* POP     DX                 [5A] */
00132   I( one_byte,      regBX,  pop    ), /* POP     BX                 [5B] */
00133   I( one_byte,      regSP,  pop    ), /* POP     SP                 [5C] */
00134   I( one_byte,      regBP,  pop    ), /* POP     BP                 [5D] */
00135   I( one_byte,      regSI,  pop    ), /* POP     SI                 [5E] */
00136   I( one_byte,      regDI,  pop    ), /* POP     DI                 [5F] */
00137   I( one_byte,    regNone,  pusha  ), /* PUSHA (PUSHAD on 386)      [60] */
00138   I( one_byte,    regNone,  popa   ), /* POPA (POPAD on 386)        [61] */
00139   I( mod_reg,  modregGvMa,  bound  ), /* BOUND                      [62] */
00140   I( mod_reg,  modregEvGv,  arpl   ), /* ARPL                       [63] */
00141   I( seg_over,          0,  _      ), /* SEGMENT OVERIDE "FS" on 386[64] */
00142   I( seg_over,          0,  _      ), /* SEGMENT OVERIDE "GS" on 386[65] */
00143   I( opsize_over,       0,  _      ), /* OPERAND SIZE OVERIDE on 386[66] */
00144   I( adrsize_over,      0,  _      ), /* ADDRESS SIZE OVERIDE on 386[67] */
00145   I( three_byte,  regNone,  push   ), /* PUSH (immediate word)      [68] */
00146   I( mod_reg, modregGvEvIv, imul   ), /* IMUL reg,mem/reg,imm. word [69] */
00147   I( two_sbyte,         0,  push   ), /* PUSH (immed. signed byte)  [6A] */
00148   I( mod_reg, modregGvEvIsb,imul   ), /* IMUL reg,mem/reg,imm. byte [6B] */
00149   I( string_byte,      -1,  insb   ), /* INS     BYTE               [6C] */
00150   I( string_byte,istr_insd, insw   ), /* INS     WORD               [6D] */
00151   I( string_byte,      -1,  outsb  ), /* OUTS    BYTE               [6E] */
00152   I( string_byte,istr_outsd,outsw  ), /* OUTS    WORD               [6F] */
00153   I( disp8,             0,  jo     ), /* JO      <Label>            [70] */
00154   I( disp8,             0,  jno    ), /* JNO     <Label>            [71] */
00155   I( disp8,             0,  jc     ), /* JC      <Label>            [72] */
00156   I( disp8,             0,  jnc    ), /* JNC     <Label>            [73] */
00157   I( disp8,             0,  jz     ), /* JZ      <Label>            [74] */
00158   I( disp8,             0,  jnz    ), /* JNZ     <Label>            [75] */
00159   I( disp8,             0,  jbe    ), /* JBE     <Label>            [76] */
00160   I( disp8,             0,  jnbe   ), /* JNBE    <Label>            [77] */
00161   I( disp8,             0,  js     ), /* JS      <Label>            [78] */
00162   I( disp8,             0,  jns    ), /* JNS     <Label>            [79] */
00163   I( disp8,             0,  jp     ), /* JP      <Label>            [7A] */
00164   I( disp8,             0,  jnp    ), /* JNP     <Label>            [7B] */
00165   I( disp8,             0,  jl     ), /* JL      <Label>            [7C] */
00166   I( disp8,             0,  jnl    ), /* JNL     <Label>            [7D] */
00167   I( disp8,             0,  jng    ), /* JG      <Label>            [7E] */
00168   I( disp8,             0,  jg     ), /* JNG     <Label>            [7F] */
00169   I( group1,   modregEbIub, _      ), /* Special mem/reg,kk         [80] */
00170   I( group1,   modregEvIv,  _      ), /* Special mem/reg,jjkk       [81] */
00171   I( group1,   modregEbIub, _      ), /* Special mem/reg,kk         [82] */
00172   I( group1,   modregEvIsb, _      ), /* Special mem/reg,kk (word)  [83] */
00173   I( mod_reg,  modregGbEb,  test   ), /* TEST    mem/reg,reg (byte) [84] */
00174   I( mod_reg,  modregGvEv,  test   ), /* TEST    mem/reg,reg (word) [85] */
00175   I( mod_reg,  modregGbEb,  xchg   ), /* XCHG    reg,mem/reg (byte) [86] */
00176   I( mod_reg,  modregGvEv,  xchg   ), /* XCHG    reg,mem/reg (word) [87] */
00177   I( mod_reg,  modregEbGb,  mov    ), /* MOV     mem/reg,reg (byte) [88] */
00178   I( mod_reg,  modregEvGv,  mov    ), /* MOV     mem/reg,reg (word) [89] */
00179   I( mod_reg,  modregGbEb,  mov    ), /* MOV     reg,mem/reg (byte) [8A] */
00180   I( mod_reg,  modregGvEv,  mov    ), /* MOV     reg,mem/reg (word) [8B] */
00181   I( seg_reg,  modregEwSw,  mov    ), /* MOV     mem/reg,segreg     [8C] */
00182   I( mod_reg,  modregGvMn,  lea    ), /* LEA     reg,mem/reg        [8D] */
00183   I( seg_reg,  modregSwEw,  mov    ), /* MOV     segreg,mem/reg     [8E] */
00184   I( mod_reg,    modregEv,  pop    ), /* POP     mem/reg (Special)  [8F] */
00185   I( one_byte,    regNone,  nop    ), /* NOP                        [90] */
00186   I( one_a,         regCX,  xchg   ), /* XCHG    AX,CX              [91] */
00187   I( one_a,         regDX,  xchg   ), /* XCHG    AX,DX              [92] */
00188   I( one_a,         regBX,  xchg   ), /* XCHG    AX,BX              [93] */
00189   I( one_a,         regSP,  xchg   ), /* XCHG    AX,SP              [94] */
00190   I( one_a,         regBP,  xchg   ), /* XCHG    AX,BP              [95] */
00191   I( one_a,         regSI,  xchg   ), /* XCHG    AX,SI              [96] */
00192   I( one_a,         regDI,  xchg   ), /* XCHG    AX,DI              [97] */
00193   I( conv_byte, istr_cwde,  cbw    ), /* CBW                        [98] */
00194   I( conv_byte,  istr_cdq,  cwd    ), /* CWD                        [99] */
00195   I( five_byte,         0,  call   ), /* CALL    <Label>            [9A] */
00196   I( wait,              0,  wait   ), /* WAIT                       [9B] */
00197   I( one_byte,    regNone,  pushf  ), /* PUSHF                      [9C] */
00198   I( one_byte,    regNone,  popf   ), /* POPF                       [9D] */
00199   I( one_byte,    regNone,  sahf   ), /* SAHF                       [9E] */
00200   I( one_byte,    regNone,  lahf   ), /* LAHF                       [9F] */
00201   I( three_a,           0,  mov    ), /* MOV     AL,addr            [A0] */
00202   I( three_a,           0,  mov    ), /* MOV     AX,addr            [A1] */
00203   I( three_a,           0,  mov    ), /* MOV     addr,AL            [A2] */
00204   I( three_a,           0,  mov    ), /* MOV     addr,AX            [A3] */
00205   I( string_byte,      -1,  movsb  ), /* MOVS    BYTE               [A4] */
00206   I( string_byte,istr_movsd,movsw  ), /* MOVS    WORD               [A5] */
00207   I( string_byte,      -1,  cmpsb  ), /* CMPS    BYTE               [A6] */
00208   I( string_byte,istr_cmpsd,cmpsw  ), /* CMPS    WORD               [A7] */
00209   I( two_byte,      regAL,  test   ), /* TEST    AL,addr            [A8] */
00210   I( three_byte,    regAX,  test   ), /* TEST    AX,addr            [A9] */
00211   I( string_byte,      -1,  stosb  ), /* STOS    BYTE               [AA] */
00212   I( string_byte,istr_stosd,stosw  ), /* STOS    WORD               [AB] */
00213   I( string_byte,      -1,  lodsb  ), /* LODS    BYTE               [AC] */
00214   I( string_byte,istr_lodsd,lodsw  ), /* LODS    WORD               [AD] */
00215   I( string_byte,      -1,  scasb  ), /* SCAS    BYTE               [AE] */
00216   I( string_byte,istr_scasd,scasw  ), /* SCAS    WORD               [AF] */
00217   I( two_byte,      regAL,  mov    ), /* MOV     AL,kk              [B0] */
00218   I( two_byte,      regCL,  mov    ), /* MOV     CL,kk              [B1] */
00219   I( two_byte,      regDL,  mov    ), /* MOV     DL,kk              [B2] */
00220   I( two_byte,      regBL,  mov    ), /* MOV     BL,kk              [B3] */
00221   I( two_byte,      regAH,  mov    ), /* MOV     AH,kk              [B4] */
00222   I( two_byte,      regCH,  mov    ), /* MOV     CH,kk              [B5] */
00223   I( two_byte,      regDH,  mov    ), /* MOV     DH,kk              [B6] */
00224   I( two_byte,      regBH,  mov    ), /* MOV     BH,kk              [B7] */
00225   I( three_byte,    regAX,  mov    ), /* MOV     AX,kk              [B8] */
00226   I( three_byte,    regCX,  mov    ), /* MOV     CX,kk              [B9] */
00227   I( three_byte,    regDX,  mov    ), /* MOV     DX,kk              [BA] */
00228   I( three_byte,    regBX,  mov    ), /* MOV     BX,kk              [BB] */
00229   I( three_byte,    regSP,  mov    ), /* MOV     SP,kk              [BC] */
00230   I( three_byte,    regBP,  mov    ), /* MOV     BP,kk              [BD] */
00231   I( three_byte,    regSI,  mov    ), /* MOV     SI,kk              [BE] */
00232   I( three_byte,    regDI,  mov    ), /* MOV     DI,kk              [BF] */
00233   I( group2,   modregEbIub, _      ), /* Special mem/reg,kk  (byte) [C0] */
00234   I( group2,   modregEvIub, _      ), /* Special mem/reg,kk  (word) [C1] */
00235   I( three_byte,  regNone,  ret    ), /* RET     jjkk               [C2] */
00236   I( one_byte,    regNone,  ret    ), /* RET                        [C3] */
00237   I( mod_reg,  modregGvMp,  les    ), /* LES     reg,mem            [C4] */
00238   I( mod_reg,  modregGvMp,  lds    ), /* LDS     reg,mem            [C5] */
00239 // dato che non c'e' estensione considera unsigned
00240   I( mov_special, modregEbIub, mov ), /* MOV     mem,kk   (Special) [C6] */
00241   I( mov_special, modregEvIv,  mov ), /* MOV     mem,jjkk (Special) [C7] */
00242   I( enter,             0,  enter  ), /* ENTER   im. word,im. byte  [C8] */
00243   I( one_byte,    regNone,  leave  ), /* LEAVE                      [C9] */
00244   I( three_byte,  regNone,  retf   ), /* RETF    jjkk               [CA] */
00245   I( one_byte,    regNone,  retf   ), /* RETF                       [CB] */
00246   I( one_byte,    regNone,  int3   ), /* INT     3                  [CC] */
00247   I( two_byte,    regNone,  int    ), /* INT     type               [CD] */
00248   I( one_byte,    regNone,  into   ), /* INTO                       [CE] */
00249   I( one_byte,    regNone,  iret   ), /* IRET                       [CF] */
00250   I( group2,    modregEb1,  _      ), /* Special mem/reg,1  (byte)  [D0] */
00251   I( group2,    modregEv1,  _      ), /* Special mem/reg,1  (word)  [D1] */
00252   I( group2,   modregEbCL,  _      ), /* Special mem/reg,CL (byte)  [D2] */
00253   I( group2,   modregEvCL,  _      ), /* Special mem/reg,CL (word)  [D3] */
00254   I( two_bcd,           0,  aam    ), /* AAM                        [D4] */
00255   I( two_bcd,           0,  aad    ), /* AAD                        [D5] */
00256   I( stub,              0,  _      ), /* not used                   [D6] */
00257   I( one_byte,    regNone,  xlat   ), /* XLAT                       [D7] */
00258   I( esc,               0,  esc    ), /* ESC  (Special)             [D8] */
00259   I( esc,               0,  esc    ), /* ESC  (Special)             [D9] */
00260   I( esc,               0,  esc    ), /* ESC  (Special)             [DA] */
00261   I( esc,               0,  esc    ), /* ESC  (Special)             [DB] */
00262   I( esc,               0,  esc    ), /* ESC  (Special)             [DC] */
00263   I( esc,               0,  esc    ), /* ESC  (Special)             [DD] */
00264   I( esc,               0,  esc    ), /* ESC  (Special)             [DE] */
00265   I( esc,               0,  esc    ), /* ESC  (Special)             [DF] */
00266   I( disp8,             0,  loopnz ), /* LOOPNZ                     [E0] */
00267   I( disp8,             0,  loopz  ), /* LOOPZ                      [E1] */
00268   I( disp8,             0,  loop   ), /* LOOP                       [E2] */
00269   I( disp8,             0,  jcxz   ), /* JCXZ                       [E3] */
00270   I( two_byte,      regAL,  in     ), /* IN      AL,kk              [E4] */
00271   I( two_byte,      regAX,  in     ), /* IN      AX,kk              [E5] */
00272   I( two_a,             0,  out    ), /* OUT     kk,AL              [E6] */
00273   I( two_a,             0,  out    ), /* OUT     kk,AX              [E7] */
00274   I( disp16,            0,  call   ), /* CALL    <Label>            [E8] */
00275   I( disp16,            0,  jmp    ), /* JMP     <Label>            [E9] */
00276   I( five_byte,         0,  jmp    ), /* JMP     <Label>            [EA] */
00277   I( disp8,             0,  jmp    ), /* JMP     SHORT <Label>      [EB] */
00278   I( in_out,        regDX,  in     ), /* IN      AL,DX              [EC] */
00279   I( in_out,        regDX,  in     ), /* IN      AX,DX              [ED] */
00280   I( in_out,        regDX,  out    ), /* OUT     DX,AL              [EE] */
00281   I( in_out,        regDX,  out    ), /* OUT     DX,AX              [EF] */
00282   I( prefix,            0,  lock   ), /* LOCK                       [F0] */
00283   I( stub,              0,  _      ), /* not used                   [F1] */
00284   I( prefix,            0,  repnz  ), /* REPNZ                      [F2] */
00285   I( prefixf3,          0,  repz   ), /* REPZ                       [F3] */
00286   I( one_byte,    regNone,  hlt    ), /* HLT                        [F4] */
00287   I( one_byte,    regNone,  cmc    ), /* CMC                        [F5] */
00288   I( group3,     modregEb,  _      ), /* Special (byte) (Group 3)   [F6] */
00289   I( group3,     modregEv,  _      ), /* Special (word) (Group 3)   [F7] */
00290   I( one_byte,    regNone,  clc    ), /* CLC                        [F8] */
00291   I( one_byte,    regNone,  stc    ), /* STC                        [F9] */
00292   I( one_byte,    regNone,  cli    ), /* CLI                        [FA] */
00293   I( one_byte,    regNone,  sti    ), /* STI                        [FB] */
00294   I( one_byte,    regNone,  cld    ), /* CLD                        [FC] */
00295   I( one_byte,    regNone,  std    ), /* STD                        [FD] */
00296   I( group4,     modregEb,  _      ), /* Special (Group 4)          [FE] */
00297   I( group5,     modregEv,  _      )  /* Special (Group 5)          [FF] */
00298 };
00299 
00300 const InstructionDecoder::InstTable InstructionDecoder::exInstrTable[] = {
00301   I( group6,       modregEw,  _        ), /* Spec. (word) (grp 6)   [0F] [00] */
00302   I( group7,       modregMs,  _        ), /* Spec. (dword) (grp 7)  [0F] [01] */
00303   I( mod_reg,    modregGvEw,  lar      ), /* LAR                    [0F] [02] */
00304   I( mod_reg,    modregGvEw,  lsl      ), /* LSL                    [0F] [03] */
00305   I( stub,                0,  _        ), /* not used               [0F] [04] */
00306   I( stub,                0,  _        ), /* not used               [0F] [05] */
00307   I( one_byte,      regNone,  clts     ), /* CLTS                   [0F] [06] */
00308   I( stub,                0,  _        ), /* not used               [0F] [07] */
00309   I( one_byte,      regNone,  invd     ), /* INVD (486 only)        [0F] [08] */
00310   I( one_byte,      regNone,  wbinvd   ), /* WBINVD (486 only)      [0F] [09] */
00311   I( stub,                0,  _        ), /* not used               [0F] [0A] */
00312   I( stub,                0,  ud2      ), /* ud2                    [0F] [0B] */
00313   I( stub,                0,  _        ), /* not used               [0F] [0C] */
00314   I( one_byte_k63d, regNone,  femms    ), /* FEMMS                  [0F] [0D] */
00315   I( prefetch_k63d,       0,  prefetch ), /* PREFETCH               [0F] [0E] */
00316   I( k6_3dnow,   modregPqQq,  _        ), /* 3DNow!                 [0F] [0F] */
00317   I( mod_xmm,  modregVpsWps,  movups   ), /* movups   reg,mem/reg   [0F] [10] */
00318   I( mod_xmm,  modregWpsVps,  movups   ), /* movups   mem/reg,reg   [0F] [11] */
00319   I( mod_xmm,    modregWqVq,  movlps   ), /* not used               [0F] [12] */
00320   I( mod_xmm,    modregVqWq,  movlps   ), /* not used               [0F] [13] */
00321   // changed from VpsWq to VpsWps as address must be aligned to 16byte bound
00322   I( mod_xmm,  modregVpsWps,  unpcklps ), /* unpcklps reg,mem/reg   [0F] [14] */
00323   I( mod_xmm,  modregVpsWps,  unpckhps ), /* unpckhps reg,mem/reg   [0F] [15] */
00324   I( mod_xmm,    modregVqWq,  movhps   ), /* not used               [0F] [16] */
00325   I( mod_xmm,    modregWqVq,  movhps   ), /* not used               [0F] [17] */
00326   I( group16,             0,  _        ), /* Special (Group 16)     [0F] [18] */
00327   I( stub,                0,  _        ), /* not used               [0F] [19] */
00328   I( stub,                0,  _        ), /* not used               [0F] [1A] */
00329   I( stub,                0,  _        ), /* not used               [0F] [1B] */
00330   I( stub,                0,  _        ), /* not used               [0F] [1C] */
00331   I( stub,                0,  _        ), /* not used               [0F] [1D] */
00332   I( stub,                0,  _        ), /* not used               [0F] [1E] */
00333   I( stub,                0,  _        ), /* not used               [0F] [1F] */
00334   I( mov_creg, movcregR32CRx, mov      ), /* MOV      r32,CRx       [0F] [20] */
00335   I( mov_creg, movcregR32DRx,  mov     ), /* MOV      r32,DRx       [0F] [21] */
00336   I( mov_creg, movcregCRxr32,  mov     ), /* MOV      CRx,r32       [0F] [22] */
00337   I( mov_creg, movcregDRxr32,  mov     ), /* MOV      DRx,r32       [0F] [23] */
00338   I( mov_creg, movcregR32TRx,  mov     ), /* MOV r32,TRx 486only!!  [0F] [24] */
00339   I( stub,                0,     _     ), /* not used               [0F] [25] */
00340   I( mov_creg, movcregTRxr32,  mov     ), /* MOV TRx,r32 486only!!  [0F] [26] */
00341   I( stub,                0,     _     ), /* not used               [0F] [27] */
00342   I( mod_xmm,  modregVpsWps,   movaps  ), /* movaps   reg,mem/reg   [0F] [28] */
00343   I( mod_xmm,  modregWpsVps,   movaps  ), /* movaps   mem/reg,reg   [0F] [29] */
00344   // this is VpsQq, not WpsQq
00345   I( mod_xmm,  modregVpsQq,    cvtpi2ps), /* cvtpi2ps reg,mem/reg   [0F] [2A] */
00346   I( mod_xmm,  modregWpsVps,   movntps ), /* movntps  mem/reg,reg   [0F] [2B] */
00347   I( mod_xmm,    modregPqWq,  cvttps2pi), /* cvttps2pi reg,mem/reg  [0F] [2C] */
00348   // cvtps2pi mmx,xmm/mem64, this is QqWq, not QqWps
00349   I( mod_xmm,    modregPqWq,   cvtps2pi), /* cvtps2pi reg,mem/reg   [0F] [2D] */
00350   I( mod_xmm,  modregVssWss,   ucomiss ), /* ucomiss  reg,mem/reg   [0F] [2E] */
00351   // this is VssWss, not VpsWps
00352   I( mod_xmm,  modregVssWss,   comiss  ), /* comiss   reg,mem/reg   [0F] [2F] */
00353   I( one_byte,      regNone,  wrmsr    ), /* WRMSR                  [0F] [30] */
00354   I( one_byte,      regNone,  rdtsc    ), /* RDTSC                  [0F] [31] */
00355   I( one_byte,      regNone,  rdmsr    ), /* RDMSR                  [0F] [32] */
00356   I( one_byte,      regNone,  rdpmc    ), /* RDPMC                  [0F] [33] */
00357   I( one_byte,      regNone,  sysenter ), /* SYSENTER               [0F] [34] */
00358   I( one_byte,      regNone,  sysexit  ), /* SYSEXIT                [0F] [35] */
00359   I( stub,                0,     _     ), /* not used               [0F] [36] */
00360   I( stub,                0,     _     ), /* not used               [0F] [37] */
00361   I( stub,                0,     _     ), /* not used               [0F] [38] */
00362   I( stub,                0,     _     ), /* not used               [0F] [39] */
00363   I( stub,                0,     _     ), /* not used               [0F] [3A] */
00364   I( stub,                0,     _     ), /* not used               [0F] [3B] */
00365   I( stub,                0,     _     ), /* not used               [0F] [3C] */
00366   I( stub,                0,     _     ), /* not used               [0F] [3D] */
00367   I( stub,                0,     _     ), /* not used               [0F] [3E] */
00368   I( stub,                0,     _     ), /* not used               [0F] [3F] */
00369   I( mod_reg,    modregGvEv,  cmovo    ), /* CMOVO   reg,mem/reg    [0F] [40] */
00370   I( mod_reg,    modregGvEv,  cmovno   ), /* CMOVNO  reg,mem/reg    [0F] [41] */
00371   I( mod_reg,    modregGvEv,  cmovb    ), /* CMOVB   reg,mem/reg    [0F] [42] */
00372   I( mod_reg,    modregGvEv,  cmovnb   ), /* CMOVNB  reg,mem/reg    [0F] [43] */
00373   I( mod_reg,    modregGvEv,  cmovz    ), /* CMOVO   reg,mem/reg    [0F] [44] */
00374   I( mod_reg,    modregGvEv,  cmovnz   ), /* CMOVNO  reg,mem/reg    [0F] [45] */
00375   I( mod_reg,    modregGvEv,  cmovbe   ), /* CMOVBE  reg,mem/reg    [0F] [46] */
00376   I( mod_reg,    modregGvEv,  cmovnbe  ), /* CMOVNBE reg,mem/reg    [0F] [47] */
00377   I( mod_reg,    modregGvEv,  cmovs    ), /* CMOVS   reg,mem/reg    [0F] [48] */
00378   I( mod_reg,    modregGvEv,  cmovns   ), /* CMOVNS  reg,mem/reg    [0F] [49] */
00379   I( mod_reg,    modregGvEv,  cmovp    ), /* CMOVP   reg,mem/reg    [0F] [4A] */
00380   I( mod_reg,    modregGvEv,  cmovnp   ), /* CMOVNP  reg,mem/reg    [0F] [4B] */
00381   I( mod_reg,    modregGvEv,  cmovl    ), /* CMOVL   reg,mem/reg    [0F] [4C] */
00382   I( mod_reg,    modregGvEv,  cmovnl   ), /* CMOVNL  reg,mem/reg    [0F] [4D] */
00383   I( mod_reg,    modregGvEv,  cmovle   ), /* CMOVLE  reg,mem/reg    [0F] [4E] */
00384   I( mod_reg,    modregGvEv,  cmovnle  ), /* CMOVNLE reg,mem/reg    [0F] [4F] */
00385   // !!! can be memory ?
00386   I( mod_xmm,   modregEdVps,  movmskps ), /* movmskps mem/reg,reg   [0F] [50] */
00387   I( mod_xmm,  modregVpsWps,  sqrtps   ), /* sqrtps   reg,mem/reg   [0F] [51] */
00388   I( mod_xmm,  modregVpsWps,  rsqrtps  ), /* rsqrtps  reg,mem/reg   [0F] [52] */
00389   I( mod_xmm,  modregVpsWps,  rcpps    ), /* rcpps    reg,mem/reg   [0F] [53] */
00390   I( mod_xmm,  modregVpsWps,  andps    ), /* andps    reg,mem/reg   [0F] [54] */
00391   I( mod_xmm,  modregVpsWps,  andnps   ), /* andnps   reg,mem/reg   [0F] [55] */
00392   I( mod_xmm,  modregVpsWps,  orps     ), /* orps     reg,mem/reg   [0F] [56] */
00393   I( mod_xmm,  modregVpsWps,  xorps    ), /* xorps    reg,mem/reg   [0F] [57] */
00394   I( mod_xmm,  modregVpsWps,  addps    ), /* addps    reg,mem/reg   [0F] [58] */
00395   I( mod_xmm,  modregVpsWps,  mulps    ), /* mulps    reg,mem/reg   [0F] [59] */
00396   I( stub,                0,     _     ), /* not used               [0F] [5A] */
00397   I( stub,                0,     _     ), /* not used               [0F] [5B] */
00398   I( mod_xmm,  modregVpsWps,  subps    ), /* subps    reg,mem/reg   [0F] [5C] */
00399   I( mod_xmm,  modregVpsWps,  minps    ), /* minps    reg,mem/reg   [0F] [5D] */
00400   I( mod_xmm,  modregVpsWps,  divps    ), /* divps    reg,mem/reg   [0F] [5E] */
00401   I( mod_xmm,  modregVpsWps,  maxps    ), /* maxps    reg,mem/reg   [0F] [5F] */
00402   I( mod_reg,    modregPqQd, punpcklbw ), /* punpcklbw              [0F] [60] */
00403   I( mod_reg,    modregPqQd, punpcklwd ), /* punpcklwd              [0F] [61] */
00404   I( mod_reg,    modregPqQd, punockldq ), /* punockldq              [0F] [62] */
00405   I( mod_reg,    modregPqQd, packusdw  ), /* packusdw               [0F] [63] */
00406   I( mod_reg,    modregPqQd, pcmpgtb   ), /* pcmpgtb                [0F] [64] */
00407   I( mod_reg,    modregPqQd, pcmpgtw   ), /* pcmpgtw                [0F] [65] */
00408   I( mod_reg,    modregPqQd, pcmpgtd   ), /* pcmpgtd                [0F] [66] */
00409   I( mod_reg,    modregPqQd, packsswb  ), /* packsswb               [0F] [67] */
00410   I( mod_reg,    modregPqQd, punpckhbw ), /* punpckhbw              [0F] [68] */
00411   I( mod_reg,    modregPqQd, punpckhwd ), /* punpckhwd              [0F] [69] */
00412   I( mod_reg,    modregPqQd, punpckhdq ), /* punpckhdq              [0F] [6A] */
00413   I( mod_reg,    modregPqQd, packssdw  ), /* packssdw               [0F] [6B] */
00414   I( stub,                0,     _     ), /* not used               [0F] [6C] */
00415   I( stub,                0,     _     ), /* not used               [0F] [6D] */
00416   I( mod_reg,    modregPdEd, movd      ), /* movd                   [0F] [6E] */
00417   I( mod_reg,    modregPqQq, movq      ), /* movq                   [0F] [6F] */
00418   I( mod_reg_p3, modregPqQqIub,pshufw  ), /* pshufw                 [0F] [70] */
00419   I( groupA,     modregPqIub,    _     ), /* Special (Group A)      [0F] [71] */
00420   I( groupA,     modregPqIub,    _     ), /* Special (Group A)      [0F] [72] */
00421   I( groupA,     modregPqIub,    _     ), /* Special (Group A)      [0F] [73] */
00422   I( mod_reg,    modregPqQd,  pcmpeqb  ), /* pcmpeqb                [0F] [74] */
00423   I( mod_reg,    modregPqQd,  pcmpeqw  ), /* pcmpeqw                [0F] [75] */
00424   I( mod_reg,    modregPqQd,  pcmpeqd  ), /* pcmpeqd                [0F] [76] */
00425   I( one_byte,      regNone,  emms     ), /* EMMS                   [0F] [77] */
00426   // MMX UD (tutti e 6 gli opcode)
00427   I( stub,                0,     _     ), /* not used               [0F] [78] */
00428   I( stub,                0,     _     ), /* not used               [0F] [79] */
00429   I( stub,                0,     _     ), /* not used               [0F] [7A] */
00430   I( stub,                0,     _     ), /* not used               [0F] [7B] */
00431   I( stub,                0,     _     ), /* not used               [0F] [7C] */
00432   I( stub,                0,     _     ), /* not used               [0F] [7D] */
00433   I( mod_reg,    modregEdPd,     movd  ), /* movd                   [0F] [7E] */
00434   I( mod_reg,    modregQqPq,     movq  ), /* movq                   [0F] [7F] */
00435   I( disp16,              0,  jo       ), /* JO       <Label>       [0F] [80] */
00436   I( disp16,              0,  jno      ), /* JNO      <Label>       [0F] [81] */
00437   I( disp16,              0,  jb       ), /* JB       <Label>       [0F] [82] */
00438   I( disp16,              0,  jnb      ), /* JNB      <Label>       [0F] [83] */
00439   I( disp16,              0,  jz       ), /* JO       <Label>       [0F] [84] */
00440   I( disp16,              0,  jnz      ), /* JNO      <Label>       [0F] [85] */
00441   I( disp16,              0,  jbe      ), /* JBE      <Label>       [0F] [86] */
00442   I( disp16,              0,  jnbe     ), /* JNBE     <Label>       [0F] [87] */
00443   I( disp16,              0,  js       ), /* JS       <Label>       [0F] [88] */
00444   I( disp16,              0,  jns      ), /* JNS      <Label>       [0F] [89] */
00445   I( disp16,              0,  jp       ), /* JP       <Label>       [0F] [8A] */
00446   I( disp16,              0,  jnp      ), /* JNP      <Label>       [0F] [8B] */
00447   I( disp16,              0,  jl       ), /* JL       <Label>       [0F] [8C] */
00448   I( disp16,              0,  jnl      ), /* JNL      <Label>       [0F] [8D] */
00449   I( disp16,              0,  jle      ), /* JLE      <Label>       [0F] [8E] */
00450   I( disp16,              0,  jnle     ), /* JNLE     <Label>       [0F] [8F] */
00451   I( mod_reg,      modregEb,  seto     ), /* SETO     mem/reg       [0F] [90] */
00452   I( mod_reg,      modregEb,  setno    ), /* SETNO    mem/reg       [0F] [91] */
00453   I( mod_reg,      modregEb,  setb     ), /* SETB     mem/reg       [0F] [92] */
00454   I( mod_reg,      modregEb,  setnb    ), /* SETNB    mem/reg       [0F] [93] */
00455   I( mod_reg,      modregEb,  setz     ), /* SETZ     mem/reg       [0F] [94] */
00456   I( mod_reg,      modregEb,  setnz    ), /* SETNZ    mem/reg       [0F] [95] */
00457   I( mod_reg,      modregEb,  setbe    ), /* SETNE    mem/reg       [0F] [96] */
00458   I( mod_reg,      modregEb,  setnbe   ), /* SETNBE   mem/reg       [0F] [97] */
00459   I( mod_reg,      modregEb,  sets     ), /* SETS     mem/reg       [0F] [98] */
00460   I( mod_reg,      modregEb,  setns    ), /* SETNS    mem/reg       [0F] [99] */
00461   I( mod_reg,      modregEb,  setp     ), /* SETP     mem/reg       [0F] [9A] */
00462   I( mod_reg,      modregEb,  setnp    ), /* SETNP    mem/reg       [0F] [9B] */
00463   I( mod_reg,      modregEb,  setl     ), /* SETL     mem/reg       [0F] [9C] */
00464   I( mod_reg,      modregEb,  setnl    ), /* SETNL    mem/reg       [0F] [9D] */
00465   I( mod_reg,      modregEb,  setle    ), /* SETLE    mem/reg       [0F] [9E] */
00466   I( mod_reg,      modregEb,  setnle   ), /* SETNLE   mem/reg       [0F] [9F] */
00467   I( one_byte,        regFS,  push     ), /* PUSH FS                [0F] [A0] */
00468   I( one_byte,        regFS,  pop      ), /* POP FS                 [0F] [A1] */
00469   I( one_byte,      regNone,  cpuid    ), /* CPUID                  [0F] [A2] */
00470   I( mod_reg,    modregEvGv,  bt       ), /* BT       mem/reg,reg   [0F] [A3] */
00471   I( mod_reg,  modregEvGvIub, shld     ), /* SHLD     mem,reg,immb  [0F] [A4] */
00472   I( mod_reg,  modregEvGvCL,  shld     ), /* SHLD     mem,reg,cl    [0F] [A5] */
00473   I( stub,                0,     _     ), /* not used               [0F] [A6] */
00474   I( stub,                0,     _     ), /* not used               [0F] [A7] */
00475   I( one_byte,        regGS,  push     ), /* PUSH GS                [0F] [A8] */
00476   I( one_byte,        regGS,  pop      ), /* POP GS                 [0F] [A9] */
00477   I( one_byte,      regNone,  rsm      ), /* RSM                    [0F] [AA] */
00478   I( mod_reg,    modregEvGv,  bts      ), /* BTS      mem/reg,reg   [0F] [AB] */
00479   I( mod_reg,  modregEvGvIub, shrd     ), /* SHRD     mem,reg,immb  [0F] [AC] */
00480   I( mod_reg,  modregEvGvCL,  shrd     ), /* SHRD     mem,reg,cl    [0F] [AD] */
00481   I( group15,             0,     _     ), /* Special (Group 15)     [0F] [AE] */
00482   I( mod_reg,    modregGvEv,  imul     ), /* IMUL     reg,mem/reg   [0F] [AF] */
00483   I( mod_reg,    modregEbGb,  cmpxchg  ), /* CMPXCHG                [0F] [B0] */
00484   I( mod_reg,    modregEvGv,  cmpxchg  ), /* CMPXCHG                [0F] [B1] */
00485   I( mod_reg,    modregGvMp,  lss      ), /* LSS      reg,mem       [0F] [B2] */
00486   I( mod_reg,    modregEvGv,  btr      ), /* BTR      mem/reg,reg   [0F] [B3] */
00487   I( mod_reg,    modregGvMp,  lfs      ), /* LFS      reg,mem       [0F] [B4] */
00488   I( mod_reg,    modregGvMp,  lgs      ), /* LGS      reg,mem       [0F] [B5] */
00489   I( mod_reg,    modregGvEb,  movzx    ), /* MOVZX    reg,mem (b)   [0F] [B6] */
00490   I( mod_reg,    modregGvEw,  movzx    ), /* MOVZX    reg,mem (w)   [0F] [B7] */
00491   I( stub,                0,     _     ), /* not used               [0F] [B8] */
00492 // gruppo 10, gruppo invalido
00493   I( stub,                0,  ud       ), /* ud                     [0F] [B9] */
00494 // !!! unsigned ??
00495   I( group8,    modregEvIub,    _      ), /* Spec. (byte) (Group 8) [0F] [BA] */
00496   I( mod_reg,    modregEvGv,  btc      ), /* BTC      mem/reg,reg   [0F] [BB] */
00497   I( mod_reg,    modregGvEv,  bsf      ), /* BSF      reg,mem/reg   [0F] [BC] */
00498   I( mod_reg,    modregGvEv,  bsr      ), /* BSR      reg,mem/reg   [0F] [BD] */
00499   I( mod_reg,    modregGvEb,  movsx    ), /* MOVSX    reg,mem (b)   [0F] [BE] */
00500   I( mod_reg,    modregGvEw,  movsx    ), /* MOVSX    reg,mem (w)   [0F] [BF] */
00501   I( mod_reg,    modregEbGb,  xadd     ), /* XADD (486 only)        [0F] [C0] */
00502   I( mod_reg,    modregEvGv,  xadd     ), /* XADD (486 only)        [0F] [C1] */
00503   // !!! Ib should be checked, change instruction from Ib codes !!!
00504   I( mod_xmm, modregVpsWpsIub,cmpps    ), /* cmpss reg,mem/reg,immb [0F] [C2] */
00505   I( stub,                0,     _     ), /* not used               [0F] [C3] */
00506 // registro 32 o memoria a 16, cambiato nel codice
00507   I( mod_reg_p3, modregPqEdIub,pinsrw  ), /* pinsrw                 [0F] [C4] */
00508 // in r_m registro mmx, in reg registro intero, eccezione se memoria
00509 // dovrebbe essere GdPqIub forzato in codice
00510   I( mod_reg_p3, modregGdQqIub,pextrw  ), /* pextrw                 [0F] [C5] */
00511   I( mod_xmm, modregVpsWpsIub,shufps   ), /* shufps reg,mem/reg,immb[0F] [C6] */
00512   I( group9,       modregMq,     _     ), /* Special (Group 9)      [0F] [C7] */
00513   I( one_byte,        regAX,  bswap    ), /* BSWAP AX (486 only)    [0F] [C8] */
00514   I( one_byte,        regCX,  bswap    ), /* BSWAP CX (486 only)    [0F] [C9] */
00515   I( one_byte,        regDX,  bswap    ), /* BSWAP DX (486 only)    [0F] [CA] */
00516   I( one_byte,        regBX,  bswap    ), /* BSWAP BX (486 only)    [0F] [CB] */
00517   I( one_byte,        regSP,  bswap    ), /* BSWAP SP (486 only)    [0F] [CC] */
00518   I( one_byte,        regBP,  bswap    ), /* BSWAP BP (486 only)    [0F] [CD] */
00519   I( one_byte,        regSI,  bswap    ), /* BSWAP SI (486 only)    [0F] [CE] */
00520   I( one_byte,        regDI,  bswap    ), /* BSWAP DI (486 only)    [0F] [CF] */
00521   I( stub,                0,     _     ), /* not used               [0F] [D0] */
00522   I( mod_reg,    modregPqQd,     psrlw ), /* psrlw                  [0F] [D1] */
00523   I( mod_reg,    modregPqQd,     psrld ), /* psrld                  [0F] [D2] */
00524   I( mod_reg,    modregPqQd,     psrlq ), /* psrlq                  [0F] [D3] */
00525   I( stub,                0,     _     ), /* not used               [0F] [D4] */
00526   I( mod_reg,    modregPqQd,    pmullw ), /* pmullw                 [0F] [D5] */
00527   I( stub,                0,     _     ), /* not used               [0F] [D6] */
00528 // in r_m registro mmx, in reg registro intero, eccezione se memoria
00529 // dovrebbe essere GdPq , fissato in codice
00530   I( mod_reg_p3, modregGdQq,  pmovmskb ), /* pmovmskb               [0F] [D7] */
00531   I( mod_reg,    modregPqQq,   psubusb ), /* psubusb                [0F] [D8] */
00532   I( mod_reg,    modregPqQq,   psubusw ), /* psubusw                [0F] [D9] */
00533   I( mod_reg_p3, modregPqQq,   pminub  ), /* pminub                 [0F] [DA] */
00534   I( mod_reg,    modregPqQq,   pand    ), /* pand                   [0F] [DB] */
00535   I( mod_reg,    modregPqQq,   paddusb ), /* paddusb                [0F] [DC] */
00536   I( mod_reg,    modregPqQq,   paddusw ), /* paddusw                [0F] [DD] */
00537   I( mod_reg_p3, modregPqQq,   pmaxub  ), /* pmaxub                 [0F] [DE] */
00538   I( mod_reg,    modregPqQq,   pandn   ), /* pandn                  [0F] [DF] */
00539   I( mod_reg_p3, modregPqQq,   pavgb   ), /* pavgb                  [0F] [E0] */
00540   I( mod_reg,    modregPqQd,   psraw   ), /* psraw                  [0F] [E1] */
00541   I( mod_reg,    modregPqQd,   psrad   ), /* psrad                  [0F] [E2] */
00542   I( mod_reg_p3, modregPqQq,   pavgw   ), /* pavgw                  [0F] [E3] */
00543   I( mod_reg_p3, modregPqQq,   pmulhuw ), /* pmulhuw                [0F] [E4] */
00544   I( mod_reg,    modregPqQd,   pmulhw  ), /* pmulhw                 [0F] [E5] */
00545   I( stub,                0,     _     ), /* not used               [0F] [E6] */
00546   I( mod_reg_p3, modregQqPq,   movntq  ), /* movntq                 [0F] [E7] */
00547   I( mod_reg,    modregPqQq,    psubsb ), /* psubsb                 [0F] [E8] */
00548   I( mod_reg,    modregPqQq,    psubsw ), /* psubsw                 [0F] [E9] */
00549   I( mod_reg_p3, modregPqQq,    pminsw ), /* pminsw                 [0F] [EA] */
00550   I( mod_reg,    modregPqQq,    por    ), /* por                    [0F] [EB] */
00551   I( mod_reg,    modregPqQq,    paddsb ), /* paddsb                 [0F] [EC] */
00552   I( mod_reg,    modregPqQq,    paddsw ), /* paddsw                 [0F] [ED] */
00553   I( mod_reg_p3, modregPqQq,    pmaxsw ), /* pmaxsw                 [0F] [EE] */
00554   I( mod_reg,    modregPqQq,    pxor   ), /* pxor                   [0F] [EF] */
00555   I( stub,                0,     _     ), /* not used               [0F] [F0] */
00556   I( mod_reg,    modregPqQd,   psllw   ), /* psllw                  [0F] [F1] */
00557   I( mod_reg,    modregPqQd,   pslld   ), /* pslld                  [0F] [F2] */
00558   I( mod_reg,    modregPqQd,   psllq   ), /* psllq                  [0F] [F3] */
00559   I( stub,                0,     _     ), /* not used               [0F] [F4] */
00560   I( mod_reg,    modregPqQd,   pmaddwd ), /* pmaddwd                [0F] [F5] */
00561   I( mod_reg_p3, modregPqQq,   psadbw  ), /* psadbw                 [0F] [F6] */
00562 // reg = destination, r/m = source, eccezione se memoria
00563 // dovrebbe essere PpiQpi, test in codice
00564   I( mod_reg_p3, modregPqQq,  maskmovq ), /* maskmovq               [0F] [F7] */
00565   I( mod_reg,    modregPqQq,     psubb ), /* psubb                  [0F] [F8] */
00566   I( mod_reg,    modregPqQq,     psubw ), /* psubw                  [0F] [F9] */
00567   I( mod_reg,    modregPqQq,     psubd ), /* psubd                  [0F] [FA] */
00568   I( stub,                0,     _     ), /* not used               [0F] [FB] */
00569   I( mod_reg,    modregPqQq,     paddb ), /* paddb                  [0F] [FC] */
00570   I( mod_reg,    modregPqQq,     paddw ), /* paddw                  [0F] [FD] */
00571   I( mod_reg,    modregPqQq,     paddd ), /* paddd                  [0F] [FE] */
00572   I( stub,                0,     _     )  /* not used               [0F] [FF] */
00573 #undef I
00574 };
00575 
00576 inline void InstructionDecoder::CheckTables()
00577 {
00578   // produce a warning on some compiler, ignore it
00579   COMPILE_CHECK(instrLenCheck,
00580     (sizeof(InstructionDecoder::instrTable) == (sizeof(InstructionDecoder::instrTable[0])*256))
00581     && (sizeof(InstructionDecoder::exInstrTable) == (sizeof(InstructionDecoder::exInstrTable[0])*256))
00582   );
00583 }
00584 
00585 COMPILE_CHECK(intSizeCheck,
00586   (sizeof(int) >= 4) && (num_instructions <= (1<<23))
00587 );
00588 
00589 int esc_inst[] = {
00590   DEFINE_FPI(istr_fadd,fpiTypeSingle),          /* FADD   (DWord Ptr) [00] */
00591   DEFINE_FPI(istr_fmul,fpiTypeSingle),          /* FMUL   (DWord Ptr) [01] */
00592   DEFINE_FPI(istr_fcom,fpiTypeSingle),          /* FCOM   (DWord Ptr) [02] */
00593   DEFINE_FPI(istr_fcomp,fpiTypeSingle),         /* FCOMP  (DWord Ptr) [03] */
00594   DEFINE_FPI(istr_fsub,fpiTypeSingle),          /* FSUB   (DWord Ptr) [04] */
00595   DEFINE_FPI(istr_fsubr,fpiTypeSingle),         /* FSUBR  (DWord Ptr) [05] */
00596   DEFINE_FPI(istr_fdiv,fpiTypeSingle),          /* FDIV   (DWord Ptr) [06] */
00597   DEFINE_FPI(istr_fdivr,fpiTypeSingle),         /* FDIVR  (DWord Ptr) [07] */
00598 
00599   DEFINE_FPI(istr_fld,fpiTypeSingle),           /* FLD    (DWord Ptr) [08] */
00600   DEFINE_FPI(-1,0),                             /* ESC 09h            [09] */
00601   DEFINE_FPI(istr_fst,fpiTypeSingle),           /* FST    (DWord Ptr) [0A] */
00602   DEFINE_FPI(istr_fstp,fpiTypeSingle),          /* FSTP   (DWord Ptr) [0B] */
00603   DEFINE_FPI(istr_fldenv,fpiTypeEnv),           /* FLDENV             [0C] */
00604   DEFINE_FPI(istr_fldcw,fpiTypeWord),           /* FLDCW              [0D] */
00605   DEFINE_FPI(istr_fnstenv,fpiTypeEnv),          /* FSTENV             [0E] */
00606   DEFINE_FPI(istr_fnstcw,fpiTypeWord),          /* FSTCW              [0F] */
00607 
00608   DEFINE_FPI(istr_fiadd,fpiTypeSInt),           /* FIADD  (DWord Ptr) [10] */
00609   DEFINE_FPI(istr_fimul,fpiTypeSInt),           /* FIMUL  (DWord Ptr) [11] */
00610   DEFINE_FPI(istr_ficom,fpiTypeSInt),           /* FICOM  (DWord Ptr) [12] */
00611   DEFINE_FPI(istr_ficomp,fpiTypeSInt),          /* FICOMP (DWord Ptr) [13] */
00612   DEFINE_FPI(istr_fisub,fpiTypeSInt),           /* FISUB  (DWord Ptr) [14] */
00613   DEFINE_FPI(istr_fisubr,fpiTypeSInt),          /* FISUBR (DWord Ptr) [15] */
00614   DEFINE_FPI(istr_fidiv,fpiTypeSInt),           /* FIDIV  (DWord Ptr) [16] */
00615   DEFINE_FPI(istr_fidivr,fpiTypeSInt),          /* FIDIVR (DWord Ptr) [17] */
00616 
00617   DEFINE_FPI(istr_fild,fpiTypeSInt),            /* FILD   (DWord Ptr) [18] */
00618   DEFINE_FPI(-1,0),                             /* ESC 19h            [19] */
00619   DEFINE_FPI(istr_fist,fpiTypeSInt),            /* FIST   (DWord Ptr) [1A] */
00620   DEFINE_FPI(istr_fistp,fpiTypeSInt),           /* FISTP  (DWord Ptr) [1B] */
00621   DEFINE_FPI(-1,0),                             /* ESC 1Ch            [1C] */
00622   DEFINE_FPI(istr_fld,fpiTypeExtended),         /* FLD    (TByte Ptr) [1D] */
00623   DEFINE_FPI(-1,0),                             /* ESC 1Eh            [1E] */
00624   DEFINE_FPI(istr_fstp,fpiTypeExtended),        /* FSTP   (TByte Ptr) [1F] */
00625 
00626   DEFINE_FPI(istr_fadd,fpiTypeDouble),          /* FADD   (QWord Ptr) [20] */
00627   DEFINE_FPI(istr_fmul,fpiTypeDouble),          /* FMUL   (QWord Ptr) [21] */
00628   DEFINE_FPI(istr_fcom,fpiTypeDouble),          /* FCOM   (QWord Ptr) [22] */
00629   DEFINE_FPI(istr_fcomp,fpiTypeDouble),         /* FCOMP  (QWord Ptr) [23] */
00630   DEFINE_FPI(istr_fsub,fpiTypeDouble),          /* FSUB   (QWord Ptr) [24] */
00631   DEFINE_FPI(istr_fsubr,fpiTypeDouble),         /* FSUBR  (QWord Ptr) [25] */
00632   DEFINE_FPI(istr_fdiv,fpiTypeDouble),          /* FDIV   (QWord Ptr) [26] */
00633   DEFINE_FPI(istr_fdivr,fpiTypeDouble),         /* FDIVR  (QWord Ptr) [27] */
00634 
00635   DEFINE_FPI(istr_fld,fpiTypeDouble),           /* FLD    (QWord Ptr) [28] */
00636   DEFINE_FPI(-1,0),                             /* ESC 29h            [29] */
00637   DEFINE_FPI(istr_fst,fpiTypeDouble),           /* FST    (QWord Ptr) [2A] */
00638   DEFINE_FPI(istr_fstp,fpiTypeDouble),          /* FSTP   (QWord Ptr) [2B] */
00639   DEFINE_FPI(istr_frstor,fpiTypeStatus),        /* FRSTOR             [2C] */
00640   DEFINE_FPI(-1,0),                             /* ESC 2Dh            [2D] */
00641   DEFINE_FPI(istr_fnsave,fpiTypeStatus),        /* FSAVE              [2E] */
00642   DEFINE_FPI(istr_fnstsw,fpiTypeWord),          /* FSTSW              [2F] */
00643 
00644   DEFINE_FPI(istr_fiadd,fpiTypeWInt),           /* FIADD  (Word Ptr)  [30] */
00645   DEFINE_FPI(istr_fimul,fpiTypeWInt),           /* FIMUL  (Word Ptr)  [31] */
00646   DEFINE_FPI(istr_ficom,fpiTypeWInt),           /* FICOM  (Word Ptr)  [32] */
00647   DEFINE_FPI(istr_ficomp,fpiTypeWInt),          /* FICOMP (Word Ptr)  [33] */
00648   DEFINE_FPI(istr_fisub,fpiTypeWInt),           /* FISUB  (Word Ptr)  [34] */
00649   DEFINE_FPI(istr_fisubr,fpiTypeWInt),          /* FISUBR (Word Ptr)  [35] */
00650   DEFINE_FPI(istr_fidiv,fpiTypeWInt),           /* FIDIV  (Word Ptr)  [36] */
00651   DEFINE_FPI(istr_fidivr,fpiTypeWInt),          /* FIDIVR (Word Ptr)  [37] */
00652 
00653   DEFINE_FPI(istr_fild,fpiTypeWInt),            /* FILD   (Word Ptr)  [38] */
00654   DEFINE_FPI(-1,0),                             /* ESC 39h            [39] */
00655   DEFINE_FPI(istr_fist,fpiTypeWInt),            /* FIST   (Word Ptr)  [3A] */
00656   DEFINE_FPI(istr_fistp,fpiTypeWInt),           /* FISTP  (Word Ptr)  [3B] */
00657   DEFINE_FPI(istr_fbld,fpiTypeBCD),             /* FBLD   (TByte Ptr) [3C] */
00658   DEFINE_FPI(istr_fild,fpiTypeLInt),            /* FILD   (QWord Ptr) [3D] */
00659   DEFINE_FPI(istr_fbstp,fpiTypeBCD),            /* FBSTP  (TWord Ptr) [3E] */
00660   DEFINE_FPI(istr_fistp,fpiTypeLInt)            /* FISTP  (QWord Ptr) [3F] */
00661 };
00662 COMPILE_CHECK(escInstrLenCheck,
00663   sizeof(esc_inst) == (sizeof(esc_inst[0])*64)
00664 );
00665 
00666 enum EscSpecial
00667 {
00668   escS_d9d0, escS_d9e0, escS_d9e8, escS_d9f0,
00669   escS_d9f8, escS_dae8, escS_dbe0, escS_ded8,
00670   escS_dfe0
00671 };
00672 
00673 int esc_inst_mod3[] = {
00674   DEFINE_FPIM3(istr_fadd,fpiParamStStN),    /* FADD  (DWord Ptr)  [D8] [C0] */
00675   DEFINE_FPIM3(istr_fmul,fpiParamStStN),    /* FMUL  (DWord Ptr)  [D8] [C8] */
00676   DEFINE_FPIM3(istr_fcom,fpiParamStStN),    /* FCOM  (DWord Ptr)  [D8] [D0] */
00677   DEFINE_FPIM3(istr_fcomp,fpiParamStStN),   /* FCOMP (DWord Ptr)  [D8] [D8] */
00678   DEFINE_FPIM3(istr_fsub,fpiParamStStN),    /* FSUB  (DWord Ptr)  [D8] [E0] */
00679   DEFINE_FPIM3(istr_fsubr,fpiParamStStN),   /* FSUBR (DWord Ptr)  [D8] [E8] */
00680   DEFINE_FPIM3(istr_fdiv,fpiParamStStN),    /* FDIV  (DWord Ptr)  [D8] [F0] */
00681   DEFINE_FPIM3(istr_fdivr,fpiParamStStN),   /* FDIVR (DWord Ptr)  [D8] [F8] */
00682 
00683   DEFINE_FPIM3(istr_fld,fpiParamStN),       /* FLD  (DWord Ptr)   [D9] [C0] */
00684   DEFINE_FPIM3(istr_fxch,fpiParamStN),      /* FXCH               [D9] [C8] */
00685   DEFINE_FPIM3(escS_d9d0,fpiParamNone),     /*                    [D9] [D0] */
00686   DEFINE_FPIM3(istr_fstp,fpiParamStN),      /*                    [D9] [D8] */
00687   DEFINE_FPIM3(escS_d9e0,fpiParamNone),     /*                    [D9] [E0] */
00688   DEFINE_FPIM3(escS_d9e8,fpiParamNone),     /*                    [D9] [E8] */
00689   DEFINE_FPIM3(escS_d9f0,fpiParamNone),     /*                    [D9] [F0] */
00690   DEFINE_FPIM3(escS_d9f8,fpiParamNone),     /*                    [D9] [F8] */
00691 
00692   DEFINE_FPIM3(istr_fcmovb,fpiParamStStN),  /*                    [DA] [C0] */
00693   DEFINE_FPIM3(istr_fcmove,fpiParamStStN),  /*                    [DA] [C8] */
00694   DEFINE_FPIM3(istr_fcmovbe,fpiParamStStN), /*                    [DA] [D0] */
00695   DEFINE_FPIM3(istr_fcmovu,fpiParamStStN),  /*                    [DA] [D8] */
00696   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DA] [E0] */
00697   DEFINE_FPIM3(escS_dae8,fpiParamNone),     /*                    [DA] [E8] */
00698   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DA] [F0] */
00699   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DA] [F8] */
00700 
00701   DEFINE_FPIM3(istr_fcmovnb,fpiParamStStN), /*                    [DB] [C0] */
00702   DEFINE_FPIM3(istr_fcmovne,fpiParamStStN), /*                    [DB] [C8] */
00703   DEFINE_FPIM3(istr_fcmovnbe,fpiParamStStN),/*                    [DB] [D0] */
00704   DEFINE_FPIM3(istr_fcmovnu,fpiParamStStN), /*                    [DB] [D8] */
00705   DEFINE_FPIM3(escS_dbe0,fpiParamNone),     /*                    [DB] [E0] */
00706   DEFINE_FPIM3(istr_fucomi,fpiParamStStN),  /*                    [DB] [E8] */
00707   DEFINE_FPIM3(istr_fcomi,fpiParamStStN),   /*                    [DB] [F0] */
00708   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DB] [F8] */
00709 
00710   DEFINE_FPIM3(istr_fadd,fpiParamStNSt),    /* FADD (QWord Ptr)   [DC] [C0] */
00711   DEFINE_FPIM3(istr_fmul,fpiParamStNSt),    /* FMUL (QWord Ptr)   [DC] [C8] */
00712   DEFINE_FPIM3(istr_fcom,fpiParamStN),      /*                    [DC] [D0] */
00713   DEFINE_FPIM3(istr_fcomp,fpiParamStN),     /*                    [DC] [D8] */
00714   DEFINE_FPIM3(istr_fsubr,fpiParamStNSt),   /* FSUBR(QWord Ptr)   [DC] [E0] */
00715   DEFINE_FPIM3(istr_fsub,fpiParamStNSt),    /* FSUB  (QWord Ptr)  [DC] [E8] */
00716   DEFINE_FPIM3(istr_fdivr,fpiParamStNSt),   /* FDIVR(QWord Ptr)   [DC] [F0] */
00717   DEFINE_FPIM3(istr_fdiv,fpiParamStNSt),    /* FDIV  (QWord Ptr)  [DC] [F8] */
00718 
00719   DEFINE_FPIM3(istr_ffree,fpiParamStN),     /* FLD                [DD] [C0] */
00720   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DD] [C8] */
00721   DEFINE_FPIM3(istr_fst,fpiParamStN),       /* FST                [DD] [D0] */
00722   DEFINE_FPIM3(istr_fstp,fpiParamStN),      /* FSTP               [DD] [D8] */
00723   DEFINE_FPIM3(istr_fucom,fpiParamStNSt),   /*                    [DD] [E0] */
00724   DEFINE_FPIM3(istr_fucomp,fpiParamStN),    /*                    [DD] [E8] */
00725   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DD] [F0] */
00726   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DD] [F8] */
00727 
00728   DEFINE_FPIM3(istr_faddp,fpiParamStNSt),   /* FADDP              [DE] [C0] */
00729   DEFINE_FPIM3(istr_fmulp,fpiParamStNSt),   /* FMULP              [DE] [C8] */
00730   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DE] [D0] */
00731   DEFINE_FPIM3(escS_ded8,fpiParamNone),     /*                    [DE] [D8] */
00732   DEFINE_FPIM3(istr_fsubrp,fpiParamStNSt),  /* FSUBRP             [DE] [E0] */
00733   DEFINE_FPIM3(istr_fsubp,fpiParamStNSt),   /* FSUBP              [DE] [E8] */
00734   DEFINE_FPIM3(istr_fdivrp,fpiParamStNSt),  /* FDIVRP             [DE] [F0] */
00735   DEFINE_FPIM3(istr_fdivp,fpiParamStNSt),   /* FDIVP              [DE] [F8] */
00736 
00737   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DF] [C0] */
00738   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DF] [C8] */
00739   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DF] [D0] */
00740   DEFINE_FPIM3(-1,fpiParamNone),            /*                    [DF] [D8] */
00741   DEFINE_FPIM3(escS_dfe0,fpiParamNone),     /*                    [DF] [E0] */
00742   DEFINE_FPIM3(istr_fucomip,fpiParamStStN), /*                    [DF] [E8] */
00743   DEFINE_FPIM3(istr_fcomip,fpiParamStStN),  /*                    [DF] [F0] */
00744   DEFINE_FPIM3(-1,fpiParamNone)             /*                    [DF] [F8] */
00745 };
00746 
00747 #define ESCSPECIAL(index,i1,i2,i3,i4,i5,i6,i7,i8) \
00748   { istr_##i1, istr_##i2, istr_##i3, istr_##i4, \
00749     istr_##i5, istr_##i6, istr_##i7, istr_##i8 }
00750 int esc_inst_special[][8] =
00751 {
00752   ESCSPECIAL(d9d0,fnop, _,       _,     _,      _,      _,     _,      _),
00753   ESCSPECIAL(d9e0,fchs, fabs,    _,     _,      ftst,   fxam,  _,      _),
00754   ESCSPECIAL(d9e8,fldl, fldl2t,  fldl2e,fldpi,  fldlg2, fldln2,fldz,   _),
00755   ESCSPECIAL(d9f0,f2xm1,fyl2x,   fptan, fpatan, fxtract,fpreml,fdecstp,fincstp),
00756   ESCSPECIAL(d9f8,fprem,fyl2xpl, fsqrt, fsincos,frndint,fscale,fsin,   fcos),
00757   ESCSPECIAL(dae8,_,    fucompuu,_,     _,      _,      _,     _,      _),
00758   ESCSPECIAL(dbe0,feni, fdisi,   fclex, finit,  fsetpm, _,     _,      _),
00759   ESCSPECIAL(ded8,_,    fcompp,  _,     _,      _,      _,     _,      _),
00760   ESCSPECIAL(dfe0,fstsw,_,       _,     _,      _,      _,     _,      _)
00761 };
00762 
00763 INST_3DNOW  k6_3DNow_instr[] = {
00764   {    -1        },  // [00]
00765   {    -1        },  // [01]
00766   {    -1        },  // [02]
00767   {    -1        },  // [03]
00768   {    -1        },  // [04]
00769   {    -1        },  // [05]
00770   {    -1        },  // [06]
00771   {    -1        },  // [07]
00772   {    -1        },  // [08]
00773   {    -1        },  // [09]
00774   {    -1        },  // [0A]
00775   {    -1        },  // [0B]
00776   { istr_pi2fw   },  // [0C]
00777   { istr_pi2fd   },  // [0D]
00778   {    -1        },  // [0E]
00779   {    -1        },  // [0F]
00780   {    -1        },  // [10]
00781   {    -1        },  // [11]
00782   {    -1        },  // [12]
00783   {    -1        },  // [13]
00784   {    -1        },  // [14]
00785   {    -1        },  // [15]
00786   {    -1        },  // [16]
00787   {    -1        },  // [17]
00788   {    -1        },  // [18]
00789   {    -1        },  // [19]
00790   {    -1        },  // [1A]
00791   {    -1        },  // [1B]
00792   { istr_pf2iw   },  // [1C]
00793   { istr_pf2id   },  // [1D]
00794   {    -1        },  // [1E]
00795   {    -1        },  // [1F]
00796   {    -1        },  // [20]
00797   {    -1        },  // [21]
00798   {    -1        },  // [22]
00799   {    -1        },  // [23]
00800   {    -1        },  // [24]
00801   {    -1        },  // [25]
00802   {    -1        },  // [26]
00803   {    -1        },  // [27]
00804   {    -1        },  // [28]
00805   {    -1        },  // [29]
00806   {    -1        },  // [2A]
00807   {    -1        },  // [2B]
00808   {    -1        },  // [2C]
00809   {    -1        },  // [2D]
00810   {    -1        },  // [2E]
00811   {    -1        },  // [2F]
00812   {    -1        },  // [30]
00813   {    -1        },  // [31]
00814   {    -1        },  // [32]
00815   {    -1        },  // [33]
00816   {    -1        },  // [34]
00817   {    -1        },  // [35]
00818   {    -1        },  // [36]
00819   {    -1        },  // [37]
00820   {    -1        },  // [38]
00821   {    -1        },  // [39]
00822   {    -1        },  // [3A]
00823   {    -1        },  // [3B]
00824   {    -1        },  // [3C]
00825   {    -1        },  // [3D]
00826   {    -1        },  // [3E]
00827   {    -1        },  // [3F]
00828   {    -1        },  // [40]
00829   {    -1        },  // [41]
00830   {    -1        },  // [42]
00831   {    -1        },  // [43]
00832   {    -1        },  // [44]
00833   {    -1        },  // [45]
00834   {    -1        },  // [46]
00835   {    -1        },  // [47]
00836   {    -1        },  // [48]
00837   {    -1        },  // [49]
00838   {    -1        },  // [4A]
00839   {    -1        },  // [4B]
00840   {    -1        },  // [4C]
00841   {    -1        },  // [4D]
00842   {    -1        },  // [4E]
00843   {    -1        },  // [4F]
00844   {    -1        },  // [50]
00845   {    -1        },  // [51]
00846   {    -1        },  // [52]
00847   {    -1        },  // [53]
00848   {    -1        },  // [54]
00849   {    -1        },  // [55]
00850   {    -1        },  // [56]
00851   {    -1        },  // [57]
00852   {    -1        },  // [58]
00853   {    -1        },  // [59]
00854   {    -1        },  // [5A]
00855   {    -1        },  // [5B]
00856   {    -1        },  // [5C]
00857   {    -1        },  // [5D]
00858   {    -1        },  // [5E]
00859   {    -1        },  // [5F]
00860   {    -1        },  // [60]
00861   {    -1        },  // [61]
00862   {    -1        },  // [62]
00863   {    -1        },  // [63]
00864   {    -1        },  // [64]
00865   {    -1        },  // [65]
00866   {    -1        },  // [66]
00867   {    -1        },  // [67]
00868   {    -1        },  // [68]
00869   {    -1        },  // [69]
00870   {    -1        },  // [6A]
00871   {    -1        },  // [6B]
00872   {    -1        },  // [6C]
00873   {    -1        },  // [6D]
00874   {    -1        },  // [6E]
00875   {    -1        },  // [6F]
00876   {    -1        },  // [70]
00877   {    -1        },  // [71]
00878   {    -1        },  // [72]
00879   {    -1        },  // [73]
00880   {    -1        },  // [74]
00881   {    -1        },  // [75]
00882   {    -1        },  // [76]
00883   {    -1        },  // [77]
00884   {    -1        },  // [78]
00885   {    -1        },  // [79]
00886   {    -1        },  // [7A]
00887   {    -1        },  // [7B]
00888   {    -1        },  // [7C]
00889   {    -1        },  // [7D]
00890   {    -1        },  // [7E]
00891   {    -1        },  // [7F]
00892   {    -1        },  // [80]
00893   {    -1        },  // [81]
00894   {    -1        },  // [82]
00895   {    -1        },  // [83]
00896   {    -1        },  // [84]
00897   {    -1        },  // [85]
00898   {    -1        },  // [86]
00899   {    -1        },  // [87]
00900   {    -1        },  // [88]
00901   {    -1        },  // [89]
00902   { istr_pfnacc  },  // [8A]
00903   {    -1        },  // [8B]
00904   {    -1        },  // [8C]
00905   {    -1        },  // [8D]
00906   { istr_pfpnacc },  // [8E]
00907   {    -1        },  // [8F]
00908   { istr_pfcmpge },  // [90]
00909   {    -1        },  // [91]
00910   {    -1        },  // [92]
00911   {    -1        },  // [93]
00912   { istr_pfmin   },  // [94]
00913   {    -1        },  // [95]
00914   { istr_pfrcp   },  // [96]
00915   { istr_pfrsqrt },  // [97]
00916   {    -1        },  // [98]
00917   {    -1        },  // [99]
00918   { istr_pfsub   },  // [9A]
00919   {    -1        },  // [9B]
00920   {    -1        },  // [9C]
00921   {    -1        },  // [9D]
00922   { istr_pfadd   },  // [9E]
00923   {    -1        },  // [9F]
00924   { istr_pfcmpgt },  // [A0]
00925   {    -1        },  // [A1]
00926   {    -1        },  // [A2]
00927   {    -1        },  // [A3]
00928   { istr_pfmax   },  // [A4]
00929   {    -1        },  // [A5]
00930   { istr_pfrcpit1},  // [A6]
00931   { istr_pfrsqit1},  // [A7]
00932   {    -1        },  // [A8]
00933   {    -1        },  // [A9]
00934   { istr_pfsubr  },  // [AA]
00935   {    -1        },  // [AB]
00936   {    -1        },  // [AC]
00937   {    -1        },  // [AD]
00938   { istr_pfacc   },  // [AE]
00939   {    -1        },  // [AF]
00940   { istr_pfcmpeq },  // [B0]
00941   {    -1        },  // [B1]
00942   {    -1        },  // [B2]
00943   {    -1        },  // [B3]
00944   { istr_pfmul   },  // [B4]
00945   {    -1        },  // [B5]
00946   { istr_pfrcpit2},  // [B6]
00947   { istr_pmulhrw },  // [B7]
00948   {    -1        },  // [B8]
00949   {    -1        },  // [B9]
00950   {    -1        },  // [BA]
00951   { istr_pswapd  },  // [BB]
00952   {    -1        },  // [BC]
00953   {    -1        },  // [BD]
00954   {    -1        },  // [BE]
00955   { istr_pavgusb },  // [BF]
00956   {    -1        },  // [C0]
00957   {    -1        },  // [C1]
00958   {    -1        },  // [C2]
00959   {    -1        },  // [C3]
00960   {    -1        },  // [C4]
00961   {    -1        },  // [C5]
00962   {    -1        },  // [C6]
00963   {    -1        },  // [C7]
00964   {    -1        },  // [C8]
00965   {    -1        },  // [C9]
00966   {    -1        },  // [CA]
00967   {    -1        },  // [CB]
00968   {    -1        },  // [CC]
00969   {    -1        },  // [CD]
00970   {    -1        },  // [CE]
00971   {    -1        },  // [CF]
00972   {    -1        },  // [D0]
00973   {    -1        },  // [D1]
00974   {    -1        },  // [D2]
00975   {    -1        },  // [D3]
00976   {    -1        },  // [D4]
00977   {    -1        },  // [D5]
00978   {    -1        },  // [D6]
00979   {    -1        },  // [D7]
00980   {    -1        },  // [D8]
00981   {    -1        },  // [D9]
00982   {    -1        },  // [DA]
00983   {    -1        },  // [DB]
00984   {    -1        },  // [DC]
00985   {    -1        },  // [DD]
00986   {    -1        },  // [DE]
00987   {    -1        },  // [DF]
00988   {    -1        },  // [E0]
00989   {    -1        },  // [E1]
00990   {    -1        },  // [E2]
00991   {    -1        },  // [E3]
00992   {    -1        },  // [E4]
00993   {    -1        },  // [E5]
00994   {    -1        },  // [E6]
00995   {    -1        },  // [E7]
00996   {    -1        },  // [E8]
00997   {    -1        },  // [E9]
00998   {    -1        },  // [EA]
00999   {    -1        },  // [EB]
01000   {    -1        },  // [EC]
01001   {    -1        },  // [ED]
01002   {    -1        },  // [EE]
01003   {    -1        },  // [EF]
01004   {    -1        },  // [F0]
01005   {    -1        },  // [F1]
01006   {    -1        },  // [F2]
01007   {    -1        },  // [F3]
01008   {    -1        },  // [F4]
01009   {    -1        },  // [F5]
01010   {    -1        },  // [F6]
01011   {    -1        },  // [F7]
01012   {    -1        },  // [F8]
01013   {    -1        },  // [F9]
01014   {    -1        },  // [FA]
01015   {    -1        },  // [FB]
01016   {    -1        },  // [FC]
01017   {    -1        },  // [FD]
01018   {    -1        },  // [FE]
01019   {    -1        }   // [FF]
01020 };
01021 
01022 COMPILE_CHECK(k6_3dInstrLenCheck,
01023   sizeof(k6_3DNow_instr) == (sizeof(k6_3DNow_instr[0])*256)
01024 );
01025 
01026 INST_F3XMM f3Xmm_instr[] = {
01027 #define F3OFF_NULL 0
01028   { 0, -1 },
01029 #define F3OFF_10 1
01030   { modregVssWss, istr_movss },
01031 #define F3OFF_11 2
01032   { modregWssVss, istr_movss },
01033 #define F3OFF_51 3
01034   { modregVssWss, istr_sqrtss },
01035 #define F3OFF_52 4
01036   { modregVssWss, istr_rsqrtss },
01037 #define F3OFF_53 5
01038   { modregVssWss, istr_rcpss },
01039 #define F3OFF_C2 6
01040   { modregVssWssIub, istr_cmpss },
01041 #define F3OFF_2A 7
01042   { modregVssEd, istr_cvtsi2ss },
01043 #define F3OFF_2C 8
01044   { modregGdWss, istr_cvttss2si },
01045 #define F3OFF_2D 9
01046   { modregGdWss, istr_cvtss2si },
01047 #define F3OFF_58 10
01048   { modregVssWss, istr_addss },
01049 #define F3OFF_59 11
01050   { modregVssWss, istr_mulss },
01051 #define F3OFF_5C 12
01052   { modregVssWss, istr_subss },
01053 #define F3OFF_5D 13
01054   { modregVssWss, istr_minss },
01055 #define F3OFF_5E 14
01056   { modregVssWss, istr_divss },
01057 #define F3OFF_5F 15
01058   { modregVssWss, istr_maxss },
01059 };
01060 
01061 // do not waste memory
01062 uchar f3Xmm_offsets[] = {
01063   { F3OFF_NULL },  // [00]
01064   { F3OFF_NULL },  // [01]
01065   { F3OFF_NULL },  // [02]
01066   { F3OFF_NULL },  // [03]
01067   { F3OFF_NULL },  // [04]
01068   { F3OFF_NULL },  // [05]
01069   { F3OFF_NULL },  // [06]
01070   { F3OFF_NULL },  // [07]
01071   { F3OFF_NULL },  // [08]
01072   { F3OFF_NULL },  // [09]
01073   { F3OFF_NULL },  // [0A]
01074   { F3OFF_NULL },  // [0B]
01075   { F3OFF_NULL },  // [0C]
01076   { F3OFF_NULL },  // [0D]
01077   { F3OFF_NULL },  // [0E]
01078   { F3OFF_NULL },  // [0F]
01079   { F3OFF_10   },  // [10]
01080   { F3OFF_11   },  // [11]
01081   { F3OFF_NULL },  // [12]
01082   { F3OFF_NULL },  // [13]
01083   { F3OFF_NULL },  // [14]
01084   { F3OFF_NULL },  // [15]
01085   { F3OFF_NULL },  // [16]
01086   { F3OFF_NULL },  // [17]
01087   { F3OFF_NULL },  // [18]
01088   { F3OFF_NULL },  // [19]
01089   { F3OFF_NULL },  // [1A]
01090   { F3OFF_NULL },  // [1B]
01091   { F3OFF_NULL },  // [1C]
01092   { F3OFF_NULL },  // [1D]
01093   { F3OFF_NULL },  // [1E]
01094   { F3OFF_NULL },  // [1F]
01095   { F3OFF_NULL },  // [20]
01096   { F3OFF_NULL },  // [21]
01097   { F3OFF_NULL },  // [22]
01098   { F3OFF_NULL },  // [23]
01099   { F3OFF_NULL },  // [24]
01100   { F3OFF_NULL },  // [25]
01101   { F3OFF_NULL },  // [26]
01102   { F3OFF_NULL },  // [27]
01103   { F3OFF_NULL },  // [28]
01104   { F3OFF_NULL },  // [29]
01105   { F3OFF_2A   },  // [2A]
01106   { F3OFF_NULL },  // [2B]
01107   { F3OFF_2C   },  // [2C]
01108   { F3OFF_2D   },  // [2D]
01109   { F3OFF_NULL },  // [2E]
01110   { F3OFF_NULL },  // [2F]
01111   { F3OFF_NULL },  // [30]
01112   { F3OFF_NULL },  // [31]
01113   { F3OFF_NULL },  // [32]
01114   { F3OFF_NULL },  // [33]
01115   { F3OFF_NULL },  // [34]
01116   { F3OFF_NULL },  // [35]
01117   { F3OFF_NULL },  // [36]
01118   { F3OFF_NULL },  // [37]
01119   { F3OFF_NULL },  // [38]
01120   { F3OFF_NULL },  // [39]
01121   { F3OFF_NULL },  // [3A]
01122   { F3OFF_NULL },  // [3B]
01123   { F3OFF_NULL },  // [3C]
01124   { F3OFF_NULL },  // [3D]
01125   { F3OFF_NULL },  // [3E]
01126   { F3OFF_NULL },  // [3F]
01127   { F3OFF_NULL },  // [40]
01128   { F3OFF_NULL },  // [41]
01129   { F3OFF_NULL },  // [42]
01130   { F3OFF_NULL },  // [43]
01131   { F3OFF_NULL },  // [44]
01132   { F3OFF_NULL },  // [45]
01133   { F3OFF_NULL },  // [46]
01134   { F3OFF_NULL },  // [47]
01135   { F3OFF_NULL },  // [48]
01136   { F3OFF_NULL },  // [49]
01137   { F3OFF_NULL },  // [4A]
01138   { F3OFF_NULL },  // [4B]
01139   { F3OFF_NULL },  // [4C]
01140   { F3OFF_NULL },  // [4D]
01141   { F3OFF_NULL },  // [4E]
01142   { F3OFF_NULL },  // [4F]
01143   { F3OFF_NULL },  // [50]
01144   { F3OFF_51   },  // [51]
01145   { F3OFF_52   },  // [52]
01146   { F3OFF_53   },  // [53]
01147   { F3OFF_NULL },  // [54]
01148   { F3OFF_NULL },  // [55]
01149   { F3OFF_NULL },  // [56]
01150   { F3OFF_NULL },  // [57]
01151   { F3OFF_58   },  // [58]
01152   { F3OFF_59   },  // [59]
01153   { F3OFF_NULL },  // [5A]
01154   { F3OFF_NULL },  // [5B]
01155   { F3OFF_5C   },  // [5C]
01156   { F3OFF_5D   },  // [5D]
01157   { F3OFF_5E   },  // [5E]
01158   { F3OFF_5F   },  // [5F]
01159   { F3OFF_NULL },  // [60]
01160   { F3OFF_NULL },  // [61]
01161   { F3OFF_NULL },  // [62]
01162   { F3OFF_NULL },  // [63]
01163   { F3OFF_NULL },  // [64]
01164   { F3OFF_NULL },  // [65]
01165   { F3OFF_NULL },  // [66]
01166   { F3OFF_NULL },  // [67]
01167   { F3OFF_NULL },  // [68]
01168   { F3OFF_NULL },  // [69]
01169   { F3OFF_NULL },  // [6A]
01170   { F3OFF_NULL },  // [6B]
01171   { F3OFF_NULL },  // [6C]
01172   { F3OFF_NULL },  // [6D]
01173   { F3OFF_NULL },  // [6E]
01174   { F3OFF_NULL },  // [6F]
01175   { F3OFF_NULL },  // [70]
01176   { F3OFF_NULL },  // [71]
01177   { F3OFF_NULL },  // [72]
01178   { F3OFF_NULL },  // [73]
01179   { F3OFF_NULL },  // [74]
01180   { F3OFF_NULL },  // [75]
01181   { F3OFF_NULL },  // [76]
01182   { F3OFF_NULL },  // [77]
01183   { F3OFF_NULL },  // [78]
01184   { F3OFF_NULL },  // [79]
01185   { F3OFF_NULL },  // [7A]
01186   { F3OFF_NULL },  // [7B]
01187   { F3OFF_NULL },  // [7C]
01188   { F3OFF_NULL },  // [7D]
01189   { F3OFF_NULL },  // [7E]
01190   { F3OFF_NULL },  // [7F]
01191   { F3OFF_NULL },  // [80]
01192   { F3OFF_NULL },  // [81]
01193   { F3OFF_NULL },  // [82]
01194   { F3OFF_NULL },  // [83]
01195   { F3OFF_NULL },  // [84]
01196   { F3OFF_NULL },  // [85]
01197   { F3OFF_NULL },  // [86]
01198   { F3OFF_NULL },  // [87]
01199   { F3OFF_NULL },  // [88]
01200   { F3OFF_NULL },  // [89]
01201   { F3OFF_NULL },  // [8A]
01202   { F3OFF_NULL },  // [8B]
01203   { F3OFF_NULL },  // [8C]
01204   { F3OFF_NULL },  // [8D]
01205   { F3OFF_NULL },  // [8E]
01206   { F3OFF_NULL },  // [8F]
01207   { F3OFF_NULL },  // [90]
01208   { F3OFF_NULL },  // [91]
01209   { F3OFF_NULL },  // [92]
01210   { F3OFF_NULL },  // [93]
01211   { F3OFF_NULL },  // [94]
01212   { F3OFF_NULL },  // [95]
01213   { F3OFF_NULL },  // [96]
01214   { F3OFF_NULL },  // [97]
01215   { F3OFF_NULL },  // [98]
01216   { F3OFF_NULL },  // [99]
01217   { F3OFF_NULL },  // [9A]
01218   { F3OFF_NULL },  // [9B]
01219   { F3OFF_NULL },  // [9C]
01220   { F3OFF_NULL },  // [9D]
01221   { F3OFF_NULL },  // [9E]
01222   { F3OFF_NULL },  // [9F]
01223   { F3OFF_NULL },  // [A0]
01224   { F3OFF_NULL },  // [A1]
01225   { F3OFF_NULL },  // [A2]
01226   { F3OFF_NULL },  // [A3]
01227   { F3OFF_NULL },  // [A4]
01228   { F3OFF_NULL },  // [A5]
01229   { F3OFF_NULL },  // [A6]
01230   { F3OFF_NULL },  // [A7]
01231   { F3OFF_NULL },  // [A8]
01232   { F3OFF_NULL },  // [A9]
01233   { F3OFF_NULL },  // [AA]
01234   { F3OFF_NULL },  // [AB]
01235   { F3OFF_NULL },  // [AC]
01236   { F3OFF_NULL },  // [AD]
01237   { F3OFF_NULL },  // [AE]
01238   { F3OFF_NULL },  // [AF]
01239   { F3OFF_NULL },  // [B0]
01240   { F3OFF_NULL },  // [B1]
01241   { F3OFF_NULL },  // [B2]
01242   { F3OFF_NULL },  // [B3]
01243   { F3OFF_NULL },  // [B4]
01244   { F3OFF_NULL },  // [B5]
01245   { F3OFF_NULL },  // [B6]
01246   { F3OFF_NULL },  // [B7]
01247   { F3OFF_NULL },  // [B8]
01248   { F3OFF_NULL },  // [B9]
01249   { F3OFF_NULL },  // [BA]
01250   { F3OFF_NULL },  // [BB]
01251   { F3OFF_NULL },  // [BC]
01252   { F3OFF_NULL },  // [BD]
01253   { F3OFF_NULL },  // [BE]
01254   { F3OFF_NULL },  // [BF]
01255   { F3OFF_NULL },  // [C0]
01256   { F3OFF_NULL },  // [C1]
01257   { F3OFF_C2   },  // [C2]
01258   { F3OFF_NULL },  // [C3]
01259   { F3OFF_NULL },  // [C4]
01260   { F3OFF_NULL },  // [C5]
01261   { F3OFF_NULL },  // [C6]
01262   { F3OFF_NULL },  // [C7]
01263   { F3OFF_NULL },  // [C8]
01264   { F3OFF_NULL },  // [C9]
01265   { F3OFF_NULL },  // [CA]
01266   { F3OFF_NULL },  // [CB]
01267   { F3OFF_NULL },  // [CC]
01268   { F3OFF_NULL },  // [CD]
01269   { F3OFF_NULL },  // [CE]
01270   { F3OFF_NULL },  // [CF]
01271   { F3OFF_NULL },  // [D0]
01272   { F3OFF_NULL },  // [D1]
01273   { F3OFF_NULL },  // [D2]
01274   { F3OFF_NULL },  // [D3]
01275   { F3OFF_NULL },  // [D4]
01276   { F3OFF_NULL },  // [D5]
01277   { F3OFF_NULL },  // [D6]
01278   { F3OFF_NULL },  // [D7]
01279   { F3OFF_NULL },  // [D8]
01280   { F3OFF_NULL },  // [D9]
01281   { F3OFF_NULL },  // [DA]
01282   { F3OFF_NULL },  // [DB]
01283   { F3OFF_NULL },  // [DC]
01284   { F3OFF_NULL },  // [DD]
01285   { F3OFF_NULL },  // [DE]
01286   { F3OFF_NULL },  // [DF]
01287   { F3OFF_NULL },  // [E0]
01288   { F3OFF_NULL },  // [E1]
01289   { F3OFF_NULL },  // [E2]
01290   { F3OFF_NULL },  // [E3]
01291   { F3OFF_NULL },  // [E4]
01292   { F3OFF_NULL },  // [E5]
01293   { F3OFF_NULL },  // [E6]
01294   { F3OFF_NULL },  // [E7]
01295   { F3OFF_NULL },  // [E8]
01296   { F3OFF_NULL },  // [E9]
01297   { F3OFF_NULL },  // [EA]
01298   { F3OFF_NULL },  // [EB]
01299   { F3OFF_NULL },  // [EC]
01300   { F3OFF_NULL },  // [ED]
01301   { F3OFF_NULL },  // [EE]
01302   { F3OFF_NULL },  // [EF]
01303   { F3OFF_NULL },  // [F0]
01304   { F3OFF_NULL },  // [F1]
01305   { F3OFF_NULL },  // [F2]
01306   { F3OFF_NULL },  // [F3]
01307   { F3OFF_NULL },  // [F4]
01308   { F3OFF_NULL },  // [F5]
01309   { F3OFF_NULL },  // [F6]
01310   { F3OFF_NULL },  // [F7]
01311   { F3OFF_NULL },  // [F8]
01312   { F3OFF_NULL },  // [F9]
01313   { F3OFF_NULL },  // [FA]
01314   { F3OFF_NULL },  // [FB]
01315   { F3OFF_NULL },  // [FC]
01316   { F3OFF_NULL },  // [FD]
01317   { F3OFF_NULL },  // [FE]
01318   { F3OFF_NULL }   // [FF]
01319 };
01320 COMPILE_CHECK(f3xmmLenCheck,
01321   sizeof(f3Xmm_offsets) == (sizeof(f3Xmm_offsets[0])*256)
01322 );

Generated on Mon Jan 13 22:20:35 2003 for perdr by doxygen1.2.15