feat: opérandes RDNA 2 au format LLVM #43

Manually merged
github merged 1 commit from gh-pr/43/head into gh-pr/43/base 2026-11-26 05:27:20 +00:00
Owner

@⁠LooperSalty on GitHub · 2026-11-21 16:20 UTC · original
LooperSalty:feat/rdna2-operandes → main · +1087 −27 · 15 files · 1 commits · merged 2026-11-21 16:21 UTC

Résumé

  • emu/rdna2_operands.py décode les opérandes :
    • registres SGPR/VGPR, ttmp, vcc et exec ;
    • constantes en ligne, littéraux ;
    • immédiats hwreg(...) et s_waitcnt.
  • tools/rdna2_shapes.py apprend la forme de chaque opcode sur les tests publics de LLVM et mesure la conformité : 99,4 % des 8 204 lignes wave32 identiques à LLVM. SOP1, SOP2, SOPC, SOPK, VOP1 et VOPC sont à 100 %.
  • Écarts restants :
    • 18 en VOP2 : v_mac_legacy_f32 (nom gfx1010) est écrit v_fmac_legacy_f32, son nom RDNA 2 ;
    • 34 en SOPP : s_waitcnt_depctr et sendmsg sont écrits en hexadécimal brut.
  • La lecture des tests LLVM gère aussi les lignes « encoding » sans texte : 29 527 encodages lus, 0 longueur fausse, 1 384 mnémoniques.
  • --rdna2 <shader.bin> --liste affiche désormais les instructions complètes.

Plan de test

  • 3 nouveaux tests (registres, constantes, littéraux, hwreg, waitcnt, vcc implicite, sdst de v_readfirstlane)
  • pytest (hors test_native, qui demande le runtime compilé, absent du worktree)
  • CI

Refs #20

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL4XzbMR5No4bPXxPNW

**@⁠LooperSalty** on GitHub · 2026-11-21 16:20 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/43) `LooperSalty:feat/rdna2-operandes` → `main` · +1087 −27 · 15 files · 1 commits · merged 2026-11-21 16:21 UTC ## Résumé - `emu/rdna2_operands.py` décode les opérandes : - registres SGPR/VGPR, ttmp, vcc et exec ; - constantes en ligne, littéraux ; - immédiats `hwreg(...)` et `s_waitcnt`. - `tools/rdna2_shapes.py` apprend la forme de chaque opcode sur les tests publics de LLVM et mesure la conformité : **99,4 % des 8 204 lignes wave32 identiques à LLVM**. SOP1, SOP2, SOPC, SOPK, VOP1 et VOPC sont à 100 %. - Écarts restants : - 18 en VOP2 : `v_mac_legacy_f32` (nom gfx1010) est écrit `v_fmac_legacy_f32`, son nom RDNA 2 ; - 34 en SOPP : `s_waitcnt_depctr` et `sendmsg` sont écrits en hexadécimal brut. - La lecture des tests LLVM gère aussi les lignes « encoding » sans texte : 29 527 encodages lus, 0 longueur fausse, 1 384 mnémoniques. - `--rdna2 <shader.bin> --liste` affiche désormais les instructions complètes. ## Plan de test - [x] 3 nouveaux tests (registres, constantes, littéraux, hwreg, waitcnt, vcc implicite, sdst de v_readfirstlane) - [x] `pytest` (hors `test_native`, qui demande le runtime compilé, absent du worktree) - [ ] CI Refs #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL4XzbMR5No4bPXxPNW
- emu/rdna2_operands.py : registres (SGPR, VGPR, plages, ttmp, vcc/exec),
  constantes en ligne entières et flottantes, littéraux, immédiats
  (auto/hex, hwreg(id, décalage, taille), s_waitcnt vmcnt/expcnt/lgkmcnt).
- tools/rdna2_shapes.py apprend sur les tests de LLVM la forme de chaque
  opcode (champs, largeur des registres, registres implicites) et mesure
  la conformité : 99,4 % des 8 204 lignes wave32 identiques au texte de
  LLVM (100 % pour SOP1, SOP2, SOPC, SOPK, VOP1, VOPC).
- Lecture LLVM commune (llvm_lines) qui gère aussi les lignes
  « encoding » sans texte : 29 527 encodages, 1 384 mnémoniques.
- rdna2.listing() affiche l'instruction complète.

Refs #20

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4XzbMR5No4bPXxPNW
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:27:18 +00:00
github manually merged commit dbf33a3191 into gh-pr/43/base 2026-11-26 05:27:20 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.