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
Unknown Object (File)
Sun, Jun 16, 7:02 AM
Unknown Object (File)
Apr 20 2024, 3:44 AM
Unknown Object (File)
Feb 9 2024, 12:13 AM
Unknown Object (File)
Jan 2 2024, 4:24 AM
Unknown Object (File)
Dec 23 2023, 2:14 AM
Unknown Object (File)
Dec 12 2023, 3:06 AM
Unknown Object (File)
Dec 3 2023, 8:17 AM
Unknown Object (File)
Nov 21 2023, 3:31 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