diff options
| author | eyyun <eyyun@users.noreply.github.com> | 2026-11-23 01:07:58 +0300 |
|---|---|---|
| committer | eyyun <eyyun@users.noreply.github.com> | 2026-11-23 01:07:58 +0300 |
| commit | 863a9289befb6ef5f690e3efa635c711a9ee9cfe (patch) | |
| tree | 1c99c06630398d516a2ba89e9d7f0f8e40490424 /tools/mem_diff.py | |
| parent | d27d7d457a466a8f48223e4e8d574a9888b0dd61 (diff) | |
| parent | 376417b1acbd887f8426069d94e90e404f557920 (diff) | |
Merge #2701 (376417b1) to resolve tools/mem_diff.py conflict
Diffstat (limited to 'tools/mem_diff.py')
| -rw-r--r-- | tools/mem_diff.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/mem_diff.py b/tools/mem_diff.py index fc5a8b6e8..be42ebd7d 100644 --- a/tools/mem_diff.py +++ b/tools/mem_diff.py | |||
| @@ -243,7 +243,9 @@ class RefMachine: | |||
| 243 | for c in range(ncomp): | 243 | for c in range(ncomp): |
| 244 | self.v[vdata + c] = 0 | 244 | self.v[vdata + c] = 0 |
| 245 | return | 245 | return |
| 246 | name = "GFX10_FORMAT_" + fm.split("BUF_FMT_")[-1].rstrip("]") | 246 | # LLVM omits the default MTBUF instruction format from its listing. |
| 247 | fmt = DEFAULT_TBUFFER_FORMAT if fm is None else fm.split("BUF_FMT_")[-1].rstrip("]") | ||
| 248 | name = "GFX10_FORMAT_" + fmt | ||
| 247 | else: | 249 | else: |
| 248 | name = FORMAT_NAMES[descriptor_format] | 250 | name = FORMAT_NAMES[descriptor_format] |
| 249 | widths, kind = parse_format(name) | 251 | widths, kind = parse_format(name) |
| @@ -590,8 +592,10 @@ def gen_global_atomic(rng, prog): | |||
| 590 | return [("v", VDATA + 2 if glc else VDATA), ("v", VDATA + 3)] | 592 | return [("v", VDATA + 2 if glc else VDATA), ("v", VDATA + 3)] |
| 591 | 593 | ||
| 592 | 594 | ||
| 593 | # The five formats tbuffer loads use in the 1.0.2.1 corpus (counted over all 26,503 shaders). | 595 | DEFAULT_TBUFFER_FORMAT = "8_UNORM" |
| 594 | TBUFFER_FORMATS = ("16_16_SNORM", "8_8_8_8_UNORM", "8_8_8_8_UINT", "2_10_10_10_UNORM", "16_16_16_16_UINT") | 596 | # Exercise the implicit LLVM spelling alongside the five MTBUF formats found in the 1.0.2.1 corpus. |
| 597 | TBUFFER_FORMATS = ("16_16_SNORM", "8_8_8_8_UNORM", "8_8_8_8_UINT", "2_10_10_10_UNORM", "16_16_16_16_UINT", | ||
| 598 | DEFAULT_TBUFFER_FORMAT) | ||
| 595 | XYZW = 4 | 5 << 3 | 6 << 6 | 7 << 9 | 599 | XYZW = 4 | 5 << 3 | 6 << 6 | 7 << 9 |
| 596 | OOB_STRUCTURED, OOB_RAW = 1 << 28, 3 << 28 # V# word3 OOB_SELECT | 600 | OOB_STRUCTURED, OOB_RAW = 1 << 28, 3 << 28 # V# word3 OOB_SELECT |
| 597 | 601 | ||
| @@ -638,7 +642,8 @@ def gen_buffer_format(rng, prog): | |||
| 638 | addr_mods = "offen" | 642 | addr_mods = "offen" |
| 639 | vdata = reg_range("v", VDATA, ncomp) | 643 | vdata = reg_range("v", VDATA, ncomp) |
| 640 | if tbuffer: | 644 | if tbuffer: |
| 641 | prog.lines.append(f"tbuffer_load_format_{suffix} {vdata}, {operands} format:[BUF_FMT_{fname}] {addr_mods}") | 645 | format_mod = "" if fname == DEFAULT_TBUFFER_FORMAT else f" format:[BUF_FMT_{fname}]" |
| 646 | prog.lines.append(f"tbuffer_load_format_{suffix} {vdata}, {operands}{format_mod} {addr_mods}") | ||
| 642 | else: | 647 | else: |
| 643 | prog.lines.append(f"buffer_load_format_{suffix} {vdata}, {operands} {addr_mods}") | 648 | prog.lines.append(f"buffer_load_format_{suffix} {vdata}, {operands} {addr_mods}") |
| 644 | prog.lines.append("s_waitcnt vmcnt(0)") | 649 | prog.lines.append("s_waitcnt vmcnt(0)") |