Mesa (master): broadcom/vc5: Move the umul macro to a header.
Eric Anholt
anholt at kemper.freedesktop.org
Mon Mar 19 23:45:03 UTC 2018
Module: Mesa
Branch: master
Commit: c81d6817422c83ba990fac19b165d4dedb1150fe
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c81d6817422c83ba990fac19b165d4dedb1150fe
Author: Eric Anholt <eric at anholt.net>
Date: Tue Mar 13 16:23:33 2018 -0700
broadcom/vc5: Move the umul macro to a header.
Anywhere we want to multiply, we probably want this.
---
src/broadcom/compiler/nir_to_vir.c | 9 +--------
src/broadcom/compiler/v3d_compiler.h | 7 +++++++
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c
index a8098fc320..61486870dc 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -256,13 +256,6 @@ vir_SAT(struct v3d_compile *c, struct qreg val)
}
static struct qreg
-ntq_umul(struct v3d_compile *c, struct qreg src0, struct qreg src1)
-{
- vir_MULTOP(c, src0, src1);
- return vir_UMUL24(c, src0, src1);
-}
-
-static struct qreg
ntq_minify(struct v3d_compile *c, struct qreg size, struct qreg level)
{
return vir_MAX(c, vir_SHR(c, size, level), vir_uniform_ui(c, 1));
@@ -765,7 +758,7 @@ ntq_emit_alu(struct v3d_compile *c, nir_alu_instr *instr)
break;
case nir_op_imul:
- result = ntq_umul(c, src[0], src[1]);
+ result = vir_UMUL(c, src[0], src[1]);
break;
case nir_op_seq:
diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h
index 94cbd0523c..f777cfcd87 100644
--- a/src/broadcom/compiler/v3d_compiler.h
+++ b/src/broadcom/compiler/v3d_compiler.h
@@ -916,6 +916,13 @@ vir_LDTMU(struct v3d_compile *c)
}
}
+static inline struct qreg
+vir_UMUL(struct v3d_compile *c, struct qreg src0, struct qreg src1)
+{
+ vir_MULTOP(c, src0, src1);
+ return vir_UMUL24(c, src0, src1);
+}
+
/*
static inline struct qreg
vir_LOAD_IMM(struct v3d_compile *c, uint32_t val)
More information about the mesa-commit
mailing list