fix(cpu): PPCBUG-040 PPCBUG-560 fix sh64() bit order and rldicl test helper
PPCBUG-040: decoder.rs sh64() assembled the XS-form shift amount as (SH[4:0] << 1) | SH[5] instead of (SH[5] << 5) | SH[4:0]. Every `sradi` with shift N ∈ 1..=62 executed with a completely wrong shift count (e.g. shift=32 executed as shift=1). PPCBUG-560: disasm_goldens.rs rldicl() test helper was encoding sh[5:1] at PPC bits 16-20 and sh[0] at PPC bit 30 — exactly backwards. The wrong encoder and wrong decoder cancelled out, hiding PPCBUG-040 from tests. Fix both together so tests validate ISA-correct encodings. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -182,7 +182,7 @@
|
||||
},
|
||||
{
|
||||
"label": "srdi r3, r4, 8",
|
||||
"raw": "0x7883E200",
|
||||
"raw": "0x7883C202",
|
||||
"addr": "0x82000000",
|
||||
"mnemonic": "rldicl",
|
||||
"operands": "r3, r4, 56, 8",
|
||||
@@ -191,7 +191,7 @@
|
||||
},
|
||||
{
|
||||
"label": "rotldi r3, r4, 8",
|
||||
"raw": "0x78832000",
|
||||
"raw": "0x78834000",
|
||||
"addr": "0x82000000",
|
||||
"mnemonic": "rldicl",
|
||||
"operands": "r3, r4, 8, 0",
|
||||
|
||||
Reference in New Issue
Block a user