Recompiler: OMOD / CLAMP on f64 results, conversions and integer ops … #126

Closed
github-bot wants to merge 1 commit from gh-pr/126/head into gh-pr/126/base
Owner

@⁠gbuyssens on GitHub · 2026-11-23 13:39 UTC · original
gbuyssens:pr/omod-clamp → main · +143 −11 · 2 files · 1 commits · closed without merging

…(#105)

  • f64 results: CLAMP went through saturate(), which has no double overload – the result was rounded to float first (29 bits lost); OMOD was ignored. Both apply to the double now.
  • v_cvt_f32_f64 and v_cvt_f16_f32 apply OMOD / CLAMP.
  • integer CLAMP (saturation) on v_add_nc_u32 / v_sub_nc_u32 / v_subrev_nc_u32, v_add3_u32, the packed v_pk_add / sub / mad / mul_lo u16 / i16 and the dots' accumulation (dropped before).
  • vccz / execz read in a wave32 program look at the low word only (vcc_hi is a free SGPR there).
  • TG_SIZE counts a partial last wave of the group.
  • GPU test gpu_output_modifiers_on_f64_conversions_and_integer_clamp.
**@⁠gbuyssens** on GitHub · 2026-11-23 13:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/126) `gbuyssens:pr/omod-clamp` → `main` · +143 −11 · 2 files · 1 commits · closed without merging …(#105) - f64 results: CLAMP went through saturate(), which has no double overload – the result was rounded to float first (29 bits lost); OMOD was ignored. Both apply to the double now. - v_cvt_f32_f64 and v_cvt_f16_f32 apply OMOD / CLAMP. - integer CLAMP (saturation) on v_add_nc_u32 / v_sub_nc_u32 / v_subrev_nc_u32, v_add3_u32, the packed v_pk_add / sub / mad / mul_lo u16 / i16 and the dots' accumulation (dropped before). - vccz / execz read in a wave32 program look at the low word only (vcc_hi is a free SGPR there). - TG_SIZE counts a partial last wave of the group. - GPU test gpu_output_modifiers_on_f64_conversions_and_integer_clamp.
- f64 results: CLAMP went through saturate(), which has no double overload – the result was
  rounded to float first (29 bits lost); OMOD was ignored. Both apply to the double now.
- v_cvt_f32_f64 and v_cvt_f16_f32 apply OMOD / CLAMP.
- integer CLAMP (saturation) on v_add_nc_u32 / v_sub_nc_u32 / v_subrev_nc_u32, v_add3_u32, the
  packed v_pk_add / sub / mad / mul_lo u16 / i16 and the dots' accumulation (dropped before).
- vccz / execz read in a wave32 program look at the low word only (vcc_hi is a free SGPR there).
- TG_SIZE counts a partial last wave of the group.
- GPU test gpu_output_modifiers_on_f64_conversions_and_integer_clamp.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:11:27 +00:00
github-bot closed this pull request 2026-11-26 04:11:27 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 14:14 UTC · original

Thanks – closing as a duplicate of #119 (merged), which covers the OMOD / CLAMP part and showed that f64 clamp keeps double precision (DXIL has a double saturate). The other two items here – vccz / execz in wave32 programs reading only the low word, and TG_SIZE counting a partial last wave – are not in #119: a small PR with just those and a test each would be welcome.

**@⁠ivall** on GitHub · 2026-11-23 14:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/126#issuecomment-7103691463) Thanks – closing as a duplicate of #119 (merged), which covers the OMOD / CLAMP part and showed that f64 clamp keeps double precision (DXIL has a double saturate). The other two items here – vccz / execz in wave32 programs reading only the low word, and TG_SIZE counting a partial last wave – are not in #119: a small PR with just those and a test each would be welcome.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.