VirtualBox

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


Ignore:
Timestamp:
Oct 30, 2024 8:44:32 AM (3 months ago)
Author:
vboxsync
Message:

Disassembler: Decode Load/Store exclusive pair instructions, bugref:10394

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

Legend:

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

    r106770 r106782  
    10041004
    10051005    Assert(pInsnParm->cBits == 1);
    1006     Assert(pInsnParm->idxBitStart == 31);
    1007     *pf64Bit = RT_BOOL(u32Insn & RT_BIT_32(31));
     1006    Assert(pInsnParm->idxBitStart == 31 || pInsnParm->idxBitStart == 30);
     1007    *pf64Bit = RT_BOOL(u32Insn & RT_BIT_32(pInsnParm->idxBitStart));
    10081008    return VINF_SUCCESS;
    10091009}
  • trunk/src/VBox/Disassembler/DisasmTables-armv8-a64-ld-st.cpp.h

    r106777 r106782  
    11701170
    11711171
    1172 /* C4.1.94.14 - Loads and Stores - Compare and swap */
     1172/* C4.1.94.11 - Loads and Stores - Load exclusive pair */
     1173DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER(LdStExclusivePair)
     1174    DIS_ARMV8_INSN_DECODE(kDisParmParseSf,            30,  1, DIS_ARMV8_INSN_PARAM_UNSET), /* Not exactly an SF bit but serves the same purpose. */
     1175    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr32,       16,  5, 0 /*idxParam*/),
     1176    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr,          0,  5, 1 /*idxParam*/),
     1177    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr,         10,  5, 2 /*idxParam*/),
     1178    DIS_ARMV8_INSN_DECODE(kDisParmParseAddrGprSp,      5,  5, 3 /*idxParam*/),
     1179DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER_ALTERNATIVE(LdStExclusiveRegLd)
     1180    DIS_ARMV8_INSN_DECODE(kDisParmParseSf,            30,  1, DIS_ARMV8_INSN_PARAM_UNSET), /* Not exactly an SF bit but serves the same purpose. */
     1181    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr,          0,  5, 0 /*idxParam*/),
     1182    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr,         10,  5, 1 /*idxParam*/),
     1183    DIS_ARMV8_INSN_DECODE(kDisParmParseAddrGprSp,      5,  5, 2 /*idxParam*/),
     1184DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_BEGIN(LdStExclusivePair)
     1185    DIS_ARMV8_OP(           0x88200000, "stxp",            OP_ARMV8_A64_STXP,      DISOPTYPE_HARMLESS),
     1186    DIS_ARMV8_OP(           0x88208000, "stlxp",           OP_ARMV8_A64_STLXP,     DISOPTYPE_HARMLESS),
     1187    DIS_ARMV8_OP_ALT_DECODE(0x88600000, "ldxp",            OP_ARMV8_A64_LDXP,      DISOPTYPE_HARMLESS, LdStExclusiveRegLd),
     1188    DIS_ARMV8_OP_ALT_DECODE(0x88608000, "ldaxp",           OP_ARMV8_A64_LDAXP,     DISOPTYPE_HARMLESS, LdStExclusiveRegLd),
     1189DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_END(LdStExclusivePair, 0xbfe08000 /*fFixedInsn*/,
     1190                                       kDisArmV8OpcDecodeCollate,
     1191                            /* o0 */     RT_BIT_32(15)
     1192                            /* L  */   | RT_BIT_32(22), 15);
     1193
     1194
     1195/* C4.1.94.14 - Loads and Stores - Load exclusive register */
    11731196DIS_ARMV8_DECODE_INSN_CLASS_DEFINE_DECODER(LdStExclusiveReg)
    11741197    DIS_ARMV8_INSN_DECODE(kDisParmParseGprZr32,       16,  5, 0 /*idxParam*/),
     
    12161239DIS_ARMV8_DECODE_MAP_DEFINE_BEGIN(LdStExclusive)
    12171240    DIS_ARMV8_DECODE_MAP_ENTRY(LdStExclusiveReg),
    1218     DIS_ARMV8_DECODE_MAP_INVALID_ENTRY, /** @todo DIS_ARMV8_DECODE_MAP_ENTRY(LdStExclusivePair), */
     1241    DIS_ARMV8_DECODE_MAP_ENTRY(LdStExclusivePair),
    12191242DIS_ARMV8_DECODE_MAP_DEFINE_END_SINGLE_BIT(LdStExclusive, 21);
    12201243
  • trunk/src/VBox/Disassembler/testcase/tstDisasmArmv8-1-asm.S

    r106777 r106782  
    38193819
    38203820        ;
     3821        ; Load/store exclusive pair
     3822        ;
     3823
     3824        stxp w0,  w1,  w2, [x3]
     3825        stxp w0, wzr, wzr, [sp]
     3826        stxp w0,  x1,  x2, [x3]
     3827        stxp w0, xzr, xzr, [sp]
     3828
     3829        stlxp w0,  w1,  w2, [x3]
     3830        stlxp w0, wzr, wzr, [sp]
     3831        stlxp w0,  x1,  x2, [x3]
     3832        stlxp w0, xzr, xzr, [sp]
     3833
     3834        ldxp  w1,  w2, [x0]
     3835        ldxp wzr, wzr, [sp]
     3836        ldxp  x1,  x2, [x0]
     3837        ldxp xzr, xzr, [sp]
     3838
     3839        ldaxp  w1,  w2, [x0]
     3840        ldaxp wzr, wzr, [sp]
     3841        ldaxp  x1,  x2, [x0]
     3842        ldaxp xzr, xzr, [sp]
     3843
     3844        ;
    38213845        ; Keep last so the testcase can catch errors in
    38223846        ; the disassembly of the last instruction.
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