[Mesa-dev] [PATCH 19/38] ac/nir: implement 16-bit shifts
Rhys Perry
pendingchaos02 at gmail.com
Fri Dec 7 17:22:12 UTC 2018
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 517da7ba9b..aac3330c0d 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_ilt:
--
2.19.2
More information about the mesa-dev
mailing list