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"); + } } 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