From f00b5a30f5799b5072197ecb92bbcc16877109cd Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 17 Jun 2021 10:32:34 -0500 Subject: [PATCH] nir: Require vectorized ALU ops to be all-or-nothing Long ago, the semantics of bcsel were such that it took a single boolean value and selected between whole vectors. These days, it takes a vector boolean with the assumption that if you want the old behavior you can just use a .xxxx swizzle. There currently are no opcodes which use a output_size of 0 but have a scalar or fixed-vector input. Let's disallow it for now to force us to think through the semantics again if this ever comes up as something someone actually wants. Reviewed-by: Connor Abbott Part-of: --- src/compiler/nir/nir_opcodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 4e48567340c..42bcfb66569 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -78,6 +78,8 @@ class Opcode(object): assert 0 <= output_size <= 5 or (output_size == 8) or (output_size == 16) for size in input_sizes: assert 0 <= size <= 5 or (size == 8) or (size == 16) + if output_size == 0: + assert size == 0 if output_size != 0: assert size != 0 self.name = name