ac: add 16-bit support to ac_build_bitfield_reverse()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 14 Sep 2018 10:52:39 +0000 (12:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 17 Sep 2018 13:18:37 +0000 (15:18 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_llvm_build.c

index 98635ec25af08e0593b07c2dfa65b81e74cecea0..ab0ba09c83ae607536fa7b17ce71303f30e19d80 100644 (file)
@@ -2181,6 +2181,11 @@ LLVMValueRef ac_build_bitfield_reverse(struct ac_llvm_context *ctx,
                                            (LLVMValueRef []) { src0 }, 1,
                                            AC_FUNC_ATTR_READNONE);
                break;
+       case 16:
+               result = ac_build_intrinsic(ctx, "llvm.bitreverse.i16", ctx->i16,
+                                           (LLVMValueRef []) { src0 }, 1,
+                                           AC_FUNC_ATTR_READNONE);
+               break;
        default:
                unreachable(!"invalid bitsize");
                break;