Changeset 103800 in vbox
- Timestamp:
- Mar 11, 2024 10:31:33 PM (9 months ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstOneByte.cpp.h
r103799 r103800 1230 1230 IEMOP_MNEMONIC2(FIXED, OR, or, AL, Ib, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZES); 1231 1231 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_AF); 1232 IEMOP_BODY_BINARY_AL_Ib(or, 0);1232 IEMOP_BODY_BINARY_AL_Ib(or, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64); 1233 1233 } 1234 1234 … … 1250 1250 IEMOP_MNEMONIC2(FIXED, OR, or, rAX, Iz, DISOPTYPE_HARMLESS, 0); 1251 1251 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_AF); 1252 IEMOP_BODY_BINARY_rAX_Iz_RW(or, 0);1252 IEMOP_BODY_BINARY_rAX_Iz_RW(or, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64); 1253 1253 } 1254 1254 … … 4392 4392 { 4393 4393 IEMOP_MNEMONIC(or_Eb_Ib, "or Eb,Ib"); 4394 IEMOP_BODY_BINARY_Eb_Ib_RW(or, 0, 0);4394 IEMOP_BODY_BINARY_Eb_Ib_RW(or, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64, 0); 4395 4395 } 4396 4396 … … 4965 4965 { 4966 4966 IEMOP_MNEMONIC(or_Ev_Iz, "or Ev,Iz"); 4967 IEMOP_BODY_BINARY_Ev_Iz_RW(or, 0, 0);4967 IEMOP_BODY_BINARY_Ev_Iz_RW(or, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64, 0); 4968 4968 } 4969 4969 … … 5523 5523 { 5524 5524 IEMOP_MNEMONIC(or_Ev_Ib, "or Ev,Ib"); 5525 IEMOP_BODY_BINARY_Ev_Ib_RW(or, 0, 0);5525 IEMOP_BODY_BINARY_Ev_Ib_RW(or, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64, 0); 5526 5526 } 5527 5527 -
trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h
r103799 r103800 508 508 509 509 #elif defined(RT_ARCH_ARM64) 510 /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones. */ 510 /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones, and of 511 course the immediate variant when possible to save a register load. */ 511 512 uint32_t uImmSizeLen, uImmRotations; 512 513 if ( cOpBits > 32 … … 606 607 607 608 #elif defined(RT_ARCH_ARM64) 608 /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones. We also 609 need to keep the result in order to calculate the flags. */ 609 /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones, and of 610 course the immediate variant when possible to save a register load. 611 We also need to keep the result in order to calculate the flags. */ 610 612 uint8_t const idxRegResult = iemNativeRegAllocTmp(pReNative, &off); 611 613 uint32_t uImmSizeLen, uImmRotations; … … 688 690 uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl, uint8_t cOpBits, uint8_t cImmBits) 689 691 { 690 RT_NOREF(pReNative, off, idxVarDst, uImmOp, idxVarEfl, cOpBits, cImmBits); 692 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); 693 #ifdef RT_ARCH_AMD64 694 /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */ 695 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8); 696 off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 1, idxRegDst, uImmOp); 697 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 698 699 off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl); 700 701 #elif defined(RT_ARCH_ARM64) 702 /* On ARM64 we use 32-bit OR for the 8-bit and 16-bit bit ones, and of 703 course the immediate variant when possible to save a register load. */ 704 uint32_t uImmSizeLen, uImmRotations; 705 if ( cOpBits > 32 706 ? Armv8A64ConvertMask64ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations) 707 : Armv8A64ConvertMask32ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations)) 708 { 709 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 710 pCodeBuf[off++] = Armv8A64MkInstrOrrImm(idxRegDst, idxRegDst, uImmSizeLen, uImmRotations, cOpBits > 32 /*f64Bit*/); 711 } 712 else 713 { 714 uint8_t const idxRegTmpImm = iemNativeRegAllocTmpImm(pReNative, &off, uImmOp); 715 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 716 pCodeBuf[off++] = Armv8A64MkInstrOrr(idxRegDst, idxRegDst, idxRegTmpImm, cOpBits > 32 /*f64Bit*/); 717 iemNativeRegFreeTmpImm(pReNative, idxRegTmpImm); 718 } 719 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 720 721 off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst); 722 RT_NOREF_PV(cImmBits) 723 724 #else 725 # error "Port me" 726 #endif 727 iemNativeVarRegisterRelease(pReNative, idxVarDst); 691 728 return off; 692 729 }
Note:
See TracChangeset
for help on using the changeset viewer.