Changeset 106739 in vbox for trunk/src/VBox/Disassembler
- Timestamp:
- Oct 28, 2024 9:38:32 AM (3 months ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmCore-armv8.cpp
r106662 r106739 109 109 static FNDISPARSEARMV8 disArmV8ParseImmHImmB; 110 110 static FNDISPARSEARMV8 disArmV8ParseSf; 111 static FNDISPARSEARMV8 disArmV8ParseImmX16; 111 112 /** @} */ 112 113 … … 162 163 disArmV8ParseSimdRegScalar, 163 164 disArmV8ParseImmHImmB, 164 disArmV8ParseSf 165 disArmV8ParseSf, 166 disArmV8ParseImmX16 165 167 }; 166 168 … … 915 917 916 918 919 static int disArmV8ParseImmX16(PDISSTATE pDis, uint32_t u32Insn, PCDISARMV8OPCODE pOp, PCDISARMV8INSNCLASS pInsnClass, PDISOPPARAM pParam, PCDISARMV8INSNPARAM pInsnParm, bool *pf64Bit) 920 { 921 RT_NOREF(pDis, pOp, pInsnClass, pf64Bit); 922 923 AssertReturn(pInsnParm->idxBitStart + pInsnParm->cBits < 32, VERR_INTERNAL_ERROR_2); 924 Assert(pParam->armv8.enmType == kDisArmv8OpParmNone); 925 926 pParam->armv8.enmType = kDisArmv8OpParmImm; 927 pParam->uValue = disArmV8ExtractBitVecFromInsn(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits) * 16; 928 if (pParam->uValue <= UINT8_MAX) 929 { 930 pParam->armv8.cb = sizeof(uint8_t); 931 pParam->fUse |= DISUSE_IMMEDIATE8; 932 } 933 else if (pParam->uValue <= UINT16_MAX) 934 { 935 pParam->armv8.cb = sizeof(uint16_t); 936 pParam->fUse |= DISUSE_IMMEDIATE16; 937 } 938 else if (pParam->uValue <= UINT32_MAX) 939 { 940 pParam->armv8.cb = sizeof(uint32_t); 941 pParam->fUse |= DISUSE_IMMEDIATE32; 942 } 943 else 944 AssertReleaseFailed(); 945 946 return VINF_SUCCESS; 947 } 948 949 917 950 static uint32_t disArmV8DecodeIllegal(PDISSTATE pDis, uint32_t u32Insn, PCDISARMV8INSNCLASS pInsnClass) 918 951 { -
trunk/src/VBox/Disassembler/DisasmInternal-armv8.h
r106649 r106739 87 87 kDisParmParseImmHImmB, 88 88 kDisParmParseSf, 89 kDisParmParseImmX16, 89 90 kDisParmParseMax 90 91 } DISPARMPARSEIDX; -
trunk/src/VBox/Disassembler/DisasmTables-armv8-a64.cpp
r106737 r106739 177 177 178 178 179 /* ADD/ADDS/SUB/SUBS - shifted immediate variant */ 180 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER(AddSubImmTags) 181 DIS_ARMV8_INSN_DECODE(kDisParmParseGprSp, 0, 5, 0 /*idxParam*/), 182 DIS_ARMV8_INSN_DECODE(kDisParmParseGprSp, 5, 5, 1 /*idxParam*/), 183 DIS_ARMV8_INSN_DECODE(kDisParmParseImmX16, 16, 6, 2 /*idxParam*/), 184 DIS_ARMV8_INSN_DECODE(kDisParmParseImm, 10, 4, 3 /*idxParam*/), 185 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_BEGIN(AddSubImmTags) 186 DIS_ARMV8_OP(0x91800000, "addg", OP_ARMV8_A64_ADDG, DISOPTYPE_HARMLESS), /* FEAT_MTE */ 187 DIS_ARMV8_OP(0xd1800000, "subg" , OP_ARMV8_A64_SUBG, DISOPTYPE_HARMLESS), /* FEAT_MTE */ 188 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END(AddSubImmTags, 0xffc0c000 /*fFixedInsn*/, 189 kDisArmV8OpcDecodeNop, RT_BIT_32(30), 30); 190 191 179 192 /* 180 193 * C4.1.65 of the ARMv8 architecture reference manual has the following table for the … … 195 208 DIS_ARMV8_DECODE_MAP_ENTRY(Adr), 196 209 DIS_ARMV8_DECODE_MAP_ENTRY(AddSubImm), 197 DIS_ARMV8_DECODE_MAP_ INVALID_ENTRY, /** @todo Add/subtract immediate with tags. */210 DIS_ARMV8_DECODE_MAP_ENTRY(AddSubImmTags), 198 211 DIS_ARMV8_DECODE_MAP_ENTRY(LogicalImm), 199 212 DIS_ARMV8_DECODE_MAP_ENTRY(MoveWide), … … 297 310 DIS_ARMV8_OP(0xd503304f, "clrex", OP_ARMV8_A64_CLREX, DISOPTYPE_HARMLESS), 298 311 INVALID_OPCODE, 299 DIS_ARMV8_OP(0x D503309f, "dsb", OP_ARMV8_A64_DSB, DISOPTYPE_HARMLESS),312 DIS_ARMV8_OP(0xd503309f, "dsb", OP_ARMV8_A64_DSB, DISOPTYPE_HARMLESS), 300 313 DIS_ARMV8_OP(0xd50330bf, "dmb", OP_ARMV8_A64_DMB, DISOPTYPE_HARMLESS), 301 314 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END(DecBarriers, 0xfffff0ff /*fFixedInsn*/, … … 303 316 304 317 318 /* ISB */ 319 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER(Isb) 320 DIS_ARMV8_INSN_DECODE(kDisParmParseImm, 8, 4, 0 /*idxParam*/), 321 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_BEGIN(Isb) 322 DIS_ARMV8_OP(0xd50330df, "isb", OP_ARMV8_A64_ISB, DISOPTYPE_HARMLESS), 323 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END(Isb, 0xfffff0ff /*fFixedInsn*/, 324 kDisArmV8OpcDecodeNop, 0, 0); 325 326 327 /* SB */ 328 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER(Sb) 329 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_BEGIN(Sb) 330 DIS_ARMV8_OP(0xd50330ff, "sb", OP_ARMV8_A64_SB, DISOPTYPE_HARMLESS), /* FEAT_SB */ 331 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END(Sb, 0xffffffff /*fFixedInsn*/, 332 kDisArmV8OpcDecodeNop, 0, 0); 333 334 335 /* TCOMMIT */ 336 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER(TCommit) 337 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_BEGIN(TCommit) 338 DIS_ARMV8_OP(0xd503307f, "tcommit", OP_ARMV8_A64_TCOMMIT, DISOPTYPE_HARMLESS), /* FEAT_TME */ 339 DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END(TCommit, 0xffffffff /*fFixedInsn*/, 340 kDisArmV8OpcDecodeNop, 0, 0); 341 342 305 343 /* Barrier instructions, we divide these instructions further based on the op2 field. */ 306 344 DIS_ARMV8_DECODE_MAP_DEFINE_BEGIN(DecodeBarriers) 307 345 DIS_ARMV8_DECODE_MAP_INVALID_ENTRY, 308 DIS_ARMV8_DECODE_MAP_INVALID_ENTRY, /** @todo DSB - Encoding */346 DIS_ARMV8_DECODE_MAP_INVALID_ENTRY, /** @todo DSB - Encoding (FEAT_XS) */ 309 347 DIS_ARMV8_DECODE_MAP_ENTRY(DecBarriers), /* CLREX */ 310 DIS_ARMV8_DECODE_MAP_ INVALID_ENTRY, /** @todo TCOMMIT */348 DIS_ARMV8_DECODE_MAP_ENTRY(TCommit), 311 349 DIS_ARMV8_DECODE_MAP_ENTRY(DecBarriers), /* DSB - Encoding */ 312 350 DIS_ARMV8_DECODE_MAP_ENTRY(DecBarriers), /* DMB */ 313 DIS_ARMV8_DECODE_MAP_ INVALID_ENTRY, /** @todo ISB */314 DIS_ARMV8_DECODE_MAP_ INVALID_ENTRY /** @todo SB */351 DIS_ARMV8_DECODE_MAP_ENTRY(Isb), 352 DIS_ARMV8_DECODE_MAP_ENTRY(Sb), 315 353 DIS_ARMV8_DECODE_MAP_DEFINE_END(DecodeBarriers, RT_BIT_32(5) | RT_BIT_32(6) | RT_BIT_32(7), 5); 316 354 -
trunk/src/VBox/Disassembler/testcase/tstDisasmArmv8-1-asm.S
r106737 r106739 64 64 65 65 ;chkfeat x16 - Not supported by buildbox toolchain 66 67 ; Barrier instructions 68 69 isb #0 70 isb #8 71 isb #15 72 73 sb 74 75 ;tcommit - Requires FEAT_TME 66 76 67 77 ; Control flow instructions … … 1523 1533 ; msr svcrsma, #0 Not supported by the toolchain 1524 1534 1535 ; Add/subtract immediate with tags 1536 1537 ;addg x0, x1, #0, #0 - Requires FEAT_MTE 1538 ;addg sp, sp, #1008, #0x0f - Requires FEAT_MTE 1539 1540 ;subg x0, x1, #0, #0 - Requires FEAT_MTE 1541 ;subg sp, sp, #1008, #0x0f - Requires FEAT_MTE 1542 1525 1543 ; Floating Point instructions. 1526 1544 fmadd s0, s1, s3, s31
Note:
See TracChangeset
for help on using the changeset viewer.