[Mesa-dev] [PATCH 4/9] ac: add 16-bit support to ac_build_isign()
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri Sep 14 10:52:35 UTC 2018
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/amd/common/ac_llvm_build.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 011cea5cd0..71723d5e91 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -2069,14 +2069,25 @@ LLVMValueRef ac_build_isign(struct ac_llvm_context *ctx, LLVMValueRef src0,
LLVMValueRef cmp, val, zero, one;
LLVMTypeRef type;
- if (bitsize == 32) {
- type = ctx->i32;
- zero = ctx->i32_0;
- one = ctx->i32_1;
- } else {
+ switch (bitsize) {
+ case 64:
type = ctx->i64;
zero = ctx->i64_0;
one = ctx->i64_1;
+ break;
+ case 32:
+ type = ctx->i32;
+ zero = ctx->i32_0;
+ one = ctx->i32_1;
+ break;
+ case 16:
+ type = ctx->i16;
+ zero = ctx->i16_0;
+ one = ctx->i16_1;
+ break;
+ default:
+ unreachable(!"invalid bitsize");
+ break;
}
cmp = LLVMBuildICmp(ctx->builder, LLVMIntSGT, src0, zero, "");
--
2.19.0
More information about the mesa-dev
mailing list