- Timestamp:
- Aug 21, 2024 5:23:15 PM (3 months ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmCore-armv8.cpp
r105779 r105785 88 88 static FNDISPARSEARMV8 disArmV8ParseShift; 89 89 static FNDISPARSEARMV8 disArmV8ParseShiftAmount; 90 static FNDISPARSEARMV8 disArmV8ParseImmMemOff; 90 91 /** @} */ 91 92 … … 119 120 disArmV8ParseImmTbz, 120 121 disArmV8ParseShift, 121 disArmV8ParseShiftAmount 122 disArmV8ParseShiftAmount, 123 disArmV8ParseImmMemOff 122 124 }; 123 125 … … 242 244 pParam->armv8.Reg.idxGenReg = disArmV8ExtractBitVecFromInsn(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits); 243 245 pParam->armv8.cb = *pf64Bit ? sizeof(uint64_t) : sizeof(uint32_t); 244 pParam->fUse |= (*pf64Bit || (p InsnParm->fFlags & (DIS_ARMV8_INSN_PARAM_F_ADDR_BEGIN | DIS_ARMV8_INSN_PARAM_F_ADDR_END)))246 pParam->fUse |= (*pf64Bit || (pParam->armv8.enmType == kDisArmv8OpParmAddrInGpr)) 245 247 ? DISUSE_REG_GEN64 246 248 : DISUSE_REG_GEN32; … … 420 422 421 423 424 static int disArmV8ParseImmMemOff(PDISSTATE pDis, uint32_t u32Insn, PCDISARMV8INSNCLASS pInsnClass, PDISOPPARAM pParam, PCDISARMV8INSNPARAM pInsnParm, bool *pf64Bit) 425 { 426 RT_NOREF(pDis, pInsnClass, pf64Bit); 427 428 AssertReturn(pInsnParm->cBits <= 12, VERR_INTERNAL_ERROR_2); 429 430 uint8_t const uScale = *pf64Bit ? 8 : 4; 431 pParam->armv8.offBase = disArmV8ExtractBitVecFromInsn(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits) * uScale; 432 pParam->armv8.cb = sizeof(uint16_t); 433 return VINF_SUCCESS; 434 } 435 436 422 437 static uint32_t disArmV8DecodeIllegal(PDISSTATE pDis, uint32_t u32Insn, PCDISARMV8INSNCLASS pInsnClass) 423 438 { -
trunk/src/VBox/Disassembler/DisasmFormatArmV8.cpp
r105779 r105785 713 713 break; 714 714 } 715 case kDisArmv8OpParmAddrInGpr: 716 { 717 PUT_C('['); 718 719 size_t cchReg; 720 const char *pszReg = disasmFormatArmV8Reg(pDis, pParam, &cchReg); 721 PUT_STR(pszReg, cchReg); 722 723 if (pParam->armv8.offBase) 724 { 725 PUT_SZ(", #"); 726 PUT_NUM_16(pParam->armv8.offBase); 727 } 728 729 PUT_C(']'); 730 break; 731 } 715 732 default: 716 733 AssertFailed(); -
trunk/src/VBox/Disassembler/DisasmInternal-armv8.h
r105779 r105785 66 66 kDisParmParseShift, 67 67 kDisParmParseShiftAmount, 68 kDisParmParseImmMemOff, 68 69 kDisParmParseMax 69 70 } DISPARMPARSEIDX; … … 91 92 /** The parser to use for the parameter. */ 92 93 DISPARMPARSEIDX idxParse; 93 /** Additional flags for the parameter. */94 uint32_t fFlags;95 94 /** Bit index at which the field starts. */ 96 95 uint8_t idxBitStart; … … 103 102 typedef const DISARMV8INSNPARAM *PCDISARMV8INSNPARAM; 104 103 105 #define DIS_ARMV8_INSN_PARAM_NONE { kDisParmParseNop, 0, 0, 0,DIS_ARMV8_INSN_PARAM_UNSET }104 #define DIS_ARMV8_INSN_PARAM_NONE { kDisParmParseNop, 0, 0, DIS_ARMV8_INSN_PARAM_UNSET } 106 105 #define DIS_ARMV8_INSN_PARAM_CREATE(a_idxParse, a_idxBitStart, a_cBits, a_idxParam) \ 107 { a_idxParse, 0, a_idxBitStart, a_cBits, a_idxParam } 108 #define DIS_ARMV8_INSN_PARAM_CREATE_EX(a_idxParse, a_idxBitStart, a_cBits, a_idxParam, a_fFlags) \ 109 { a_idxParse, a_fFlags, a_idxBitStart, a_cBits, a_idxParam } 106 { a_idxParse, a_idxBitStart, a_cBits, a_idxParam } 110 107 111 108 #define DIS_ARMV8_INSN_PARAM_UNSET UINT8_MAX 112 113 #define DIS_ARMV8_INSN_PARAM_F_ADDR_BEGIN RT_BIT_32(0)114 #define DIS_ARMV8_INSN_PARAM_F_ADDR_END RT_BIT_32(1)115 109 116 110 /** -
trunk/src/VBox/Disassembler/DisasmTables-armv8-a64.cpp
r105779 r105785 522 522 kDisArmV8OpcDecodeLookup, 0xbfc00000, 0, 523 523 kDisArmv8OpParmGpr, kDisArmv8OpParmAddrInGpr) 524 DIS_ARMV8_INSN_PARAM_CREATE( 525 DIS_ARMV8_INSN_PARAM_CREATE( 526 DIS_ARMV8_INSN_PARAM_CREATE _EX(kDisParmParseReg, 5, 5, 1 /*idxParam*/, DIS_ARMV8_INSN_PARAM_F_ADDR_BEGIN),527 DIS_ARMV8_INSN_PARAM_CREATE _EX(kDisParmParseImm, 10, 12, 2 /*idxParam*/, DIS_ARMV8_INSN_PARAM_F_ADDR_END),524 DIS_ARMV8_INSN_PARAM_CREATE(kDisParmParseIs32Bit, 30, 1, DIS_ARMV8_INSN_PARAM_UNSET), 525 DIS_ARMV8_INSN_PARAM_CREATE(kDisParmParseReg, 0, 5, 0 /*idxParam*/), 526 DIS_ARMV8_INSN_PARAM_CREATE(kDisParmParseReg, 5, 5, 1 /*idxParam*/), 527 DIS_ARMV8_INSN_PARAM_CREATE(kDisParmParseImmMemOff, 10, 12, 1 /*idxParam*/), 528 528 DIS_ARMV8_INSN_PARAM_NONE 529 529 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END; -
trunk/src/VBox/Disassembler/testcase/tstDisasmArmv8-1-asm.S
r105779 r105785 280 280 bics x0, x1, x28, ROR #63 281 281 282 ; Memory loads 283 ldr x0, [x28] 284 ldr x0, [x28, #8] 285 ldr x0, [x28, #32760] 286 287 ldr w0, [x28] 288 ldr w0, [x28, #4] 289 ldr w0, [x28, #16380] 290 291 ; Memory stores 292 str x0, [x28] 293 str x0, [x28, #8] 294 str x0, [x28, #32760] 295 296 str w0, [x28] 297 str w0, [x28, #4] 298 str w0, [x28, #16380] 299 282 300 ; 283 301 ; Keep last so the testcase can catch errors in
Note:
See TracChangeset
for help on using the changeset viewer.