Skip to content

Don't decode SH-4 fcnvds and fcnvsd with an odd DRn ##disasm - #27313

Merged
trufae merged 1 commit into
radareorg:masterfrom
Thanatos9404:sh4-fcnv-even-regs
Nov 3, 2026
Merged

trufae merged 1 commit into
radareorg:masterfrom
Thanatos9404:sh4-fcnv-even-regs

Conversation

@Thanatos9404

Copy link
Copy Markdown
Contributor
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some lines in the book (optional)

Description

Follow-up to #27308. fcnvds and fcnvsd only take a double register, so bit 8 of the encoding is 0 (1111nnn010111101 and 1111nnn010101101). The table matched any nibble, so f1bd printed fcnvds dr1, fpul and ffad printed fcnvsd fpul, dr15, registers that do not exist.

Both rows now use REG_N_D, as binutils does and as the fsca row already does. No other SH-4 instruction uses those words, so they print the usual .word fallback.

Testing

  • test/db/asm/sh: even registers in both byte orders, plus the odd encodings. The 4 odd-register lines fail on master.
  • r2r db/asm: 0 failures. sys/lint.py --all is clean.

fcnvds and fcnvsd only take a double register, so bit 8 of the
encoding must be 0 (1111nnn0...). The table matched any nibble and
printed registers that do not exist, such as dr1 and dr15. Use
REG_N_D for both rows, as binutils does and as fsca already does.
@trufae
trufae merged commit fcca50a into radareorg:master Nov 3, 2026
48 of 50 checks passed
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.

2 participants