Page MenuHomeFreeBSD

arm64/disassem.c: add extended register instruction definitions
AcceptedPublic

Authored by koliagogsadze_gmail.com on Jul 10 2023, 11:16 PM.
Tags
None
Referenced Files
F108592562: D40967.id124464.diff
Sun, Jan 26, 6:01 PM
Unknown Object (File)
Fri, Jan 24, 5:46 PM
Unknown Object (File)
Dec 7 2024, 9:44 AM
Unknown Object (File)
Dec 4 2024, 3:23 AM
Unknown Object (File)
Dec 4 2024, 3:00 AM
Unknown Object (File)
Nov 24 2024, 8:14 PM
Unknown Object (File)
Nov 20 2024, 9:01 AM
Unknown Object (File)
Oct 2 2024, 5:41 AM
Subscribers

Details

Reviewers
mhorne
andrew
manu
Summary

Add disassembly support for the following extended register instructions:

  • add
  • adds
  • sub
  • subs
  • cmp
  • cmn
Test Plan

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52656
Build 49547: arc lint + arc unit

Event Timeline

Looks good overall, this is definitely the appropriate time to use TYPE_04.

sys/arm64/arm64/disassem.c
76

So these are extend types, not register names. This array needs a better name...

279

Ordering is not super important, but you put add before cmn, why not sub before cmp?

434

Regarding LSL logic, I see only the following:

If "Rn" is '11111' (WSP) and "option" is '010' then LSL is preferred, but may be omitted when "imm3" is '000'. In all other cases <extend> is required and must be UXTW when "option" is '010'.

Why do you have rd == 31 ?

474–493

I think it is just fine to have these expanded inline rather than add new helper functions.

sys/arm64/arm64/disassem.c
434

there are two cases:

OP <RD>, <RN|SP>, <RM> {, <extend> { #<amount> } }
OP <RN|SP>, <RM>, {, <extend> { #<amount> } }

example: https://developer.arm.com/documentation/ddi0596/2020-12/Base-Instructions/SUB--extended-register---Subtract--extended-register--

SUB <Xd|SP>, <Xn|SP>, <R><m>{, <extend> {#<amount>}}

If "Rd" or "Rn" is '11111' (WSP) and "option" is '010' then LSL is preferred, but may be omitted when "imm3" is '000'. In all other cases <extend> is required and must be UXTW when "option" is '010'.

474–493

ok, will update

sys/arm64/arm64/disassem.c
76

I agree with you, I think I was too focused on the "OP (extended register)" :)

279

there is no explanation, for consistency I will update

Removed helper functions and fixed naming and order of definitions

Thanks, I will commit this today!

This revision is now accepted and ready to land.Jul 24 2023, 2:11 PM