Mesa (master): amd/common: use llvm.amdgcn.wqm for explicit derivatives

Nicolai Hähnle nh at kemper.freedesktop.org
Fri May 4 09:03:07 UTC 2018


Module: Mesa
Branch: master
Commit: c0acb596f45624e2bc9ba7285e20bc744a532dbe
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c0acb596f45624e2bc9ba7285e20bc744a532dbe

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Tue May  1 11:06:18 2018 +0200

amd/common: use llvm.amdgcn.wqm for explicit derivatives

To comply with an upcoming change in LLVM, see
https://reviews.llvm.org/D46051

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 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 f21a5d2623..c9b2e36b63 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1248,6 +1248,13 @@ ac_build_ddxy(struct ac_llvm_context *ctx,
 	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;
 }
 




More information about the mesa-commit mailing list