From: Caio Marcelo de Oliveira Filho Date: Fri, 31 May 2019 20:48:34 +0000 (-0700) Subject: nir: Add nir_ball_iequal() helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09cc3389b9b072a9e35476b1942f208ec672a672;p=mesa.git nir: Add nir_ball_iequal() helper Similar to nir_bany_inequal(). Suggested by Jason. Reviewed-by: Jason Ekstrand --- 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) {