nir/opcodes: Define udiv_aligned_4 to return poison for not-aligned-4.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
This commit is contained in:
Emma Anholt 2026-01-13 17:27:30 -08:00 committed by Marge Bot
parent 94237c3ea3
commit 231a477402

View file

@ -958,8 +958,11 @@ opcode("ushr", 0, tuint, [0, 0], [tuint, tuint32], False, "",
"src0 >> (src1 & (sizeof(src0) * 8 - 1))",
description = "Unsigned right-shift." + shift_note)
opcode("udiv_aligned_4", 0, tuint, [0], [tuint], False, "",
"src0 >> 2", description = "Divide a multiple of 4 by 4")
opcode("udiv_aligned_4", 0, tuint, [0], [tuint], False, "", """
dst = src0 >> 2;
if (src0 & 3)
poison = true;
""", description = "Divide a multiple of 4 by 4")
opcode("urol", 0, tuint, [0, 0], [tuint, tuint32], False, "", """
uint32_t rotate_mask = sizeof(src0) * 8 - 1;