VirtualBox

Changeset 106631 in vbox


Ignore:
Timestamp:
Oct 23, 2024 5:45:19 PM (5 weeks ago)
Author:
vboxsync
Message:

Disassembler: Decode data processing 1-source instructions, bugref:10394

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/disopcode-armv8.h

    r106627 r106631  
    5151     * @{ */
    5252    OP_ARMV8_INVALID = 0,
     53    OP_ARMV8_A64_ABS,
    5354    OP_ARMV8_A64_ADC,
    5455    OP_ARMV8_A64_ADCS,
     
    131132    OP_ARMV8_A64_CMPP,
    132133    OP_ARMV8_A64_CNEG,
     134    OP_ARMV8_A64_CNT,
    133135    OP_ARMV8_A64_CPP,
    134136    /** @todo FEAT_MOPS instructions (CPYFP and friends). */
     
    147149    OP_ARMV8_A64_CSINC,
    148150    OP_ARMV8_A64_CSNEG,
     151    OP_ARMV8_A64_CTZ,
    149152    OP_ARMV8_A64_DC,
    150153    OP_ARMV8_A64_DCPS1,
  • trunk/src/VBox/Disassembler/DisasmTables-armv8-a64.cpp

    r106627 r106631  
    564564    DIS_ARMV8_OP(0x1ac06c00, "umin",            OP_ARMV8_A64_UMIN,      DISOPTYPE_HARMLESS),
    565565DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END_PARAMS_3(Reg2Src32Bit, 0xffe0fc00 /*fFixedInsn*/, kDisArmV8OpcDecodeNop,
    566                                                 RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT_32(13) | RT_BIT_32(14) | RT_BIT_32(14), 10,
     566                                                RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT_32(13) | RT_BIT_32(14) | RT_BIT_32(15), 10,
    567567                                                kDisArmv8OpParmReg, kDisArmv8OpParmReg, kDisArmv8OpParmReg);
    568568
     
    619619    DIS_ARMV8_OP(           0x9ac06c00, "umin",            OP_ARMV8_A64_UMIN,      DISOPTYPE_HARMLESS)
    620620DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END_PARAMS_3(Reg2Src64Bit, 0xffe0fc00 /*fFixedInsn*/, kDisArmV8OpcDecodeNop,
    621                                                 RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT_32(13) | RT_BIT_32(14) | RT_BIT_32(14), 10,
     621                                                RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT_32(13) | RT_BIT_32(14) | RT_BIT_32(15), 10,
    622622                                                kDisArmv8OpParmReg, kDisArmv8OpParmReg, kDisArmv8OpParmReg);
    623623
     
    631631    DIS_ARMV8_OP(0xbac00000, "subps",           OP_ARMV8_A64_SUBPS,     DISOPTYPE_HARMLESS),
    632632DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END_PARAMS_3(Subps, 0xffe0fc00 /*fFixedInsn*/, kDisArmV8OpcDecodeNop,
    633                                                 RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT_32(13) | RT_BIT_32(14) | RT_BIT_32(14), 10,
     633                                                RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT_32(13) | RT_BIT_32(14) | RT_BIT_32(15), 10,
    634634                                                kDisArmv8OpParmReg, kDisArmv8OpParmReg, kDisArmv8OpParmReg);
    635635
     
    658658
    659659
     660/* RBIT/REV16/REV/CLZ/CLS/CTZ/CNT/ABS/REV32 */
     661DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER(Reg1SrcInsn)
     662    DIS_ARMV8_INSN_DECODE(kDisParmParseSf,            31,  1, DIS_ARMV8_INSN_PARAM_UNSET),
     663    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr,          0,  5, 0 /*idxParam*/),
     664    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr,          5,  5, 1 /*idxParam*/),
     665DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_BEGIN(Reg1SrcInsn)
     666    DIS_ARMV8_OP(0x5ac00000, "rbit",            OP_ARMV8_A64_RBIT,      DISOPTYPE_HARMLESS),
     667    DIS_ARMV8_OP(0x5ac00400, "rev16",           OP_ARMV8_A64_REV16,     DISOPTYPE_HARMLESS),
     668    DIS_ARMV8_OP(0x5ac00800, "rev",             OP_ARMV8_A64_REV,       DISOPTYPE_HARMLESS), /** @todo REV32 if SF1 is 1 (why must this be so difficult ARM?). */
     669    DIS_ARMV8_OP(0x5ac00c00, "rev",             OP_ARMV8_A64_REV,       DISOPTYPE_HARMLESS), /** @todo SF must be 1, otherwise unallocated. */
     670    DIS_ARMV8_OP(0x5ac01000, "clz",             OP_ARMV8_A64_CLZ,       DISOPTYPE_HARMLESS),
     671    DIS_ARMV8_OP(0x5ac01400, "cls",             OP_ARMV8_A64_CLS,       DISOPTYPE_HARMLESS),
     672    DIS_ARMV8_OP(0x5ac01800, "ctz",             OP_ARMV8_A64_CTZ,       DISOPTYPE_HARMLESS),
     673    DIS_ARMV8_OP(0x5ac01c00, "cnt",             OP_ARMV8_A64_CNT,       DISOPTYPE_HARMLESS),
     674    DIS_ARMV8_OP(0x5ac02000, "abs",             OP_ARMV8_A64_ABS,       DISOPTYPE_HARMLESS),
     675DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END_PARAMS_2(Reg1SrcInsn, 0x7ffffc00 /*fFixedInsn*/, kDisArmV8OpcDecodeNop,
     676                                                RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT_32(13) | RT_BIT_32(14) | RT_BIT_32(15), 10,
     677                                                kDisArmv8OpParmReg, kDisArmv8OpParmReg);
     678
     679
     680/**
     681 * C4.1.95 - Data Processing - Register - 1-source
     682 *
     683 * Differentiate between standard and FEAT_PAuth instructions based on opcode2 field.
     684 */
     685DIS_ARMV8_DECODE_MAP_DEFINE_BEGIN(Reg1Src)
     686    DIS_ARMV8_DECODE_MAP_ENTRY(Reg1SrcInsn),          /* Data-processing (1-source) */
     687    DIS_ARMV8_DECODE_MAP_INVALID_ENTRY,               /* Data-processing (1-source, FEAT_PAuth) */
     688DIS_ARMV8_DECODE_MAP_DEFINE_END_SINGLE_BIT(Reg1Src, 16);
     689
     690
    660691/**
    661692 * C4.1.95 - Data Processing - Register - 2-source / 1-source
     
    665696DIS_ARMV8_DECODE_MAP_DEFINE_BEGIN(Reg2Src1Src)
    666697    DIS_ARMV8_DECODE_MAP_ENTRY(Reg2SrcSubps),        /* Data-processing (2-source) */
    667     DIS_ARMV8_DECODE_MAP_INVALID_ENTRY,              /** @todo Data-processing (1-source) */
     698    DIS_ARMV8_DECODE_MAP_ENTRY(Reg1Src),             /* Data-processing (1-source) */
    668699DIS_ARMV8_DECODE_MAP_DEFINE_END_SINGLE_BIT(Reg2Src1Src, 30);
    669700
  • trunk/src/VBox/Disassembler/testcase/tstDisasmArmv8-1-asm.S

    r106627 r106631  
    12751275        ;subp  x0, sp, sp - Requires FEAT_MTE
    12761276
     1277        ;gmi   x0, x1, x3  - Requires FEAT_MTE
     1278        ;gmi   x0, sp, x3  - Requires FEAT_MTE
     1279
     1280        ;irg   x0, x1, x3  - Requires FEAT_MTE
     1281        ;irg   x0, x1, xzr - Requires FEAT_MTE
     1282        ;irg   sp, sp, x3  - Requires FEAT_MTE
     1283        ;irg   sp, sp, xzr - Requires FEAT_MTE
     1284
    12771285        udiv w0, w1, wzr
    12781286        udiv x0, x1, xzr
     
    13181326        ;smin w0, w1, wzr - Requires FEAT_CSSC
    13191327        ;smin x0, x1, xzr - Requires FEAT_CSSC
     1328
     1329        rbit w0, wzr
     1330        rbit w0, w1
     1331        rbit x0, xzr
     1332        rbit x0, x1
     1333
     1334        rev16 w0, wzr
     1335        rev16 w0, w1
     1336        rev16 x0, xzr
     1337        rev16 x0, x1
     1338
     1339        rev   w0, wzr
     1340        rev   w0, w1
     1341        rev   x0, xzr
     1342        rev   x0, x1
     1343
     1344        ; @todo rev32
     1345
     1346        clz   w0, wzr
     1347        clz   w0, w1
     1348        clz   x0, xzr
     1349        clz   x0, x1
     1350
     1351        cls   w0, wzr
     1352        cls   w0, w1
     1353        cls   x0, xzr
     1354        cls   x0, x1
     1355
     1356        ;ctz   w0, wzr - Requires FEAT_CSSC
     1357        ;ctz   w0, w1  - Requires FEAT_CSSC
     1358        ;ctz   x0, xzr - Requires FEAT_CSSC
     1359        ;ctz   x0, x1  - Requires FEAT_CSSC
     1360
     1361        ;cnt   w0, wzr - Requires FEAT_CSSC
     1362        ;cnt   w0, w1  - Requires FEAT_CSSC
     1363        ;cnt   x0, xzr - Requires FEAT_CSSC
     1364        ;cnt   x0, x1  - Requires FEAT_CSSC
    13201365
    13211366        ;
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