VirtualBox

Ignore:
Timestamp:
Oct 28, 2024 2:31:35 PM (3 months ago)
Author:
vboxsync
Message:

Disassembler: Decode SIMD ldnp/stnp (no allocate register pair) instructions, bugref:10394

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/DisasmCore-armv8.cpp

    r106751 r106754  
    107107static FNDISPARSEARMV8 disArmV8ParseFpFixupFCvt;
    108108static FNDISPARSEARMV8 disArmV8ParseSimdRegSize;
     109static FNDISPARSEARMV8 disArmV8ParseSimdRegSize32;
    109110static FNDISPARSEARMV8 disArmV8ParseSimdRegSize64;
    110111static FNDISPARSEARMV8 disArmV8ParseSimdRegSize128;
     
    165166    disArmV8ParseFpFixupFCvt,
    166167    disArmV8ParseSimdRegSize,
     168    disArmV8ParseSimdRegSize32,
    167169    disArmV8ParseSimdRegSize64,
    168170    disArmV8ParseSimdRegSize128,
     
    681683static int disArmV8ParseSImmMemOff(PDISSTATE pDis, uint32_t u32Insn, PCDISARMV8OPCODE pOp, PCDISARMV8INSNCLASS pInsnClass, PDISOPPARAM pParam, PCDISARMV8INSNPARAM pInsnParm, bool *pf64Bit)
    682684{
    683     RT_NOREF(pDis, pInsnClass, pf64Bit);
     685    RT_NOREF(pInsnClass, pf64Bit);
    684686
    685687    AssertReturn(pInsnParm->cBits <= 7, VERR_INTERNAL_ERROR_2);
    686688    AssertReturn(   (pOp->fFlags & DISARMV8INSNCLASS_F_FORCED_32BIT)
    687                  || (pOp->fFlags & DISARMV8INSNCLASS_F_FORCED_64BIT),
     689                 || (pOp->fFlags & DISARMV8INSNCLASS_F_FORCED_64BIT)
     690                 || pDis->armv8.cbOperand != 0,
    688691                 VERR_INTERNAL_ERROR_2);
    689692    Assert(pParam->armv8.enmType != kDisArmv8OpParmNone);
     
    691694    pParam->armv8.cb = sizeof(int16_t);
    692695    pParam->armv8.u.offBase = disArmV8ExtractBitVecFromInsnSignExtend(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits);
    693     pParam->armv8.u.offBase <<= (pOp->fFlags & DISARMV8INSNCLASS_F_FORCED_32BIT) ? 2 : 3;
     696
     697    /** @todo Merge DISARMV8INSNCLASS_F_FORCED_32BIT | DISARMV8INSNCLASS_F_FORCED_64BIT into cbOperand. */
     698    if (pDis->armv8.cbOperand)
     699    {
     700        switch (pDis->armv8.cbOperand)
     701        {
     702            case sizeof(uint8_t): break;
     703            case sizeof(uint16_t): pParam->armv8.u.offBase <<= 1; break;
     704            case sizeof(uint32_t): pParam->armv8.u.offBase <<= 2; break;
     705            case sizeof(uint64_t): pParam->armv8.u.offBase <<= 3; break;
     706            case 16:               pParam->armv8.u.offBase <<= 4; break;
     707            default:
     708                AssertReleaseFailed();
     709        }
     710    }
     711    else
     712        pParam->armv8.u.offBase <<= (pOp->fFlags & DISARMV8INSNCLASS_F_FORCED_32BIT) ? 2 : 3;
    694713    return VINF_SUCCESS;
    695714}
     
    898917    }
    899918
     919    return VINF_SUCCESS;
     920}
     921
     922
     923static int disArmV8ParseSimdRegSize32(PDISSTATE pDis, uint32_t u32Insn, PCDISARMV8OPCODE pOp, PCDISARMV8INSNCLASS pInsnClass, PDISOPPARAM pParam, PCDISARMV8INSNPARAM pInsnParm, bool *pf64Bit)
     924{
     925    RT_NOREF(u32Insn, pOp, pInsnClass, pParam, pInsnParm, pf64Bit);
     926
     927    pDis->armv8.cbOperand = sizeof(uint32_t);
    900928    return VINF_SUCCESS;
    901929}
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