Skip to content

[thumb2] lift SMLAxy instructions#8119

Open
grant-h wants to merge 2 commits into
Vector35:devfrom
grant-h:thumb2_smla
Open

[thumb2] lift SMLAxy instructions#8119
grant-h wants to merge 2 commits into
Vector35:devfrom
grant-h:thumb2_smla

Conversation

@grant-h

@grant-h grant-h commented Apr 23, 2026

Copy link
Copy Markdown

Added IL definitions for Thumb2 SMLABB, SMLABT, SMLATB, and SMLATT instructions. (my binary has over 100 of these)
Added test for SMLABB lifting.,

@CLAassistant

CLAassistant commented Apr 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@grant-h

grant-h commented Apr 24, 2026

Copy link
Copy Markdown
Author
image

@zznop

zznop commented Jun 23, 2026

Copy link
Copy Markdown
Member

Thank you for the PR. I have a branch that includes lifting expansion for many unimplemented thumb/ARM instructions. In this branch I chose to lift these instructions with intrinsics.

10fb01b6   smlabb  r6, r0, r1, r11

LLIL

r6, flag:q = __smlabb(r0, r1, r11)

MLIL

r6, q_28 = __smlabb(source1: r0_69, source2: r1_6, accumulator: r11_1)

I chose an intrinsic primarily because the decompilation is cleaner. I'm not necessarily opposed to lifting it directly, but in your current implementation the Q flag set doesn't appear to be modeled.

For reference:

if ConditionPassed() then
    EncodingSpecificOperations();
    operand1 = if n_high then R[n]<31:16> else R[n]<15:0>;
    operand2 = if m_high then R[m]<31:16> else R[m]<15:0>;
    result = SInt(operand1) * SInt(operand2) + SInt(R[a]);
    R[d] = result<31:0>;
    if result != SInt(result<31:0>) then  // Signed overflow
        APSR.Q = '1';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants