Changeset 103801 in vbox for trunk/src/VBox/VMM/VMMAll/target-x86
- Timestamp:
- Mar 11, 2024 10:36:07 PM (14 months ago)
- svn:sync-xref-src-repo-rev:
- 162170
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.