VirtualBox

Ignore:
Timestamp:
Sep 12, 2024 3:17:06 PM (5 months ago)
Author:
vboxsync
Message:

VMM/IEM: Quick liveness fix for iemOp_pmovmskb_Gd_Ux. bugref:10652 bugref:10270

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h

    r105491 r106037  
    22902290{
    22912291#ifdef RT_ARCH_AMD64
    2292     uint8_t const idxRegDst = iemNativeRegAllocTmpForGuestReg(pReNative, &off, IEMNATIVEGSTREG_GPR(idxGstRegDst), kIemNativeGstRegUse_ForFullWrite);
    2293     uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegSrc),
    2294                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     2292    uint8_t const idxRegDst = iemNativeRegAllocTmpForGuestReg(pReNative, &off, IEMNATIVEGSTREG_GPR(idxGstRegDst),
     2293                                                              kIemNativeGstRegUse_ForFullWrite);
     2294    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off,
     2295                                                                          IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegSrc),
     2296                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     2297                                                                          kIemNativeGstRegUse_ReadOnly);
    22952298    PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 5);
    22962299
    22972300    pCodeBuf[off++] = X86_OP_PRF_SIZE_OP;
    22982301    if (idxRegDst >= 8 || idxSimdRegSrc >= 8)
    2299         pCodeBuf[off++] =   (idxSimdRegSrc >= 8 ? X86_OP_REX_B : 0)
    2300                           | (idxRegDst     >= 8 ? X86_OP_REX_R : 0);
     2302        pCodeBuf[off++] = (idxSimdRegSrc >= 8 ? X86_OP_REX_B : 0)
     2303                        | (idxRegDst     >= 8 ? X86_OP_REX_R : 0);
    23012304    pCodeBuf[off++] = 0x0f;
    23022305    pCodeBuf[off++] = 0xd7;
     
    23052308    iemNativeSimdRegFreeTmp(pReNative, idxSimdRegSrc);
    23062309    iemNativeRegFreeTmp(pReNative, idxRegDst);
    2307 #elif defined(RT_ARCH_ARM64)
    2308     uint8_t const idxRegDst = iemNativeRegAllocTmpForGuestReg(pReNative, &off, IEMNATIVEGSTREG_GPR(idxGstRegDst), kIemNativeGstRegUse_ForFullWrite);
     2310
     2311#elif defined(RT_ARCH_ARM64)
     2312    uint8_t const idxRegDst = iemNativeRegAllocTmpForGuestReg(pReNative, &off, IEMNATIVEGSTREG_GPR(idxGstRegDst),
     2313                                                              kIemNativeGstRegUse_ForFullWrite);
    23092314    uint8_t const idxRegTmp = iemNativeRegAllocTmp(pReNative, &off);
    2310     uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegSrc),
    2311                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_Calculation);
     2315    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off,
     2316                                                                          IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegSrc),
     2317                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     2318                                                                          kIemNativeGstRegUse_Calculation);
    23122319    PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 7);
    23132320
     
    23162323     * for different approaches as NEON doesn't has an instruction equivalent for pmovmskb, so we have to emulate that.
    23172324     *
    2318      * As there is no way around emulating the exact semantics of pmovmskb we will use the same algorithm as the sse2neon implementation because
    2319      * there we can get away with loading any constants and the base algorithm is only 4 NEON instructions (+ 3 for extracting the result to a general register).
     2325     * As there is no way around emulating the exact semantics of pmovmskb we will use the same algorithm
     2326     * as the sse2neon implementation because there we can get away with loading any constants and the
     2327     * base algorithm is only 4 NEON instructions (+ 3 for extracting the result to a general register).
    23202328     *
    23212329     * The following illustrates the algorithm:
     
    23472355    iemNativeRegFreeTmp(pReNative, idxRegTmp);
    23482356    iemNativeRegFreeTmp(pReNative, idxRegDst);
     2357
    23492358#else
    23502359# error "Port me"
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