Changeset 104292 in vbox
- Timestamp:
- Apr 11, 2024 10:21:57 AM (8 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/armv8.h
r104279 r104292 4613 4613 4614 4614 4615 /** Armv8 USHR/USRA/URSRA/SSHR/SRSA/SSHR vector element size. */ 4616 typedef enum ARMV8INSTRUSHIFTSZ 4617 { 4618 kArmv8InstrShiftSz_U8 = 16, /**< Byte. */ 4619 kArmv8InstrShiftSz_U16 = 32, /**< Halfword. */ 4620 kArmv8InstrShiftSz_U32 = 64, /**< 32-bit. */ 4621 kArmv8InstrShiftSz_U64 = 128 /**< 64-bit. */ 4622 } ARMV8INSTRUSHIFTSZ; 4623 4624 /** 4625 * A64: Encodes USHR/USRA/URSRA/SSHR/SRSA/SSHR (vector, register). 4626 * 4627 * @returns The encoded instruction. 4628 * @param iVecRegDst The vector register to put the result into. 4629 * @param iVecRegSrc The vector source register. 4630 * @param enmSz Element size. 4631 * @param fUnsigned Flag whether this a signed or unsigned shift, 4632 * @param fRound Flag whether this is the rounding shift variant. 4633 * @param fAccum Flag whether this is the accumulate shift variant. 4634 * @param f128Bit Flag whether this operates on the full 128-bit (true, default) of the vector register 4635 * or just the low 64-bit (false). 4636 */ 4637 DECL_FORCE_INLINE(uint32_t) Armv8A64MkVecInstrShrImm(uint32_t iVecRegDst, uint32_t iVecRegSrc, uint8_t cShift, ARMV8INSTRUSHIFTSZ enmSz, 4638 bool fUnsigned = true, bool fRound = false, bool fAccum = false, bool f128Bit = true) 4639 { 4640 Assert(iVecRegDst < 32); Assert(iVecRegSrc < 32); 4641 Assert( cShift >= 1 4642 && ( (enmSz == kArmv8InstrShiftSz_U8 && cShift <= 8) 4643 || (enmSz == kArmv8InstrShiftSz_U16 && cShift <= 16) 4644 || (enmSz == kArmv8InstrShiftSz_U32 && cShift <= 32) 4645 || (enmSz == kArmv8InstrShiftSz_U64 && cShift <= 64))); 4646 4647 return UINT32_C(0xf000400) 4648 | ((uint32_t)f128Bit << 30) 4649 | ((uint32_t)fUnsigned << 29) 4650 | (((uint32_t)enmSz - cShift) << 16) 4651 | ((uint32_t)fRound << 13) 4652 | ((uint32_t)fAccum << 12) 4653 | (iVecRegSrc << 5) 4654 | iVecRegDst; 4655 } 4615 4656 /** @} */ 4616 4657 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstTwoByte0f.cpp.h
r104288 r104292 6580 6580 { 6581 6581 // IEMOP_MNEMONIC2(RI, PSRLW, psrlw, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 6582 SSE2_SHIFT_BODY_Imm(psrlw, bRm, 0);6582 SSE2_SHIFT_BODY_Imm(psrlw, bRm, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64); 6583 6583 } 6584 6584 … … 6657 6657 { 6658 6658 // IEMOP_MNEMONIC2(RI, PSRLD, psrld, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 6659 SSE2_SHIFT_BODY_Imm(psrld, bRm, 0);6659 SSE2_SHIFT_BODY_Imm(psrld, bRm, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64); 6660 6660 } 6661 6661 … … 6732 6732 { 6733 6733 // IEMOP_MNEMONIC2(RI, PSRLQ, psrlq, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 6734 SSE2_SHIFT_BODY_Imm(psrlq, bRm, 0);6734 SSE2_SHIFT_BODY_Imm(psrlq, bRm, RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64); 6735 6735 } 6736 6736 -
trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h
r104279 r104292 2042 2042 return off; 2043 2043 } 2044 2045 2046 /** 2047 * Common emitter for the shift right with immediate instructions. 2048 */ 2049 #ifdef RT_ARCH_AMD64 2050 # define IEMNATIVE_NATIVE_EMIT_SHIFT_RIGHT_IMM_U128(a_Instr, a_cShiftMax, a_ArmElemSz, a_bOpcX86) \ 2051 DECL_INLINE_THROW(uint32_t) \ 2052 RT_CONCAT3(iemNativeEmit_,a_Instr,_ri_u128)(PIEMRECOMPILERSTATE pReNative, uint32_t off, \ 2053 uint8_t const idxSimdGstRegDst, uint8_t const bImm) \ 2054 { \ 2055 if (bImm) \ 2056 { \ 2057 uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegDst), \ 2058 kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForUpdate); \ 2059 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 5); \ 2060 pCodeBuf[off++] = X86_OP_PRF_SIZE_OP; \ 2061 if (idxSimdRegDst >= 8) \ 2062 pCodeBuf[off++] = X86_OP_REX_B; \ 2063 pCodeBuf[off++] = 0x0f; \ 2064 pCodeBuf[off++] = (a_bOpcX86); \ 2065 pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, 2, idxSimdRegDst & 7); \ 2066 pCodeBuf[off++] = bImm; \ 2067 iemNativeSimdRegFreeTmp(pReNative, idxSimdRegDst); \ 2068 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); \ 2069 } \ 2070 /* Immediate 0 is a nop. */ \ 2071 return off; \ 2072 } 2073 #elif defined(RT_ARCH_ARM64) 2074 # define IEMNATIVE_NATIVE_EMIT_SHIFT_RIGHT_IMM_U128(a_Instr, a_cShiftMax, a_ArmElemSz, a_bOpcX86) \ 2075 DECL_INLINE_THROW(uint32_t) \ 2076 RT_CONCAT3(iemNativeEmit_,a_Instr,_ri_u128)(PIEMRECOMPILERSTATE pReNative, uint32_t off, \ 2077 uint8_t const idxSimdGstRegDst, uint8_t const bImm) \ 2078 { \ 2079 if (bImm) \ 2080 { \ 2081 uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegDst), \ 2082 kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForUpdate); \ 2083 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); \ 2084 pCodeBuf[off++] = Armv8A64MkVecInstrShrImm(idxSimdRegDst, idxSimdRegDst, RT_MIN(bImm, (a_cShiftMax)), (a_ArmElemSz)); \ 2085 iemNativeSimdRegFreeTmp(pReNative, idxSimdRegDst); \ 2086 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); \ 2087 } \ 2088 /* Immediate 0 is a nop. */ \ 2089 return off; \ 2090 } 2091 #else 2092 # error "Port me" 2093 #endif 2094 2095 IEMNATIVE_NATIVE_EMIT_SHIFT_RIGHT_IMM_U128(psrlw, 16, kArmv8InstrShiftSz_U16, 0x71); 2096 IEMNATIVE_NATIVE_EMIT_SHIFT_RIGHT_IMM_U128(psrld, 32, kArmv8InstrShiftSz_U32, 0x72); 2097 IEMNATIVE_NATIVE_EMIT_SHIFT_RIGHT_IMM_U128(psrlq, 64, kArmv8InstrShiftSz_U64, 0x73); 2098 2044 2099 #endif 2045 2100 -
trunk/src/VBox/VMM/include/IEMInternal.h
r104281 r104292 2042 2042 /** Statistics per threaded function call. 2043 2043 * Updated by both the threaded and native recompilers. */ 2044 uint32_t acThreadedFuncStats[0x51 00 /*20736*/];2044 uint32_t acThreadedFuncStats[0x5120 /*20768*/]; 2045 2045 # endif 2046 2046 #endif
Note:
See TracChangeset
for help on using the changeset viewer.