[Mesa-dev] [PATCH] amd/common: use llvm.amdgcn.wqm for explicit derivatives
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Thu May 3 17:48:19 UTC 2018
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Thu, May 3, 2018 at 5:18 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> To comply with an upcoming change in LLVM, see
> https://reviews.llvm.org/D46051
> ---
> src/amd/common/ac_llvm_build.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
> index f21a5d2623c..c9b2e36b632 100644
> --- a/src/amd/common/ac_llvm_build.c
> +++ b/src/amd/common/ac_llvm_build.c
> @@ -1241,20 +1241,27 @@ ac_build_ddxy(struct ac_llvm_context *ctx,
> trbl = ac_build_intrinsic(ctx,
> "llvm.amdgcn.ds.swizzle", ctx->i32,
> args, 2,
> AC_FUNC_ATTR_READNONE |
> AC_FUNC_ATTR_CONVERGENT);
> }
>
> tl = LLVMBuildBitCast(ctx->builder, tl, ctx->f32, "");
> trbl = LLVMBuildBitCast(ctx->builder, trbl, ctx->f32, "");
> result = LLVMBuildFSub(ctx->builder, trbl, tl, "");
> +
> + if (HAVE_LLVM >= 0x0700) {
> + result = ac_build_intrinsic(ctx,
> + "llvm.amdgcn.wqm.f32", ctx->f32,
> + &result, 1, 0);
> + }
> +
> return result;
> }
>
> void
> ac_build_sendmsg(struct ac_llvm_context *ctx,
> uint32_t msg,
> LLVMValueRef wave_id)
> {
> LLVMValueRef args[2];
> args[0] = LLVMConstInt(ctx->i32, msg, false);
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list