Repository navigation
[rocjitsu] Execute packed FP64 basic arithmetic. - #10871
Conversation
44b2e76 to
a96c48a
Compare
4d89c57 to
66abb78
Compare
66abb78 to
e063d7a
Compare
cbb9e4b to
4b0b0c0
Compare
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved decoder-generation validation issues and corresponding test coverage remain.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Enables gfx1251 decode-to-register execution for four packed FP64 arithmetic instructions while keeping FMA and WMMA model-only.
Changes:
- Adds MODE-aware FP64 helpers and generated execution callbacks.
- Updates CDNA5 metadata, decoder validation, and backend registration.
- Expands execution, modifier, aliasing, and rejection-path tests.
Review findings:
- Moderate (2 votes):
_generator.py:10410must restrict selector 104 handling to U64 semantic classes and add generator coverage. - Moderate (2 votes):
vop3p.cpp:4261must reject unusednegandneg_himodifier bits. - Moderate (1 vote):
vop3p.cpp:4287must accept validSGPR104_128selectors. - Nit (1 vote):
cdna5_execution_test.cpp:2536should treat selector 104 as valid and cover it accordingly.
File summaries
| File | Description |
|---|---|
shared/machine-readable-isa/isa/amdgpu_isa_cdna5_variants.json |
Updates model-only instruction metadata. |
emulation/rocjitsu/tests/cdna5_execution_test.cpp |
Adds packed FP64 execution and decoder validation tests. |
emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/isa/arch/amdgpu/shared/fp_mode.h |
Adds MODE-aware binary FP64 operations. |
emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/isa/arch/amdgpu/generated/cdna5/vop3p.h |
Declares executable FP64 instruction classes. |
emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/isa/arch/amdgpu/generated/cdna5/vop3p.cpp |
Adds FP64 decoding and validation. |
emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/isa/arch/amdgpu/generated/cdna5/vop3p_exec.cpp |
Implements packed FP64 callbacks. |
emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/isa/arch/amdgpu/generated/cdna5/execution_backend.h |
Adds callback identifiers. |
emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/isa/arch/amdgpu/generated/cdna5/execution_backend_exec.cpp |
Registers execution callbacks. |
emulation/rocjitsu/lib/python/amdisa/tests/test_sema_derive.py |
Tests FP64 semantic derivation. |
emulation/rocjitsu/lib/python/amdisa/tests/test_packed_codegen.py |
Tests packed FP64 callback generation. |
emulation/rocjitsu/lib/python/amdisa/tests/test_generator_profile_gates.py |
Tests generated validation gates. |
emulation/rocjitsu/lib/python/amdisa/semantics.py |
Defines packed FP64 semantics. |
emulation/rocjitsu/lib/python/amdisa/codegen/execute/packed.py |
Generates packed FP64 execution code. |
emulation/rocjitsu/lib/python/amdisa/codegen/execute/__init__.py |
Registers the FP64 code generator. |
emulation/rocjitsu/lib/python/amdisa/codegen/_generator.py |
Generates instruction validation. |
Review details
Suppressed comments (1)
emulation/rocjitsu/tests/cdna5_execution_test.cpp:2537
- This newly added case treats
src1 = 104as invalid, but 104 is the validSGPR104_128member of the 128-bit public source class. Once the decoder is regenerated with the intended width-specific validation, this case will fail and the suite still will not exercise the legal form; remove it from the invalid cases and add 104 to the valid-selector coverage.
constexpr std::array<uint16_t, 21> kInvalidV2F64Selectors{
106, 107, 125, 126, 127, 209, 229, 230, 231, 232, 234,
- Files reviewed: 10/15 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
The existing thread has one consolidated remaining finding: packed FP64 validation still rejects selector 104 despite its public operand class, and the related acceptance/fresh-generation/modifier regression coverage needs updating. The earlier generator/output mismatch and missing generated negation-bit checks are addressed.
sjain-stanford
left a comment
There was a problem hiding this comment.
Thanks for addressing the comment. LGTM.
Enable instruction-level execution for gfx1251 V_PK_ADD_F64, V_PK_MUL_F64, V_PK_MAX_NUM_F64, and V_PK_MIN_NUM_F64. These instructions were previously model-only, so valid decoded instructions could not produce architectural register results. Generate callbacks that route both packed elements through the shared MODE-aware F64 helpers. This honors rounding and denormal modes, EXEC masking, independent low/high source negation, clamp, packed-FP64 scalar propagation, literals, inline constants, and overlapping register tuples. Validate the fixed packed layout and public LLVM width-specific source and register classes before installing each callback. Tests exercise the public LLVM encodings and source forms, boundary selectors and tuples, FP modes, NaN and signed-zero behavior, modifiers, inactive lanes, aliasing, and decoder rejection paths. Keep V_PK_FMA_F64 and V_WMMA_F64_16X16X4_F64 model-only. gfx1251 still does not advertise full simulator execution, so this change provides decode-to-register execution rather than simulator or AQL end-to-end support.
Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: hanhanW <hanhan0912@gmail.com>
LLVM defines each packed FP64 source as VSrc_v2f64. Its VS_128 register class includes SGPR104_128, so rejecting selector 104 makes valid llvm-mc encodings fail to decode. Permit selector 104 in both source positions for V_PK_ADD_F64, V_PK_MUL_F64, V_PK_MAX_NUM_F64, and V_PK_MIN_NUM_F64, then regenerate the CDNA5 decoder. Add fresh-generation assertions for the special selector and unused modifier bits. Exercise each operation with SGPR104_128 in both source positions and verify that the VCC tuple components are not consumed. Tests: Gfx1251PackedF64ExecutionTest.*; related generator profile tests
Packed F64 sources are 128-bit operands whose 32-bit literal supplies a broadcast F64 element. The generator previously repeated FMT_NUM_PK2_F64 in both the widening table and a size predicate, while the surrounding names and diagnostic still described only 64-bit operands. Key widening policies by operand width and data format so the packed-F64 table entry is the single source of truth. Generalize the helper name and diagnostic, and add focused coverage showing that 128-bit packed F64 uses F64 high-bit widening while packed U64 retains the default immediate semantics. Tests: test_literal_codegen.py; relevant generator profile tests; generate-amdisa.sh
GCC 13 at -O2 diagnoses the single-element std::vector initializer-list assignment in DbiArgSimBase::SetUp as an out-of-bounds inlined memmove. Because rocJitsu treats warnings as errors, this prevents the ubsan-gcc CI lane from building after the DBI argument tests landed on develop. Append the sentinel to the newly constructed empty vector instead. This preserves the one-element probe argument list while avoiding the optimizer warning. Tests: GCC 13/UBSan full build; DBI argument simulator tests; packed-F64 execution tests
65a00ef to
afde462
Compare
TheRock Submodule Bump ActivityNewest first
|
Enable instruction-level execution for gfx1251
V_PK_ADD_F64,V_PK_MUL_F64,V_PK_MAX_NUM_F64, andV_PK_MIN_NUM_F64. These instructions were previously model-only, so valid decoded instructions could not produce architectural register results.Generate callbacks that route both packed elements through the shared MODE-aware F64 helpers. This honors rounding and denormal modes, EXEC masking, independent low/high source negation, clamp, packed-FP64 scalar propagation, literals, inline constants, and overlapping register tuples.
Validate the fixed packed layout and public LLVM width-specific source and register classes before installing each callback. Tests exercise the public LLVM encodings and source forms, boundary selectors and tuples, FP modes, NaN and signed-zero behavior, modifiers, inactive lanes, aliasing, and decoder rejection paths.
Keep
V_PK_FMA_F64andV_WMMA_F64_16X16X4_F64model-only. gfx1251 still does not advertise full simulator execution, so this change provides decode-to-register execution rather than simulator or AQL end-to-end support.