From 09cc3389b9b072a9e35476b1942f208ec672a672 Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Fri, 31 May 2019 13:48:34 -0700 Subject: [PATCH] nir: Add nir_ball_iequal() helper Similar to nir_bany_inequal(). Suggested by Jason. Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir_builder.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index dbbc7e41039..8ca776f733e 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -548,6 +548,19 @@ nir_fdot(nir_builder *build, nir_ssa_def *src0, nir_ssa_def *src1) return NULL; } +static inline nir_ssa_def * +nir_ball_iequal(nir_builder *b, nir_ssa_def *src0, nir_ssa_def *src1) +{ + switch (src0->num_components) { + case 1: return nir_ieq(b, src0, src1); + case 2: return nir_ball_iequal2(b, src0, src1); + case 3: return nir_ball_iequal3(b, src0, src1); + case 4: return nir_ball_iequal4(b, src0, src1); + default: + unreachable("bad component size"); + } +} + static inline nir_ssa_def * nir_bany_inequal(nir_builder *b, nir_ssa_def *src0, nir_ssa_def *src1) { -- 2.30.2