upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 15:16:55 -0500
committerItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 15:16:55 -0500
commita66a71ffd30b6ab1dfd228dac8f715317ee98da6 (patch)
treeeb323409a07d342bd7e867a461de66ee8a216b5f /runtime
parentddd45272ee94e0dbb2bd96787d72628a443f91d5 (diff)
parentc82fbe37d1f4823e4867aa7cc2f873046fccde62 (diff)
Merge pull request #3318 from pmilewsskiedu-gif
Diffstat (limited to 'runtime')
-rw-r--r--runtime/test/shaders/check.py2
-rw-r--r--runtime/test/shaders/ps_mul_legacy_denorm.asm16
-rw-r--r--runtime/test/shaders/ps_mul_legacy_denorm_mods.asm18
3 files changed, 36 insertions, 0 deletions
diff --git a/runtime/test/shaders/check.py b/runtime/test/shaders/check.py
index 52486103d..330af9f4f 100644
--- a/runtime/test/shaders/check.py
+++ b/runtime/test/shaders/check.py
@@ -322,6 +322,8 @@ W64X_PARTIAL = [("cs_w64x_partial", [40, 40, 528, 0, 0, 532, 539, 524820]),
322 ("cs_w64x_partial_scmp", [0, 1, 0, 1, 1, 1, 1, 0])] 322 ("cs_w64x_partial_scmp", [0, 1, 0, 1, 1, 1, 1, 0])]
323PIXEL_BITS = {"ps_clip_color": (0x3e800000, 0x3f000000, 0x3f400000, 0x3f800000), 323PIXEL_BITS = {"ps_clip_color": (0x3e800000, 0x3f000000, 0x3f400000, 0x3f800000),
324 "ps_legacy_mul": (0, 0, 0, 0x40c00000), 324 "ps_legacy_mul": (0, 0, 0, 0x40c00000),
325 "ps_mul_legacy_denorm": (0, 0, 0, 0x80000000),
326 "ps_mul_legacy_denorm_mods": (0, 0, 0, 0x40400000),
325 "ps_ops": (0x48804300, 5, 7, 0xbffffffc), "ps_ops2": (0xabcd4400, 0x46001234, 0xbffffffa, 7), 327 "ps_ops": (0x48804300, 5, 7, 0xbffffffc), "ps_ops2": (0xabcd4400, 0x46001234, 0xbffffffa, 7),
326 "ps_ops3": (0xbffffffa, 0x44660066, 0x44aabbcc, 16), "ps_ops4": (0x34000010, 0x00120800, 0xbeef0000, 0x12343c00), 328 "ps_ops3": (0xbffffffa, 0x44660066, 0x44aabbcc, 16), "ps_ops4": (0x34000010, 0x00120800, 0xbeef0000, 0x12343c00),
327 "ps_ops5": (0x12340010, 0xbeef0800, 0xaaaaffff, 0xdeadbc00), 329 "ps_ops5": (0x12340010, 0xbeef0800, 0xaaaaffff, 0xdeadbc00),
diff --git a/runtime/test/shaders/ps_mul_legacy_denorm.asm b/runtime/test/shaders/ps_mul_legacy_denorm.asm
new file mode 100644
index 000000000..fcca28896
--- /dev/null
+++ b/runtime/test/shaders/ps_mul_legacy_denorm.asm
@@ -0,0 +1,16 @@
1; v_mul_legacy_f32 in the inferred f32 denorm-mode 0 (flush input and output).
2; The two input denormals become signed zero, then DX9 0*x overrides the sign to +0.
3; A finite, nonzero product that underflows keeps its sign when flushed.
4; Expected mrt0 bits: 0x00000000 0x00000000 0x00000000 0x80000000
5v_mov_b32 v0, 0x00000001
6v_mov_b32 v1, 0x4b800000
7v_mul_legacy_f32 v4, v0, v1
8v_mov_b32 v0, 0x80000001
9v_mul_legacy_f32 v5, v0, v1
10v_mov_b32 v0, 0x00800000
11v_mov_b32 v1, 0x3f000000
12v_mul_legacy_f32 v6, v0, v1
13v_mov_b32 v0, 0x80800000
14v_mul_legacy_f32 v7, v0, v1
15exp mrt0 v4, v5, v6, v7 done vm
16s_endpgm
diff --git a/runtime/test/shaders/ps_mul_legacy_denorm_mods.asm b/runtime/test/shaders/ps_mul_legacy_denorm_mods.asm
new file mode 100644
index 000000000..641eaecb3
--- /dev/null
+++ b/runtime/test/shaders/ps_mul_legacy_denorm_mods.asm
@@ -0,0 +1,18 @@
1; The product is flushed before VOP3 output modifiers, and the modified result is flushed again.
2; A subnormal scaled to a normal number by mul:2 or mul:4 must already be zero.
3; On native RDNA2 with IEEE off an omod changes -0 into +0. An ordinary normal product can still
4; be modified. Legacy -0 * -inf gives +0.
5; Expected mrt0 bits: 0x00000000 0x00000000 0x00000000 0x40400000
6v_mov_b32 v0, 0x00800000
7v_mov_b32 v1, 0x3f000000
8v_mul_legacy_f32_e64 v4, v0, v1 mul:2
9v_mov_b32 v2, 0x80800000
10v_mul_legacy_f32_e64 v5, v2, v1 mul:4
11v_mov_b32 v3, 0xff800000
12v_mov_b32 v6, 0x80000000
13v_mul_legacy_f32 v7, v6, v3
14v_mov_b32 v9, 0x40000000
15v_mov_b32 v10, 0x40400000
16v_mul_legacy_f32_e64 v8, v9, v10 div:2
17exp mrt0 v4, v5, v7, v8 done vm
18s_endpgm