Commit Graph

11 Commits

Author SHA1 Message Date
1089113429 Merge pull request #2747 from IAmNotSiob 2026-11-22 15:11:34 -05:00
52f7466f9d Merge pull request #2540 from Vonsek 2026-11-22 13:16:01 -05:00
156038e6e2 Merge pull request #2506 from jvinpe 2026-11-22 13:15:48 -05:00
ee0253c1fb isa_coverage: count op.endswith dispatch families (s_*_saveexec_b32/b64) 2026-11-22 19:08:21 +01:00
bf6774f8f4 fix(tools): distinguish LLVM probe failures from opcode support
The ISA coverage report treated an unavailable compiler target as proof that each probed instruction was accepted.
2026-11-22 18:24:51 +01:00
15a6cdb492 isa_coverage: an XML file with no instructions is one error line, not a ZeroDivisionError
A well-formed XML that is not the spec (<a/>, <isa><ISA/></isa>) parsed clean, came back with
zero instructions, and markdown() divided the class shares by that zero. Check for an empty
instruction set in main and report through ap.error, the tool's pattern for bad input (exit 2,
one line, the path and a reason). Probed 13 malformed structures: only the zero-instruction
divide escaped, no AttributeError or KeyError. Adds the case to tests/test_bad_input_errors.py;
it fails without the change (3 failures, a traceback each) and passes with it.

AI-assisted: written by Qwen (model qwen3.8-gx10-claude-compatible).
Co-Authored-By: Qwen qwen3.8-gx10-claude-compatible <noreply@qwen.ai>
2026-11-22 14:12:24 -03:00
0273fb4acc isa_coverage: an unreadable or malformed --isa or --translator file is one error line, not a traceback
A missing, directory or unparsable --isa died in ET.parse, and a missing, directory or
non-UTF-8 --translator died in the open() of scan_translator: tracebacks for inputs a
user can mistype. Catch OSError, UnicodeDecodeError and ET.ParseError around the calls
in main and report through ap.error, the tool's existing pattern (exit 2, one line, the
path and a reason), leaving the functions and the classification untouched. Adds five
cases to tests/test_bad_input_errors.py; they fail without the change and pass with it.

AI-assisted: written by Qwen (model qwen3.8-gx10-claude-compatible).
Co-Authored-By: Qwen qwen3.8-gx10-claude-compatible <noreply@qwen.ai>
2026-11-22 14:06:53 -03:00
ca935bb734 isa_coverage: exclude non-expr AST singletons from accepted_names skip set
In Python's ast module, ast.Load() and operator tokens are singletons. When a refused branch used a tuple comparator (such as op in ('s_denorm_mode', 's_round_mode')), accepted_names() recorded id(ast.Load()) in skip and _in_skipped() then rejected every tuple/list comparator in the file (dropping 212 of 492 accepted exact mnemonics in tools/rdna2spirv.py).

Also avoid descending into ast.Not when positive_only=True and separate unconditional opcode refusals from operand-guarded 'and' checks (which belong in partial, not refused).

Claim: https://github.com/ItsNotRexed/Leonida/issues/2300#issuecomment-7082476941
2026-11-22 14:01:59 -03:00
6290b0acd4 isa_coverage: allow v_mac_legacy_f32 (gfx1013 VOP2, missing from AMD's XML); counts at current main; wrap long lines
v_mac_legacy_f32 came in with 58706b5b; llvm-mc accepts it for gfx1013 (v_mac_legacy_f32_e32).
The docs give the counts with the commit they were taken at, and the README row no longer
quotes numbers that every new rule changes. Reported by @josevictorp in #1562.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:53:11 +01:00
2e4d5604a7 isa_coverage: replace unencodable stdout characters, like the other tools (#1428)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:34:21 +01:00
e901a7b99a tools: isa_coverage.py, RDNA2 ISA coverage of the translator from AMD's XML
Reads AMD's machine-readable RDNA2 ISA spec (path given with --isa, not vendored), scans
tools/rdna2spirv.py statically with ast and reports, per encoding, which instructions have a
rule, are refused or are unknown, plus every matched name that is not an RDNA2 instruction.
Tests use a small hand-written fixture; the real-XML test skips without LEONIDA_RDNA2_ISA_XML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:14:44 +01:00