Changeset 103801 in vbox
- Timestamp:
- Mar 11, 2024 10:36:07 PM (12 months ago)
- svn:sync-xref-src-repo-rev:
- 162170
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstOneByte.cpp.h
r103800 r103801 1846 1846 IEMOP_MNEMONIC2(FIXED, XOR, xor, AL, Ib, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZES); 1847 1847 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_AF); 1848 IEMOP_BODY_BINARY_AL_Ib(xor, 0);1848 IEMOP_BODY_BINARY_AL_Ib(xor, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64); 1849 1849 } 1850 1850 … … 1859 1859 IEMOP_MNEMONIC2(FIXED, XOR, xor, rAX, Iz, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZES); 1860 1860 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_AF); 1861 IEMOP_BODY_BINARY_rAX_Iz_RW(xor, 0);1861 IEMOP_BODY_BINARY_rAX_Iz_RW(xor, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64); 1862 1862 } 1863 1863 … … 4452 4452 { 4453 4453 IEMOP_MNEMONIC(xor_Eb_Ib, "xor Eb,Ib"); 4454 IEMOP_BODY_BINARY_Eb_Ib_RW(xor, 0, 0);4454 IEMOP_BODY_BINARY_Eb_Ib_RW(xor, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64, 0); 4455 4455 } 4456 4456 … … 5025 5025 { 5026 5026 IEMOP_MNEMONIC(xor_Ev_Iz, "xor Ev,Iz"); 5027 IEMOP_BODY_BINARY_Ev_Iz_RW(xor, 0, 0);5027 IEMOP_BODY_BINARY_Ev_Iz_RW(xor, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64, 0); 5028 5028 } 5029 5029 … … 5583 5583 { 5584 5584 IEMOP_MNEMONIC(xor_Ev_Ib, "xor Ev,Ib"); 5585 IEMOP_BODY_BINARY_Ev_Ib_RW(xor, 0, 0);5585 IEMOP_BODY_BINARY_Ev_Ib_RW(xor, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64, 0); 5586 5586 } 5587 5587 -
trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h
r103800 r103801 467 467 uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/); 468 468 #ifdef RT_ARCH_AMD64 469 /* On AMD64 we just use the correctly size AND instruction harvest the EFLAGS. */469 /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */ 470 470 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 471 471 0x22, 0x23, cOpBits, idxRegDst, idxRegSrc); … … 500 500 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); 501 501 #ifdef RT_ARCH_AMD64 502 /* On AMD64 we just use the correctly size AND instruction harvest the EFLAGS. */502 /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */ 503 503 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8); 504 504 off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 4, idxRegDst, uImmOp); … … 556 556 : iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/); 557 557 #ifdef RT_ARCH_AMD64 558 /* On AMD64 we just use the correctly size TEST instruction harvest the EFLAGS. */558 /* On AMD64 we just use the correctly sized TEST instruction harvest the EFLAGS. */ 559 559 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 560 560 0x84, 0x85, cOpBits, idxRegSrc, idxRegDst); … … 598 598 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); 599 599 #ifdef RT_ARCH_AMD64 600 /* On AMD64 we just use the correctly size AND instruction harvest the EFLAGS. */600 /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */ 601 601 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8); 602 602 off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0xf6, 0xcc, 0xf7, cOpBits, cImmBits, 0, idxRegDst, uImmOp); … … 658 658 uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/); 659 659 #ifdef RT_ARCH_AMD64 660 /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */660 /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */ 661 661 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 662 662 0x0a, 0x0b, cOpBits, idxRegDst, idxRegSrc); … … 692 692 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); 693 693 #ifdef RT_ARCH_AMD64 694 /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */694 /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */ 695 695 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8); 696 696 off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 1, idxRegDst, uImmOp); … … 741 741 uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/); 742 742 #ifdef RT_ARCH_AMD64 743 /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */743 /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */ 744 744 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 745 745 0x32, 0x33, cOpBits, idxRegDst, idxRegSrc); … … 773 773 uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl, uint8_t cOpBits, uint8_t cImmBits) 774 774 { 775 RT_NOREF(pReNative, off, idxVarDst, uImmOp, idxVarEfl, cOpBits, cImmBits); 775 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); 776 #ifdef RT_ARCH_AMD64 777 /* On AMD64 we just use the correctly sized XOR instruction harvest the EFLAGS. */ 778 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8); 779 off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 6, idxRegDst, uImmOp); 780 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 781 782 off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl); 783 784 #elif defined(RT_ARCH_ARM64) 785 /* On ARM64 we use 32-bit OR for the 8-bit and 16-bit bit ones, and of 786 course the immediate variant when possible to save a register load. */ 787 uint32_t uImmSizeLen, uImmRotations; 788 if ( cOpBits > 32 789 ? Armv8A64ConvertMask64ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations) 790 : Armv8A64ConvertMask32ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations)) 791 { 792 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 793 pCodeBuf[off++] = Armv8A64MkInstrEorImm(idxRegDst, idxRegDst, uImmSizeLen, uImmRotations, cOpBits > 32 /*f64Bit*/); 794 } 795 else 796 { 797 uint8_t const idxRegTmpImm = iemNativeRegAllocTmpImm(pReNative, &off, uImmOp); 798 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 799 pCodeBuf[off++] = Armv8A64MkInstrEor(idxRegDst, idxRegDst, idxRegTmpImm, cOpBits > 32 /*f64Bit*/); 800 iemNativeRegFreeTmpImm(pReNative, idxRegTmpImm); 801 } 802 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 803 804 off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst); 805 RT_NOREF_PV(cImmBits) 806 807 #else 808 # error "Port me" 809 #endif 810 iemNativeVarRegisterRelease(pReNative, idxVarDst); 776 811 return off; 777 812 }
Note:
See TracChangeset
for help on using the changeset viewer.