[Mesa-dev] [PATCH v2 21/41] ac/nir: implement 16-bit shifts
Rhys Perry
pendingchaos02 at gmail.com
Sat Feb 16 00:22:10 UTC 2019
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
---
src/amd/common/ac_nir_to_llvm.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 75bb19031bf..bad1c2a990e 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -672,20 +672,17 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
break;
case nir_op_ishl:
result = LLVMBuildShl(ctx->ac.builder, src[0],
- LLVMBuildZExt(ctx->ac.builder, src[1],
- LLVMTypeOf(src[0]), ""),
+ ac_build_ui_cast(&ctx->ac, src[1], LLVMTypeOf(src[0])),
"");
break;
case nir_op_ishr:
result = LLVMBuildAShr(ctx->ac.builder, src[0],
- LLVMBuildZExt(ctx->ac.builder, src[1],
- LLVMTypeOf(src[0]), ""),
+ ac_build_ui_cast(&ctx->ac, src[1], LLVMTypeOf(src[0])),
"");
break;
case nir_op_ushr:
result = LLVMBuildLShr(ctx->ac.builder, src[0],
- LLVMBuildZExt(ctx->ac.builder, src[1],
- LLVMTypeOf(src[0]), ""),
+ ac_build_ui_cast(&ctx->ac, src[1], LLVMTypeOf(src[0])),
"");
break;
case nir_op_ilt32:
--
2.20.1
More information about the mesa-dev
mailing list