[llvm] r213017 - R600/SI: Default to no single precision denormals.

Matt Arsenault Matthew.Arsenault at amd.com
Mon Jul 14 16:40:43 PDT 2014


Author: arsenm
Date: Mon Jul 14 18:40:43 2014
New Revision: 213017

URL: http://llvm.org/viewvc/llvm-project?rev=213017&view=rev
Log:
R600/SI: Default to no single precision denormals.

Modified:
    llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp
    llvm/trunk/test/CodeGen/R600/default-fp-mode.ll

Modified: llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp?rev=213017&r1=213016&r2=213017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp Mon Jul 14 18:40:43 2014
@@ -47,10 +47,18 @@ using namespace llvm;
 // precision, and leaves single precision to flush all and does not report
 // CL_FP_DENORM for CL_DEVICE_SINGLE_FP_CONFIG. Mesa's OpenCL currently reports
 // CL_FP_DENORM for both.
+//
+// FIXME: It seems some instructions do not support single precision denormals
+// regardless of the mode (exp_*_f32, rcp_*_f32, rsq_*_f32, rsq_*f32, sqrt_f32,
+// and sin_f32, cos_f32 on most parts).
+
+// We want to use these instructions, and using fp32 denormals also causes
+// instructions to run at the double precision rate for the device so it's
+// probably best to just report no single precision denormals.
 static uint32_t getFPMode(const MachineFunction &) {
   return FP_ROUND_MODE_SP(FP_ROUND_ROUND_TO_NEAREST) |
          FP_ROUND_MODE_DP(FP_ROUND_ROUND_TO_NEAREST) |
-         FP_DENORM_MODE_SP(FP_DENORM_FLUSH_NONE) |
+         FP_DENORM_MODE_SP(FP_DENORM_FLUSH_IN_FLUSH_OUT) |
          FP_DENORM_MODE_DP(FP_DENORM_FLUSH_NONE);
 }
 

Modified: llvm/trunk/test/CodeGen/R600/default-fp-mode.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/default-fp-mode.ll?rev=213017&r1=213016&r2=213017&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/default-fp-mode.ll (original)
+++ llvm/trunk/test/CodeGen/R600/default-fp-mode.ll Mon Jul 14 18:40:43 2014
@@ -1,7 +1,7 @@
 ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI %s
 
 ; SI-LABEL: @test_kernel
-; SI: FloatMode: 240
+; SI: FloatMode: 192
 ; SI: IeeeMode: 0
 define void @test_kernel(float addrspace(1)* %out0, double addrspace(1)* %out1) nounwind {
   store float 0.0, float addrspace(1)* %out0





More information about the llvm-commits mailing list