diff options
author | Samuel Pitoiset <[email protected]> | 2019-03-13 15:53:51 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-03-21 09:02:10 +0100 |
commit | 6e632eb24bbbf4142b092dd24d7b567bd974f2d2 (patch) | |
tree | 2ffe4e2f90f61dee1df06050892e268f9593c272 | |
parent | 4e1bbb000cdfe4ba01bee5a6868c54fed7285dae (diff) |
ac: add various int8 definitions
Original patch by Rhys Perry.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 10 | ||||
-rw-r--r-- | src/amd/common/ac_llvm_build.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 4d0cb555a42..195fdcb224d 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -87,6 +87,8 @@ ac_llvm_context_init(struct ac_llvm_context *ctx, ctx->v4f32 = LLVMVectorType(ctx->f32, 4); ctx->v8i32 = LLVMVectorType(ctx->i32, 8); + ctx->i8_0 = LLVMConstInt(ctx->i8, 0, false); + ctx->i8_1 = LLVMConstInt(ctx->i8, 1, false); ctx->i16_0 = LLVMConstInt(ctx->i16, 0, false); ctx->i16_1 = LLVMConstInt(ctx->i16, 1, false); ctx->i32_0 = LLVMConstInt(ctx->i32, 0, false); @@ -201,7 +203,9 @@ ac_get_type_size(LLVMTypeRef type) static LLVMTypeRef to_integer_type_scalar(struct ac_llvm_context *ctx, LLVMTypeRef t) { - if (t == ctx->f16 || t == ctx->i16) + if (t == ctx->i8) + return ctx->i8; + else if (t == ctx->f16 || t == ctx->i16) return ctx->i16; else if (t == ctx->f32 || t == ctx->i32) return ctx->i32; @@ -253,7 +257,9 @@ ac_to_integer_or_pointer(struct ac_llvm_context *ctx, LLVMValueRef v) static LLVMTypeRef to_float_type_scalar(struct ac_llvm_context *ctx, LLVMTypeRef t) { - if (t == ctx->i16 || t == ctx->f16) + if (t == ctx->i8) + return ctx->i8; + else if (t == ctx->i16 || t == ctx->f16) return ctx->f16; else if (t == ctx->i32 || t == ctx->f32) return ctx->f32; diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h index 723aec53cbe..f6bf473f6a1 100644 --- a/src/amd/common/ac_llvm_build.h +++ b/src/amd/common/ac_llvm_build.h @@ -74,6 +74,8 @@ struct ac_llvm_context { LLVMTypeRef v4f32; LLVMTypeRef v8i32; + LLVMValueRef i8_0; + LLVMValueRef i8_1; LLVMValueRef i16_0; LLVMValueRef i16_1; LLVMValueRef i32_0; |