[PATCH] D43414: AMDGPU: Define FP_FAST_FMA{F} macros for amdgcn

Konstantin Zhuravlyov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 14:46:35 PST 2018


kzhuravl created this revision.
kzhuravl added a reviewer: t-tye.
Herald added subscribers: tpr, dstuttard, yaxunl, nhaehnle, wdng.

https://reviews.llvm.org/D43414

Files:
  lib/Basic/Targets/AMDGPU.cpp
  test/Driver/amdgpu-macros.cl


Index: test/Driver/amdgpu-macros.cl
===================================================================
--- test/Driver/amdgpu-macros.cl
+++ test/Driver/amdgpu-macros.cl
@@ -92,6 +92,9 @@
 // ARCH-GCN-DAG: #define __AMDGPU__ 1
 // ARCH-GCN-DAG: #define __AMDGCN__ 1
 
+// ARCH-GCN-DAG: #define FP_FAST_FMA 1
+// ARCH-GCN-DAG: #define FP_FAST_FMAF 1
+
 // GFX600: #define __gfx600__ 1
 // GFX601: #define __gfx601__ 1
 // GFX700: #define __gfx700__ 1
Index: lib/Basic/Targets/AMDGPU.cpp
===================================================================
--- lib/Basic/Targets/AMDGPU.cpp
+++ lib/Basic/Targets/AMDGPU.cpp
@@ -341,4 +341,9 @@
     Builder.defineMacro("__HAS_LDEXPF__");
   if (hasFP64)
     Builder.defineMacro("__HAS_FP64__");
+
+  if (getTriple().getArch() == llvm::Triple::amdgcn) {
+    Builder.defineMacro("FP_FAST_FMA");
+    Builder.defineMacro("FP_FAST_FMAF");
+  }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43414.134730.patch
Type: text/x-patch
Size: 891 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180216/dfa2e973/attachment.bin>


More information about the llvm-commits mailing list