Skip to content

shader: reject unverified division prescaling - #2

Merged
Holastor merged 1 commit into
Holastor:shader/valu-fma-divfrom
Joacoorandom:review/reject-unverified-div-prescale
Nov 22, 2026
Merged

Holastor merged 1 commit into
Holastor:shader/valu-fma-divfrom
Joacoorandom:review/reject-unverified-div-prescale

Conversation

@Joacoorandom

@Joacoorandom Joacoorandom commented Nov 22, 2026 •

Copy link
Copy Markdown

The new v_div_scale_f32 lowering ignores the numerator when choosing the result and VCC, and applies a 2^32 scale instead of the pre-scale operation's exponent adjustments. For denominator 1 and numerator 2^100 it silently returns 1 with VCC clear, whereas RDNA 2 opcode 365 requires 2^64 with VCC set.

Keep both instruction spellings explicitly rejected until the complete semantics are implemented and verified. The scanner still recognizes the opcode but no longer labels it supported. Add rejection controls for the exponent-gap reproducer, zero and small-normal denominators, and 1/1. The FMA scaling controls now obtain VCC from a comparison independently of this rejected operation.

Validation on Linux/Python 3.14.4: python3 -B tests/pixel_aot_check.py and python3 -B tests/docs_links_check.py passed; python3 -B tests/rdna2_tools_check.py passed 52 tests with one additional test skipped. Requirements from requirements-dev were installed. All four CI jobs passed: LLVM 15 assembly/translation, platform-independent Python checks, Windows development/WARP, and Windows release/WARP at /O2. This validates rejection and regressions, not native division prescaling.

This is a conservative correctness fix, not a complete implementation of division prescaling. One commit against the head branch of R0Y00#704; merging into shader/valu-fma-div updates that existing PR.

@Joacoorandom
Joacoorandom marked this pull request as ready for review November 22, 2026 21:53
@Holastor
Holastor merged commit e12704d into Holastor:shader/valu-fma-div Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants