diff options
Diffstat (limited to 'tools/rdna2_decode.py')
| -rw-r--r-- | tools/rdna2_decode.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/rdna2_decode.py b/tools/rdna2_decode.py index d66c1de2d..14195cfac 100644 --- a/tools/rdna2_decode.py +++ b/tools/rdna2_decode.py | |||
| @@ -374,7 +374,15 @@ def _format_dpp16_ctrl(ctrl: int) -> str: | |||
| 374 | return f"dpp_ctrl:0x{ctrl:x}" | 374 | return f"dpp_ctrl:0x{ctrl:x}" |
| 375 | 375 | ||
| 376 | 376 | ||
| 377 | def _format_ds_swizzle(offset16: int) -> str: | 377 | def _format_ds_swizzle(offset16: int) -> str | None: |
| 378 | if offset16 == 0: | ||
| 379 | return None | ||
| 380 | if offset16 >= 0xE000: | ||
| 381 | return f"offset:swizzle(FFT,{offset16 & 0x1F})" | ||
| 382 | if offset16 >= 0xC000: | ||
| 383 | direction = (offset16 >> 10) & 1 | ||
| 384 | size = (offset16 >> 5) & 0x1F | ||
| 385 | return f"offset:swizzle(ROTATE,{direction},{size})" | ||
| 378 | if (offset16 & 0x8000) == 0: | 386 | if (offset16 & 0x8000) == 0: |
| 379 | # Bitmask mode: bits [4:0] = and_mask, [9:5] = or_mask, [14:10] = xor_mask. | 387 | # Bitmask mode: bits [4:0] = and_mask, [9:5] = or_mask, [14:10] = xor_mask. |
| 380 | # Match LLVM's canonical aliases (SWAP, REVERSE, BROADCAST) before general BITMASK_PERM. | 388 | # Match LLVM's canonical aliases (SWAP, REVERSE, BROADCAST) before general BITMASK_PERM. |
| @@ -1107,9 +1115,11 @@ def _decode_one(code: bytes, pc: int, wave32: bool, mcpu: str) -> tuple[dict | N | |||
| 1107 | elif fn == "DATA1": | 1115 | elif fn == "DATA1": |
| 1108 | args.append(_vreg(data1, w)) | 1116 | args.append(_vreg(data1, w)) |
| 1109 | mods = [] | 1117 | mods = [] |
| 1110 | is_2addr = ("2_" in name or "2st64_" in name) | 1118 | is_2addr = name.startswith(("ds_read2", "ds_write2", "ds_wrxchg2")) |
| 1111 | if name == "ds_swizzle_b32": | 1119 | if name == "ds_swizzle_b32": |
| 1112 | mods.append(_format_ds_swizzle(offset0 | (offset1 << 8))) | 1120 | swz = _format_ds_swizzle(offset0 | (offset1 << 8)) |
| 1121 | if swz: | ||
| 1122 | mods.append(swz) | ||
| 1113 | elif is_2addr: | 1123 | elif is_2addr: |
| 1114 | if offset0: | 1124 | if offset0: |
| 1115 | mods.append(f"offset0:{offset0}") | 1125 | mods.append(f"offset0:{offset0}") |