Volume 2B Instruction Set Reference N-Z (794102), страница 64
Текст из файла (страница 64)
2BMOVZXGv, EbGv, EwpextrwGd, Nq, Ibpextrw (66)Gd, Udq, IbshufpsVps, Wps, Ibshufpd (66)Vpd, Wpd, IbGrp 91ApaddqPq, Qqpaddq (66)Vdq, WdqpmullwPq, Qqpmullw (66)Vdq, Wdqmovq (66)pmovmskbWq, VqGd, Nqmovq2dq (F3) pmovmksb (66)Vdq, NqGd, Udqmovdq2q (F2)Pq, UqpavgwPq, Qqpavgw (66)Vdq, WdqpmulhuwPq, Qqpmulhuw (66)Vdq, WdqpmulhwPq, Qqpmulhw (66)Vdq, Wdqcvtpd2dq (F2)Vdq, Wpdcvttpd2dq (66)Vdq, Wpdcvtdq2pd (F3)Vpd, WdqmovntqMq, Pqmovntdq (66)Mdq, VdqpsllqPq, Qqpsllq (66)Vdq, WdqpmuludqPq, Qqpmuludq (66)Vdq, WdqpmaddwdPq, Qqpmaddwd (66)Vdq, WdqpsadbwPq, Qqpsadbw (66)Vdq, WdqmaskmovqPq, Nqmaskmovdqu(66)Vdq, UdqOPCODE MAPTable A-3.
Two-byte Opcode Map: 88H — FFH (First Byte is 0FH) *89ASNSP/PE9ABBCDEFLE/NGNLE/GJccf64, Jz - Long-displacement jump on condition8NP/POL/NGENL/GESETcc, Eb - Byte Set on conditionSNSP/PENP/POL/NGENL/GELE/NGNLE/GPUSHd64GSPOPd64GSRSMBTSEv, GvSHRDEv, Gv, IbSHRDEv, Gv, CL(Grp 151A)1CIMULGv, EvJMPEGrp 101AInvalidOpcode1BGrp 81AEv, IbBTCEv, GvBSFGv, EvBSRGv, Ev(reserved foremulator on IPF)CMOVSXGv, EbGv, EwBSWAPRAX/EAX/R8/R8DRCX/ECX/R9/R9DRDX/EDX/R10/R10DRBX/EBX/R11/R11DRSP/ESP/R12/R12DRBP/EBP/R13/R13DRSI/ESI/R14/R14DRDI/EDI/R15/R15DDpsubusbPq, Qqpsubusb (66)Vdq, WdqpsubuswPq, Qqpsubusw (66)Vdq, WdqpminubPq, Qqpminub (66)Vdq, WdqpandPq, Qqpand (66)Vdq, WdqpaddusbPq, Qqpaddusb (66)Vdq, WdqpadduswPq, Qqpaddusw (66)Vdq, WdqpmaxubPq, Qqpmaxub (66)Vdq, WdqpandnPq, Qqpandn (66)Vdq, WdqEpsubsbPq, Qqpsubsb (66)Vdq, WdqpsubswPq, Qqpsubsw (66)Vdq, WdqpminswPq, Qqpminsw (66)Vdq, WdqporPq, Qqpor (66)Vdq, WdqpaddsbPq, Qqpaddsb (66)Vdq, WdqpaddswPq, Qqpaddsw (66)Vdq, WdqpmaxswPq, Qqpmaxsw (66)Vdq, WdqpxorPq, Qqpxor (66)Vdq, WdqFpsubbPq, Qqpsubb (66)Vdq, WdqpsubwPq, Qqpsubw (66)Vdq, WdqpsubdPq, Qqpsubd (66)Vdq, WdqpsubqPq, Qqpsubq (66)Vdq, WdqpaddbPq, Qqpaddb (66)Vdq, WdqpaddwPq, Qqpaddw (66)Vdq, WdqpadddPq, Qqpaddd (66)Vdq, WdqNOTES:* All blanks in all opcode maps are reserved and must not be used.
Do not depend on the operation of undefined or reserved locations.Vol. 2B A-15OPCODE MAPTable A-4. Three-byte Opcode Map: 00H — F7H (First Two Bytes are 0F 38H) *001234567pshufbPq, Qqpshufb (66)Vdq, WdqphaddwPq, Qqphaddw (66)Vdq, WdqphadddPq, Qqphaddd (66)Vdq, WdqphaddswPq, Qqphaddsw (66)Vdq, WdqpmaddubswPq, Qqpmaddubsw(66)Vdq, WdqphsubwPq, Qqphsubw (66)Vdq, WdqphsubdPq, Qqphsubd (66)Vdq, WdqphsubswPq, Qqphsubsw (66)Vdq, Wdq123456789ABCDEFA-16 Vol.
2BOPCODE MAPTable A-4. Three-byte Opcode Map: 08H — FFH (First Two Bytes are 0F 38H) *089ABpsignbPq, Qqpsignb (66)Vdq, WdqpsignwPq, Qqpsignw (66)Vdq, WdqpsigndPq, Qqpsignd (66)Vdq, WdqpmulhrswPq, Qqpmulhrsw (66)Vdq, Wdq1CDEpabsbPq, Qqpabsb (66)Vdq, WdqpabswPq, Qqpabsw (66)Vdq, WdqpabsdPq, Qqpabsd (66)Vdq, WdqF23456789ABCDEFNOTES:* All blanks in all opcode maps are reserved and must not be used. Do not depend on the operation of undefined or reserved locations.Vol. 2B A-17OPCODE MAPTable A-5.
Three-byte Opcode Map: 00H — F7H (First two bytes are 0F 3AH) *00123456789ABCDEFA-18 Vol. 2B1234567OPCODE MAPTable A-5. Three-byte Opcode Map: 08H — FFH (First Two Bytes are 0F 3AH) *890ABCDEFpalignrPq, Qq, Ibpalignr(66)Vdq, Wdq, Ib123456789ABCDEFNOTES:* All blanks in all opcode maps are reserved and must not be used. Do not depend on the operation of undefined or reserved locations.Vol.
2B A-19OPCODE MAPA.4OPCODE EXTENSIONS FOR ONE-BYTE ANDTWO-BYTE OPCODESSome 1-byte and 2-byte opcodes use bits 3-5 of the ModR/M byte (the nnn field inFigure A-1) as an extension of the opcode.modnnnR/MFigure A-1. ModR/M Byte nnn Field (Bits 5, 4, and 3)Opcodes that have opcode extensions are indicated in Table A-6 and organized bygroup number. Group numbers (from 1 to 16, second column) provide a table entrypoint. The encoding for the r/m field for each instruction can be established using thethird column of the table.A.4.1Opcode Look-up Examples Using Opcode ExtensionsAn Example is provided below.Example A-3. Interpreting an ADD InstructionAn ADD instruction with a 1-byte opcode of 80H is a Group 1 instruction:•Table A-6 indicates that the opcode extension field encoded in the ModR/M bytefor this instruction is 000B.•The r/m field can be encoded to access a register (11B) or a memory addressusing a specified addressing mode (for example: mem = 00B, 01B, 10B).Example A-2.
Looking Up 0F01C3HLook up opcode 0F01C3 for a VMRESUME instruction by using Table A-2, Table A-3and Table A-6:••0F tells us that this instruction is in the 2-byte opcode map.•C3 is the ModR/M byte. The first two bits of C3 are 11B. This tells us to look at thesecond of the Group 7 rows in Table A-6.•The Op/Reg bits [5,4,3] are 000B. This tells us to look in the 000 column forGroup 7.•Finally, the R/M bits [2,1,0] are 011B. This identifies the opcode as theVMRESUME instruction.01 (row 0, column 1 in Table A-3) reveals that this opcode is in Group 7 of TableA-6.A-20 Vol. 2BOPCODE MAPA.4.2Opcode Extension TablesSee Table A-6 below.Table A-6.
Opcode Extensions for One- and Two-byte Opcodes by Group Number *OpcodeGroupEncoding of Bits 5,4,3 of the ModR/M Byte (bits 2,1,0 inparenthesis)Mod 7,6000001010011100101110111ORADCSBBANDSUBXORCMPRORRCLRCRSHL/SALSHRNOTNEGMULAL/rAXIMULAL/rAXDIVAL/rAXPUSHd64Ev80-831mem, 11BADD8F1Amem, 11BPOPC0, C1 reg,immD0, D1 reg, 1D2, D3 reg, CLmem, 11BROL2mem, 11BTESTIb/IzF6, F73FE4mem, 11BINCEbDECEbFF5mem, 11BINCEvDECEvCALLNf64EvCALLFEpJMPNf64EvJMPFEp0F 006mem, 11BSLDTRv/MwSTRRv/MwLLDTEwLTREwVERREwVERWEw0F 017memSGDTMsSIDTMsLGDTMsLIDTMsSMSWMw/Rv11B0F BA8mem, 11B0F C79memSARLMSWEwVMCALLMONITOR(001)(000)VMLAUNCHMWAIT(010)(001)VMRESUME(011)VMXOFF(100)CMPXCHG16BMdqINVLPGMbSWAPGSo64(000)BTCMPXCH8BMqIDIVAL/rAXBTSBTRBTCVMPTRLD VMPTRSTMqMqVMCLEAR(66)MqVMXON (F3)Mq11B0F B910memC611mem, 11BMOVEb, IbmemMOVEv, Iz11BC711BVol.
2B A-21OPCODE MAPTable A-6. Opcode Extensions for One- and Two-byte Opcodes by Group Number *OpcodeGroupEncoding of Bits 5,4,3 of the ModR/M Byte (bits 2,1,0 inparenthesis)Mod 7,60000F 711200113141516110psrlwNq, Ibpsrlw (66)Udq, IbpsrawNq, Ibpsraw (66)Udq, IbpsllwNq, Ibpsllw (66)Udq, IbpsrldNq, Ibpsrld (66)Udq, IbpsradNq, Ibpsrad (66)Udq, IbpslldNq, Ibpslld (66)Udq, Ibmempsrlqpsrldq (66)Nq, IbUdq, Ibpsrlq (66)Udq, Ibfxsavefxrstorldmxcsr111memprefetchT0prefetchT1pslldq (66)Udq, IbmfencesfenceclflushlfenceprefetchNTApsllqNq, Ibpsllq (66)Udq, Ibstmxcsr11B0F 18101mem11B0F AE100mem11B0F 73011mem11B0F 72010prefetchT211BNOTES:* All blanks in all opcode maps are reserved and must not be used. Do not depend on the operation of undefined or reserved locations.A-22 Vol. 2BOPCODE MAPA.5ESCAPE OPCODE INSTRUCTIONSOpcode maps for coprocessor escape instruction opcodes (x87 floating-pointinstruction opcodes) are in Table A-7 through Table A-22.
These maps are groupedby the first byte of the opcode, from D8-DF. Each of these opcodes has a ModR/Mbyte. If the ModR/M byte is within the range of 00H-BFH, bits 3-5 of the ModR/M byteare used as an opcode extension, similar to the technique used for 1-and 2-byteopcodes (see Section A.4). If the ModR/M byte is outside the range of 00H throughBFH, the entire ModR/M byte is used as an opcode extension.A.5.1Opcode Look-up Examples for Escape Instruction OpcodesExamples are provided below.Example A-5. Opcode with ModR/M Byte in the 00H through BFH RangeDD0504000000H can be interpreted as follows:•Since the ModR/M byte (05H) is within the 00H through BFH range, bits 3 through5 (000) of this byte indicate the opcode for an FLD double-real instruction (seeTable A-9).•The double-real value to be loaded is at 00000004H (the 32-bit displacementthat follows and belongs to this opcode).Example A-3.
Opcode with ModR/M Byte outside the 00H through BFH RangeD8C1H can be interpreted as follows:•This example illustrates an opcode with a ModR/M byte outside the range of 00Hthrough BFH. The instruction can be located in Section A.4.•In Table A-8, the ModR/M byte C1H indicates row C, column 1 (the FADDinstruction using ST(0), ST(1) as operands).A.5.2Escape Opcode Instruction TablesTables are listed below.Vol. 2B A-23OPCODE MAPA.5.2.1Escape Opcodes with D8 as First ByteTable A-7 and A-8 contain maps for the escape instruction opcodes that begin withD8H.
Table A-7 shows the map if the ModR/M byte is in the range of 00H-BFH. Here,the value of bits 3-5 (the nnn field in Figure A-1) selects the instruction.Table A-7. D8 Opcode Map When ModR/M Byte is Within 00H to BFH *nnn Field of ModR/M Byte (refer to Figure A.4)000B001B010B011B100B101BFADD singlerealFMUL singlerealFCOM singlerealFCOMP singlerealFSUB singlereal110B111BFSUBR single- FDIV single-real FDIVR singlerealrealNOTES:* All blanks in all opcode maps are reserved and must not be used. Do not depend on the operation of undefined or reserved locations.Table A-8 shows the map if the ModR/M byte is outside the range of 00H-BFH. Here,the first digit of the ModR/M byte selects the table row and the second digit selectsthe column.Table A-8. D8 Opcode Map When ModR/M Byte is Outside 00H to BFH *0123C4567ST(0),ST(4)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)FADDST(0),ST(0)ST(0),ST(1)ST(0),ST(2)ST(0),ST(3)DFCOMST(0),ST(0)ST(0),ST(1)ST(0),T(2)ST(0),ST(3)EST(0),ST(4)FSUBST(0),ST(0)ST(0),ST(1)ST(0),ST(2)ST(0),ST(3)FST(0),ST(4)FDIVST(0),ST(0)ST(0),ST(1)ST(0),ST(2)ST(0),ST(3)ST(0),ST(4)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)89ABCDEFST(0),ST(4)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)ST(0),ST(5)ST(0),ST(6)ST(0),ST(7)CFMULST(0),ST(0)ST(0),ST(1)ST(0),ST(2)ST(0),ST(3)ST(0),ST(0)ST(0),ST(1)ST(0),T(2)ST(0),ST(3)DFCOMPEST(0),ST(4)FSUBRST(0),ST(0)ST(0),ST(1)ST(0),ST(2)FST(0),ST(3)ST(0),ST(4)FDIVRST(0),ST(0)ST(0),ST(1)ST(0),ST(2)ST(0),ST(3)ST(0),ST(4)NOTES:* All blanks in all opcode maps are reserved and must not be used.
Do not depend on the operation of undefined or reserved locations.A-24 Vol. 2BOPCODE MAPA.5.2.2Escape Opcodes with D9 as First ByteTable A-9 and A-10 contain maps for escape instruction opcodes that begin with D9H.Table A-9 shows the map if the ModR/M byte is in the range of 00H-BFH. Here, thevalue of bits 3-5 (the nnn field in Figure A-1) selects the instruction.Table A-9. D9 Opcode Map When ModR/M Byte is Within 00H to BFH *nnn Field of ModR/M Byte000B001BFLDsingle-real010B011B100B101B110B111BFSTsingle-realFSTPsingle-realFLDENV14/28 bytesFLDCW2 bytesFSTENV14/28 bytesFSTCW2 bytesNOTES:* All blanks in all opcode maps are reserved and must not be used.