Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/design.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,22 @@ It needs shader Int64 support; a device that lacks it reports a skip. This is a
independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count
mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively.

`cs_w32_cmp_f64` checks the 32 binary64 vector compares, `v_cmp_*_f64` into VCC and `v_cmpx_*_f64` on EXEC, with
256 memory-fed operand pairs: the product of 16 values (±inf, ±max, the 1-ULP neighbours of ±1, the smallest
subnormals, ±0, the smallest normal, a NaN whose payload is only in the low dword and a negative quiet NaN). Each
thread stores one bit per predicate for both forms, a bit for `tru` run with the odd threads turned off (an inactive
lane gets VCC 0 from `v_cmp_` and stays off through `v_cmpx_`) and two bits for `lt` and `nge` with VOP3 `abs`/`neg`.
The expected words come from Python floats (`cmp_f64_words` in `check.py`): IEEE-754 ordering, with every pair that
has a NaN unordered. Both GPU runners compare all 1536 heap words (512 result words and 1024 unchanged input words);
the operands are loaded at run time, so neither the translator nor the driver can fold a compare. Run it alone with
`python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_cmp_f64 --require-pass`.
It is a wave32 test and no step of it needs a particular subgroup width, so it also runs on llvmpipe; the SGPR-pair
and constant operand forms are CPU-checked only (`tests/semantic/test_cmp_f64.py`). On an RTX 4070 Ti (NVIDIA
620.70.06, Linux) all 1536 words matched, and seven translator rules broken one at a time each failed it: no `-0`
canonicalization at word 206, a NaN test that ignores the low dword at word 28, an ordering key without the low
dword at word 70, the raw result written to an inactive lane's VCC at word 2, `v_cmpx_` replacing EXEC at word 3,
`abs` ignored and `nlt` lowered as the negation of `le` at word 0.

## Wave64 pixel, vertex and geometry shaders (`w64_graphics.py`)

Graphics stages have no emulation: on a 32-wide subgroup a wave64 VS, PS or GS runs as two 32-lane halves, and the
Expand Down
63 changes: 63 additions & 0 deletions runtime/test/shaders/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,68 @@ def shift64_test(tools, spirv, env=None):
return dump_test(tools, spirv, "cs_w32_shift64", expected, len(expected), child)


# cs_w32_cmp_f64.asm: the 16 binary64 compare predicates in opcode order (bit n of a result word is predicate n), and
# the operand values every pair is drawn from, in ascending order and then two NaNs.
CMP_F64_PREDICATES = ("f", "lt", "eq", "le", "gt", "lg", "ge", "o",
"u", "nge", "nlg", "ngt", "nle", "neq", "nlt", "tru")
CMP_F64_VALUES = (
0xFFF0000000000000, # -inf
0xFFEFFFFFFFFFFFFF, # -max
0xBFF0000000000001, # -1 - 1 ulp
0xBFF0000000000000, # -1
0xBFEFFFFFFFFFFFFF, # the value above -1: its high dword is the smaller one, its low dword all ones
0x8000000000000001, # the negative smallest subnormal
0x8000000000000000, # -0
0x0000000000000000, # +0
0x0000000000000001, # the smallest subnormal
0x0010000000000000, # the smallest normal
0x3FF0000000000000, # 1
0x3FF0000000000001, # 1 + 1 ulp
0x7FEFFFFFFFFFFFFF, # +max
0x7FF0000000000000, # +inf
0x7FF0000000000001, # a NaN whose payload is only in the low dword: its high dword is +inf's
0xFFF8000000000000) # a negative quiet NaN
CMP_F64_SIGN = 1 << 63


def cmp_f64_predicates(a_bits, b_bits):
"""The 16 results of comparing two binary64 bit patterns, as a mask with bit n for CMP_F64_PREDICATES[n].
IEEE-754 through Python floats: a pair with a NaN is unordered, so lt, eq and gt are all false for it and every
negated predicate is true; -0 equals +0 and a subnormal is not zero."""
a, b = (struct.unpack("<d", struct.pack("<Q", bits))[0] for bits in (a_bits, b_bits))
unordered = a != a or b != b
lt, eq, gt = a < b, a == b, a > b
results = (False, lt, eq, lt or eq, gt, lt or gt, gt or eq, not unordered,
unordered, not (gt or eq), not (lt or gt), not gt, not (lt or eq), not eq, not lt, True)
return sum(1 << bit for bit, result in enumerate(results) if result)


def cmp_f64_words():
"""cs_w32_cmp_f64: the input heap and the full expected readback, with Python floats as the oracle. Record
16 * ia + ib compares value ia with value ib. Thread i handles records i and i + 128, so a record's thread has
the record's parity."""
inputs, results = [], []
for record, (a, b) in enumerate((a, b) for a in CMP_F64_VALUES for b in CMP_F64_VALUES):
inputs.extend((a & 0xFFFFFFFF, a >> 32, b & 0xFFFFFFFF, b >> 32))
word = cmp_f64_predicates(a, b)
word |= (record % 2 == 0) << 16 # tru with the odd threads turned off first
word |= (cmp_f64_predicates(a & ~CMP_F64_SIGN, b ^ CMP_F64_SIGN) >> 1 & 1) << 17 # lt of |a| and -b
word |= (cmp_f64_predicates(a ^ CMP_F64_SIGN, b & ~CMP_F64_SIGN) >> 9 & 1) << 18 # nge of -a and |b|
results.extend((word, word)) # the v_cmp_ word (VCC), then the v_cmpx_ word (EXEC)
return [0xEEEEEEEE] * len(results) + inputs, results + inputs


def cmp_f64_test(tools, spirv, env=None):
"""Verify the 32 binary64 compares on 256 memory-fed operand pairs, including the untouched input records."""
initial, expected = cmp_f64_words()
with tempfile.TemporaryDirectory(prefix="leonida-cmp-f64-") as tmp:
path = Path(tmp) / "input.bin"
path.write_bytes(struct.pack(f"<{len(initial)}I", *initial))
child = dict(os.environ if env is None else env, VKC_HEAP_INIT=str(path))
child.setdefault("VKC_SUBGROUP_SIZE", str(subgroup_size(spirv, "cs_w32_cmp_f64") or 32))
return dump_test(tools, spirv, "cs_w32_cmp_f64", expected, len(expected), child)


# cs_user_sgprs.asm: vk_compute_test puts these words in s4..s7 and the shader stores them back.
USER_SGPRS = [0x4F000000, 0xDEADBEEF, 7, 0xFFFFFFFF]
USER_SGPRS_ENV = {"VKC_SGPRS": ",".join(hex(w) for w in USER_SGPRS)}
Expand Down Expand Up @@ -1883,6 +1945,7 @@ def main():
results.append(("cs_heap_init", compute_test(tools, spirv, "cs_heap_init", "1", "dump",
expected_words=HEAP_INIT_EXPECTED, env=heap_init_env())))
results.append(("cs_w32_shift64", shift64_test(tools, spirv)))
results.append(("cs_w32_cmp_f64", cmp_f64_test(tools, spirv)))
results.append(("cs_cvt_f32_sat", cvt_f32_sat_test(tools, spirv)))
results.append(("cs_fma_fused", fma_fused_test(tools, spirv)))
results.append(("cs_cvt_pk_u8", compute_test(tools, spirv, "cs_cvt_pk_u8", "1", "dump",
Expand Down
270 changes: 270 additions & 0 deletions runtime/test/shaders/cs_w32_cmp_f64.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
; GPU-CMP-F64: the 16 binary64 vector compares, v_cmp_*_f64 into VCC and v_cmpx_*_f64 on EXEC.
; group: 128,1,1
; mattr: +wavefrontsize32,-wavefrontsize64
; check.py seeds 256 records at byte 0x800: {a.lo, a.hi, b.lo, b.hi}, the Cartesian product of 16 binary64 values
; (record 16 * ia + ib holds values ia and ib), in ascending order and then two NaNs: -inf, -max, -1 - 1 ulp, -1,
; the value above -1 (high dword smaller, low dword all ones), the negative smallest subnormal, -0, +0, the smallest
; subnormal, the smallest normal, 1, 1 + 1 ulp, +max, +inf, a NaN whose payload is only in the low dword (its high
; dword is +inf's) and a negative quiet NaN.
; Thread i reads records i and i + 128 from memory, so neither the translator nor the driver can fold a compare,
; and writes two words per record at byte 8 * record: the v_cmp_ word, then the v_cmpx_ word.
; Bits 0..15 of both words are the 16 predicates in opcode order (RDNA2 ISA, VOPC compare operations):
; f lt eq le gt lg ge o u nge nlg ngt nle neq nlt tru
; lt, eq and gt are IEEE-754 (false when either operand is a NaN, -0 == +0, no denormal flush), o is "neither is a
; NaN", u its negation, and le/lg/ge/nge/nlg/ngt/nle/neq/nlt are the unions and negations their names say, so every
; n* predicate is true for a NaN. v_cmp_ sets the lane's VCC bit; v_cmpx_ leaves the lane active only when true.
; bit 16: v_cmp_tru / v_cmpx_tru with the odd threads turned off first: set on even threads only. A lane EXEC has
; off gets VCC 0 from v_cmp_ and stays off through v_cmpx_.
; bit 17: lt with VOP3 modifiers, |a| < -b. bit 18: nge with VOP3 modifiers, !(-a >= |b|).
; Bits 19..31 are 0. EXEC is put back with a constant after each v_cmpx_, so no step needs a particular subgroup
; width. The input records must come back unchanged.
; Run with the heap initialized by check.py's cmp_f64_test; compare all 1536 words.
v_lshlrev_b32_e32 v1, 4, v0
v_add_nc_u32_e32 v11, 0x800, v1
v_lshlrev_b32_e32 v10, 3, v0
v_and_b32_e32 v9, 1, v0
buffer_load_dwordx4 v[2:5], v1, s[0:3], 0 offen offset:2048
s_waitcnt vmcnt(0)
v_mov_b32_e32 v6, 0
v_mov_b32_e32 v7, 0
v_cmp_f_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x1, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_lt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x2, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_eq_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x4, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_le_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x8, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_gt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x10, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_lg_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x20, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_ge_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x40, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_o_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x80, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_u_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x100, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nge_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x200, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nlg_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x400, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_ngt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x800, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nle_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x1000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_neq_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x2000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nlt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x4000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_tru_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x8000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmpx_eq_u32_e32 0, v9
v_cmp_tru_f64_e32 vcc_lo, v[2:3], v[4:5]
s_mov_b32 exec_lo, -1
v_or_b32_e32 v8, 0x10000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_lt_f64_e64 vcc_lo, |v[2:3]|, -v[4:5]
v_or_b32_e32 v8, 0x20000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nge_f64_e64 vcc_lo, -v[2:3], |v[4:5]|
v_or_b32_e32 v8, 0x40000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmpx_f_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x1, v7
s_mov_b32 exec_lo, -1
v_cmpx_lt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x2, v7
s_mov_b32 exec_lo, -1
v_cmpx_eq_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x4, v7
s_mov_b32 exec_lo, -1
v_cmpx_le_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x8, v7
s_mov_b32 exec_lo, -1
v_cmpx_gt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x10, v7
s_mov_b32 exec_lo, -1
v_cmpx_lg_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x20, v7
s_mov_b32 exec_lo, -1
v_cmpx_ge_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x40, v7
s_mov_b32 exec_lo, -1
v_cmpx_o_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x80, v7
s_mov_b32 exec_lo, -1
v_cmpx_u_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x100, v7
s_mov_b32 exec_lo, -1
v_cmpx_nge_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x200, v7
s_mov_b32 exec_lo, -1
v_cmpx_nlg_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x400, v7
s_mov_b32 exec_lo, -1
v_cmpx_ngt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x800, v7
s_mov_b32 exec_lo, -1
v_cmpx_nle_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x1000, v7
s_mov_b32 exec_lo, -1
v_cmpx_neq_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x2000, v7
s_mov_b32 exec_lo, -1
v_cmpx_nlt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x4000, v7
s_mov_b32 exec_lo, -1
v_cmpx_tru_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x8000, v7
s_mov_b32 exec_lo, -1
v_cmpx_eq_u32_e32 0, v9
v_cmpx_tru_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x10000, v7
s_mov_b32 exec_lo, -1
v_cmpx_lt_f64_e64 |v[2:3]|, -v[4:5]
v_or_b32_e32 v7, 0x20000, v7
s_mov_b32 exec_lo, -1
v_cmpx_nge_f64_e64 -v[2:3], |v[4:5]|
v_or_b32_e32 v7, 0x40000, v7
s_mov_b32 exec_lo, -1
buffer_store_dwordx2 v[6:7], v10, s[0:3], 0 offen
buffer_load_dwordx4 v[2:5], v11, s[0:3], 0 offen offset:2048
s_waitcnt vmcnt(0)
v_mov_b32_e32 v6, 0
v_mov_b32_e32 v7, 0
v_cmp_f_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x1, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_lt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x2, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_eq_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x4, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_le_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x8, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_gt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x10, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_lg_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x20, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_ge_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x40, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_o_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x80, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_u_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x100, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nge_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x200, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nlg_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x400, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_ngt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x800, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nle_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x1000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_neq_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x2000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nlt_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x4000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_tru_f64_e32 vcc_lo, v[2:3], v[4:5]
v_or_b32_e32 v8, 0x8000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmpx_eq_u32_e32 0, v9
v_cmp_tru_f64_e32 vcc_lo, v[2:3], v[4:5]
s_mov_b32 exec_lo, -1
v_or_b32_e32 v8, 0x10000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_lt_f64_e64 vcc_lo, |v[2:3]|, -v[4:5]
v_or_b32_e32 v8, 0x20000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmp_nge_f64_e64 vcc_lo, -v[2:3], |v[4:5]|
v_or_b32_e32 v8, 0x40000, v6
v_cndmask_b32_e32 v6, v6, v8, vcc_lo
v_cmpx_f_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x1, v7
s_mov_b32 exec_lo, -1
v_cmpx_lt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x2, v7
s_mov_b32 exec_lo, -1
v_cmpx_eq_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x4, v7
s_mov_b32 exec_lo, -1
v_cmpx_le_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x8, v7
s_mov_b32 exec_lo, -1
v_cmpx_gt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x10, v7
s_mov_b32 exec_lo, -1
v_cmpx_lg_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x20, v7
s_mov_b32 exec_lo, -1
v_cmpx_ge_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x40, v7
s_mov_b32 exec_lo, -1
v_cmpx_o_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x80, v7
s_mov_b32 exec_lo, -1
v_cmpx_u_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x100, v7
s_mov_b32 exec_lo, -1
v_cmpx_nge_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x200, v7
s_mov_b32 exec_lo, -1
v_cmpx_nlg_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x400, v7
s_mov_b32 exec_lo, -1
v_cmpx_ngt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x800, v7
s_mov_b32 exec_lo, -1
v_cmpx_nle_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x1000, v7
s_mov_b32 exec_lo, -1
v_cmpx_neq_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x2000, v7
s_mov_b32 exec_lo, -1
v_cmpx_nlt_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x4000, v7
s_mov_b32 exec_lo, -1
v_cmpx_tru_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x8000, v7
s_mov_b32 exec_lo, -1
v_cmpx_eq_u32_e32 0, v9
v_cmpx_tru_f64_e32 v[2:3], v[4:5]
v_or_b32_e32 v7, 0x10000, v7
s_mov_b32 exec_lo, -1
v_cmpx_lt_f64_e64 |v[2:3]|, -v[4:5]
v_or_b32_e32 v7, 0x20000, v7
s_mov_b32 exec_lo, -1
v_cmpx_nge_f64_e64 -v[2:3], |v[4:5]|
v_or_b32_e32 v7, 0x40000, v7
s_mov_b32 exec_lo, -1
buffer_store_dwordx2 v[6:7], v10, s[0:3], 0 offen offset:1024
s_endpgm
5 changes: 5 additions & 0 deletions scripts/run_gpu_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from check import cbv_modulate_test
from check import HEAP_INIT_EXPECTED, heap_init_env # cs_heap_init: vk_compute_test's VKC_HEAP_INIT
from check import shift64_test # dynamic 64-bit vector shifts and overlapping destinations
from check import cmp_f64_test # the 32 binary64 vector compares on memory-fed operands
from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan)
from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py
from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8
Expand Down Expand Up @@ -1000,6 +1001,10 @@ def run_suite(a, work: str) -> int:
detail = shift64_test(a.build, spirv_dir, cs_env)
results.append((name, None if isinstance(detail, Skip) else not detail,
detail or "640 words exact (64 shift cases and unchanged inputs)"))
elif name == "cs_w32_cmp_f64":
detail = cmp_f64_test(a.build, spirv_dir, cs_env)
results.append((name, None if isinstance(detail, Skip) else not detail,
detail or "1536 words exact (256 operand pairs and unchanged inputs)"))
elif name == "cs_workgroup_yz":
rc, msg = run_cmd([vk_compute, spv, "2x3x4", "workgroup_yz"], env=cs_env)
results.append((name,) + compute_result(rc, msg, rc == 0 and "2x3x4 workgroup Y/Z: 0 mismatches"
Expand Down
Loading
Loading