From 8f333a8a406bfd39d09ba4e756d5218fc7782efd Mon Sep 17 00:00:00 2001 From: triggered02 <153171514+triggered02@users.noreply.github.com> Date: Tue, 24 Nov 2026 23:53:32 +0530 Subject: [PATCH] tests: pin the absolute-value and negated-mask refusals on the select Review nits on the merged #1710: the PR text says a source absolute value stays refused and a negated mask cannot be assembled, but nothing pinned either. The encoder gains the abs bits and the mask negate bit, and the test now asserts that |v30| on either source (and both), and a decoder-produced -s0 mask, are refused. All four spellings are words the decoder produces but llvm-mc rejects, so the property under test is the refusal of the printed operand. Fail-first: routing the mask through u_src fails 'a negated mask is refused'; stripping the abs bars fails 'absolute values on both sources are refused'. 22 checks; startup_gfx2hlsl* dev family and the release test pass. --- tests/startup_gfx2hlsl_cndmask_neg_check.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/startup_gfx2hlsl_cndmask_neg_check.py b/tests/startup_gfx2hlsl_cndmask_neg_check.py index 642205d91d..f7c1daaae7 100644 --- a/tests/startup_gfx2hlsl_cndmask_neg_check.py +++ b/tests/startup_gfx2hlsl_cndmask_neg_check.py @@ -38,10 +38,12 @@ def check(label, condition, detail=''): V30 = 256 + 30 # VGPR operands are encoded from 256 upwards -def encode_vop2_e64(op, vdst, src0, src1, *, neg0=0, neg1=0, clamp=0, omod=0): +def encode_vop2_e64(op, vdst, src0, src1, *, neg0=0, neg1=0, abs0=0, abs1=0, clamp=0, omod=0, neg_mask=0): """Encode a VOP2 instruction in its VOP3A (e64) form.""" - w0 = ((0b110101 << 26) | ((VOP2_E64_BASE + op) << 16) | ((clamp & 1) << 15) | (vdst & 0xff)) - w1 = ((src0 & 0x1ff) | ((src1 & 0x1ff) << 9) | ((omod & 0x3) << 27) | ((neg0 & 1) << 29) | ((neg1 & 1) << 30)) + w0 = ((0b110101 << 26) | ((VOP2_E64_BASE + op) << 16) | ((clamp & 1) << 15) + | ((abs1 & 1) << 9) | ((abs0 & 1) << 8) | (vdst & 0xff)) + w1 = ((src0 & 0x1ff) | ((src1 & 0x1ff) << 9) | ((omod & 0x3) << 27) | ((neg0 & 1) << 29) + | ((neg1 & 1) << 30) | ((neg_mask & 1) << 31)) return struct.pack('