VirtualBox

Changeset 106744 in vbox for trunk/src/VBox/Disassembler


Ignore:
Timestamp:
Oct 28, 2024 12:06:08 PM (6 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165628
Message:

Disassembler: Calculate final displacement in the core already, some preparations for SIMD loads/stores, bugref:10394

Location:
trunk/src/VBox/Disassembler
Files:
2 edited

Legend:

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

    r106739 r106744  
    264264
    265265    pParam->armv8.enmType = kDisArmv8OpParmImmRel;
    266     pParam->uValue = (int64_t)disArmV8ExtractBitVecFromInsnSignExtend(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits);
     266    pParam->uValue = (int64_t)disArmV8ExtractBitVecFromInsnSignExtend(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits) * sizeof(uint32_t);
    267267    if (pInsnParm->cBits <= 8)
    268268    {
  • trunk/src/VBox/Disassembler/DisasmFormatArmV8.cpp

    r106657 r106744  
    6969    "h0\0",  "h1\0",  "h2\0",  "h3\0",  "h4\0",  "h5\0",  "h6\0",  "h7\0",  "h8\0",  "h9\0",  "h10",  "h11",  "h12",  "h13",  "h14",  "h15",
    7070    "h16",   "h17",   "h18",   "h19",   "h20",   "h21",   "h22",   "h23",   "h24",   "h25",   "h26",  "h27",  "h28",  "h29",  "h30",  "h31"
     71};
     72static const char g_aszArmV8RegSimdScalar8Bit[32][4] =
     73{
     74    "b0\0",  "b1\0",  "b2\0",  "b3\0",  "b4\0",  "b5\0",  "b6\0",  "b7\0",  "b8\0",  "b9\0",  "b10",  "b11",  "b12",  "b13",  "b14",  "b15",
     75    "b16",   "b17",   "b18",   "b19",   "b20",   "b21",   "b22",   "b23",   "b24",   "b25",   "b26",  "b27",  "b28",  "b29",  "b30",  "b31"
    7176};
    7277static const char g_aszArmV8RegSimdScalar128Bit[32][4] =
     
    362367            return psz;
    363368        }
     369        case kDisOpParamArmV8RegType_Simd_Scalar_32Bit:
    364370        case kDisOpParamArmV8RegType_FpReg_Single:
    365371        {
     
    378384            return psz;
    379385        }
     386        case kDisOpParamArmV8RegType_Simd_Scalar_16Bit:
    380387        case kDisOpParamArmV8RegType_FpReg_Half:
    381388        {
     
    383390            Assert(pReg->idReg < RT_ELEMENTS(g_aszArmV8RegFpHalf));
    384391            const char *psz = g_aszArmV8RegFpHalf[pReg->idReg];
     392            *pcchReg = 2 + !!psz[2];
     393            return psz;
     394        }
     395        case kDisOpParamArmV8RegType_Simd_Scalar_8Bit:
     396        {
     397            Assert(pReg->idReg < RT_ELEMENTS(g_aszArmV8RegSimdScalar8Bit));
     398            const char *psz = g_aszArmV8RegSimdScalar8Bit[pReg->idReg];
    385399            *pcchReg = 2 + !!psz[2];
    386400            return psz;
     
    734748                        offDisplacement = (int8_t)pParam->uValue;
    735749                        if (fFlags & DIS_FMT_FLAGS_RELATIVE_BRANCH)
    736                             PUT_NUM_S8(offDisplacement * sizeof(uint32_t));
     750                            PUT_NUM_S8(offDisplacement);
    737751                    }
    738752                    else if (pParam->fUse & DISUSE_IMMEDIATE16_REL)
     
    740754                        offDisplacement = (int16_t)pParam->uValue;
    741755                        if (fFlags & DIS_FMT_FLAGS_RELATIVE_BRANCH)
    742                             PUT_NUM_S16(offDisplacement * sizeof(uint32_t));
     756                            PUT_NUM_S16(offDisplacement);
    743757                    }
    744758                    else
     
    746760                        offDisplacement = (int32_t)pParam->uValue;
    747761                        if (fFlags & DIS_FMT_FLAGS_RELATIVE_BRANCH)
    748                             PUT_NUM_S32(offDisplacement * sizeof(uint32_t));
     762                            PUT_NUM_S32(offDisplacement);
    749763                    }
    750764                    if (fFlags & DIS_FMT_FLAGS_RELATIVE_BRANCH)
    751765                        PUT_SZ(" ; (");
    752766
    753                     RTUINTPTR uTrgAddr = pDis->uInstrAddr + (offDisplacement * sizeof(uint32_t));
     767                    RTUINTPTR uTrgAddr = pDis->uInstrAddr + offDisplacement;
    754768                    if (   pDis->uCpuMode == DISCPUMODE_ARMV8_A32
    755769                        || pDis->uCpuMode == DISCPUMODE_ARMV8_T32)
Note: See TracChangeset for help on using the changeset viewer.

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