00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "x86instr.h"
00026
00027 struct inst_3DNow {
00028 int instruction;
00029 };
00030 typedef struct inst_3DNow INST_3DNOW;
00031
00032 struct inst_f3Xmm {
00033 int special;
00034 int instruction;
00035 };
00036 typedef struct inst_f3Xmm INST_F3XMM;
00037
00038 enum Regs
00039 {
00040 regNone = 0,
00041
00042 regAL,
00043 regCL,
00044 regDL,
00045 regBL,
00046 regAH,
00047 regCH,
00048 regDH,
00049 regBH,
00050
00051 regAX,
00052 regCX,
00053 regDX,
00054 regBX,
00055 regSP,
00056 regBP,
00057 regSI,
00058 regDI,
00059
00060 regES,
00061 regCS,
00062 regSS,
00063 regDS,
00064 regFS,
00065 regGS
00066 };
00067
00068
00069 enum Modreg
00070 {
00071
00072
00073 modregSize =7,
00074 modregByte =0,
00075 modregVar =1,
00076 modregDword =2,
00077 modregMmx =3,
00078
00079 modregXmm =4,
00080
00081
00082 modregMemStartBit =3,
00083 modregMemType =15<<modregMemStartBit,
00084 modregMemByte =1<<modregMemStartBit,
00085 modregMemWord =2<<modregMemStartBit,
00086 modregMemDword =3<<modregMemStartBit,
00087 modregMemQword =4<<modregMemStartBit,
00088 modregMemPacketDword =5<<modregMemStartBit,
00089 modregMemPointer =6<<modregMemStartBit,
00090 modregMemBound =7<<modregMemStartBit,
00091 modregMemDescriptor =8<<modregMemStartBit,
00092
00093 modregMemNone =9<<modregMemStartBit,
00094 modregMemPacket =10<<modregMemStartBit,
00095 modregMemFPacket =11<<modregMemStartBit,
00096 modregMem2FPacket =12<<modregMemStartBit,
00097 modregMem4FPacket =13<<modregMemStartBit,
00098
00099
00100 modregTypeStartBit =7,
00101 modregType =3<<modregTypeStartBit,
00102 modregMemReg =0<<modregTypeStartBit,
00103 modregRegMem =1<<modregTypeStartBit,
00104 modregMem =2<<modregTypeStartBit,
00105 modregReg =3<<modregTypeStartBit,
00106
00107
00108 modregThirdStartBit =9,
00109 modregThird =7<<modregThirdStartBit,
00110 modregIsb =1<<modregThirdStartBit,
00111 modregIub =2<<modregThirdStartBit,
00112 modregIv =3<<modregThirdStartBit,
00113 modreg1 =4<<modregThirdStartBit,
00114 modregCL =5<<modregThirdStartBit,
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124 modregEbGb =modregByte|modregMemReg,
00125 modregEvGv =modregVar |modregMemReg,
00126 modregGbEb =modregByte|modregRegMem,
00127 modregGvEv =modregVar |modregRegMem,
00128
00129
00130 modregEwSw =modregVar |modregMemReg|modregMemWord,
00131 modregSwEw =modregVar |modregRegMem|modregMemWord,
00132
00133 modregEv =modregVar |modregMem,
00134 modregEb1 =modregByte|modregMem|modreg1,
00135 modregEv1 =modregVar |modregMem|modreg1,
00136 modregEbCL =modregByte|modregMem|modregCL,
00137 modregEvCL =modregVar |modregMem|modregCL,
00138 modregGvMa =modregVar |modregRegMem|modregMemBound,
00139 modregGvMp =modregVar |modregRegMem|modregMemPointer,
00140 modregEbIsb =modregByte|modregMem|modregIsb,
00141 modregEbIub =modregByte|modregMem|modregIub,
00142 modregEvIv =modregVar |modregMem|modregIv,
00143 modregGvEvIv =modregVar |modregRegMem|modregIv,
00144 modregGvEvIsb =modregVar |modregRegMem|modregIsb,
00145 modregGvEvIub =modregVar |modregRegMem|modregIub,
00146 modregEb =modregByte|modregMem,
00147 modregGvEb =modregVar |modregRegMem|modregMemByte,
00148 modregGvEw =modregVar |modregRegMem|modregMemWord,
00149 modregEvGvIsb =modregVar |modregMemReg|modregIsb,
00150 modregEvGvIub =modregVar |modregMemReg|modregIub,
00151 modregEvGvCL =modregVar |modregMemReg|modregCL,
00152 modregEvIsb =modregVar |modregMem|modregIsb,
00153 modregEvIub =modregVar |modregMem|modregIub,
00154
00155
00156 modregEp =modregMem|modregMemPointer,
00157 modregEw =modregMem|modregMemWord,
00158 modregMs =modregMem|modregMemDescriptor,
00159 modregMn =modregMem|modregMemNone,
00160 modregMq =modregMem|modregMemQword,
00161
00162 modregGvMn =modregVar |modregRegMem|modregMemNone,
00163
00164
00165 modregPqQd =modregRegMem|modregMmx|modregMemPacketDword,
00166 modregPqQq =modregRegMem|modregMmx,
00167 modregPqQqIub =modregPqQq|modregIub,
00168 modregQqPq =modregMemReg|modregMmx,
00169 modregPqIsb =modregReg|modregMmx|modregIsb,
00170 modregPqIub =modregReg|modregMmx|modregIub,
00171 modregPdEd =modregRegMem|modregMmx|modregMemDword,
00172 modregEdPd =modregMemReg|modregMmx|modregMemDword,
00173 modregPqEdIub =modregPdEd|modregIub,
00174 modregPqEwIub =modregRegMem|modregMmx|modregMemWord|modregIub,
00175 modregGdQq =modregRegMem|modregDword|modregMemPacket,
00176 modregGdQqIub =modregGdQq|modregIub,
00177
00178
00179
00180 modregWpsVps =modregMemReg|modregXmm,
00181 modregVpsWps =modregRegMem|modregXmm,
00182 modregVpsWpsIub =modregRegMem|modregXmm|modregIub,
00183 modregVpsQq =modregRegMem|modregXmm|modregMemPacket,
00184 modregPqWq =modregRegMem|modregMmx|modregMem2FPacket,
00185 modregVqWq =modregRegMem|modregXmm|modregMem2FPacket,
00186 modregWqVq =modregMemReg|modregXmm|modregMem2FPacket,
00187 modregVssWss =modregRegMem|modregXmm|modregMemFPacket,
00188 modregVssWssIub =modregRegMem|modregXmm|modregMemFPacket|modregIub,
00189 modregVssEd =modregRegMem|modregXmm|modregMemDword,
00190 modregGdWss =modregRegMem|modregDword|modregMem4FPacket,
00191 modregWssVss =modregMemReg|modregXmm|modregMemFPacket,
00192 modregEdVps =modregMemReg|modregXmm|modregMemDword
00193 };
00194
00195
00196 enum Movcregs
00197 {
00198 movcregR32CRx =0,
00199 movcregCRxr32 =1,
00200 movcregR32DRx =2,
00201 movcregDRxr32 =3,
00202 movcregR32TRx =4,
00203 movcregTRxr32 =5
00204 };
00205
00206 extern INST_3DNOW k6_3DNow_instr[];
00207 extern INST_F3XMM f3Xmm_instr[];
00208 extern uchar f3Xmm_offsets[];
00209 #define F3XMM(n) f3Xmm_instr[f3Xmm_offsets[n]]
00210
00211 #define DEFINE_FPI(istr,type) ((istr<<8)|type)
00212 #define FPI_ISTR(i) (i>>8)
00213 #define FPI_TYPE(i) (i&255)
00214 enum FpiTypes
00215 {
00216 fpiTypeWInt=0,fpiTypeSInt,fpiTypeLInt,
00217 fpiTypeSingle,fpiTypeDouble,fpiTypeExtended,fpiTypeBCD,
00218 fpiTypeWord,fpiTypeEnv,fpiTypeStatus,
00219 fpiTypeCount,
00220 fpiTypeImplicitMemory = fpiTypeEnv
00221 };
00222 extern int esc_inst[];
00223
00224 #define DEFINE_FPIM3(istr,param) DEFINE_FPI(istr,param)
00225 #define FPIM3_ISTR(i) FPI_ISTR(i)
00226 #define FPIM3_PARAM(i) FPI_TYPE(i)
00227 enum FpiParams
00228 {
00229 fpiParamNone,fpiParamStNSt,fpiParamStN,fpiParamStStN
00230 };
00231 extern int esc_inst_mod3[];
00232 extern int esc_inst_special[][8];
00233
00234