aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-09-14 12:52:35 +0200
committerSamuel Pitoiset <[email protected]>2018-09-17 15:18:28 +0200
commit3e7f3e2cd1e9f44eab840441af15a44883919717 (patch)
tree5aeefa777959a978bf2b4a207ca9e3f1c3327c23 /src
parentcfd6314cfe081728455948287a618b3c70a8d2a4 (diff)
ac: add 16-bit support to ac_build_isign()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_llvm_build.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 011cea5cd0f..71723d5e91f 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, "");