VirtualBox

Changeset 104292 in vbox for trunk/include


Ignore:
Timestamp:
Apr 11, 2024 10:21:57 AM (9 months ago)
Author:
vboxsync
Message:

VMM/IEM: Implement native emitters for psrlw,psrld,psrlq, bugref:10652

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/armv8.h

    r104279 r104292  
    46134613
    46144614
     4615/** Armv8 USHR/USRA/URSRA/SSHR/SRSA/SSHR vector element size.    */
     4616typedef 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 */
     4637DECL_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}
    46154656/** @} */
    46164657
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette