ac: add 16-bit support to ac_build_bit_count()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 14 Sep 2018 10:52:38 +0000 (12:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 17 Sep 2018 13:18:34 +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 6955df48e003805c9c7d8612a834060599f748e8..98635ec25af08e0593b07c2dfa65b81e74cecea0 100644 (file)
@@ -2154,6 +2154,11 @@ LLVMValueRef ac_build_bit_count(struct ac_llvm_context *ctx, LLVMValueRef src0)
                                            (LLVMValueRef []) { src0 }, 1,
                                            AC_FUNC_ATTR_READNONE);
                break;
+       case 16:
+               result = ac_build_intrinsic(ctx, "llvm.ctpop.i16", ctx->i16,
+                                           (LLVMValueRef []) { src0 }, 1,
+                                           AC_FUNC_ATTR_READNONE);
+               break;
        default:
                unreachable(!"invalid bitsize");
                break;