ac: add 16-bit support to fract
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 21 Mar 2019 08:19:06 +0000 (09:19 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 21 Mar 2019 11:13:09 +0000 (12:13 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_llvm_build.c

index a153b008594d2bb5f09e383749b9b8da12c28c6f..8701d2ca43a88a57f9a290b02ca6bac9d46770b6 100644 (file)
@@ -2436,7 +2436,10 @@ LLVMValueRef ac_build_fract(struct ac_llvm_context *ctx, LLVMValueRef src0,
        LLVMTypeRef type;
        char *intr;
 
-       if (bitsize == 32) {
+       if (bitsize == 16) {
+               intr = "llvm.amdgcn.fract.f16";
+               type = ctx->f16;
+       } else if (bitsize == 32) {
                intr = "llvm.amdgcn.fract.f32";
                type = ctx->f32;
        } else {