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

Closed
gbuyssens wants to merge 1 commit from upstream-pr/126 into main
gbuyssens commented 2026-11-23 13:39:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gbuyssens on 2026-11-23T13:39:39Z.


…(#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.
<!-- greyfinch-sync:ivall/xcl:issue:6560595455 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/126). Originally posted by [gbuyssens](https://github.com/gbuyssens) on 2026-11-23T13:39:39Z. --- …(#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.
upstream-sync closed this pull request 2026-11-24 06:57:16 +00:00
ivall commented 2026-11-24 07:00:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T14:14:18Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7103691463 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/126#issuecomment-7103691463). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T14:14:18Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!125
No description provided.