[llvm-branch-commits] [llvm-branch] r165524 - /llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td

Tom Stellard thomas.stellard at amd.com
Tue Oct 9 11:49:01 PDT 2012


Author: tstellar
Date: Tue Oct  9 13:49:01 2012
New Revision: 165524

URL: http://llvm.org/viewvc/llvm-project?rev=165524&view=rev
Log:
R600: Add a comment explaining why we use TRUNC before FLT_TO_*INT

Modified:
    llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td

Modified: llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td?rev=165524&r1=165523&r2=165524&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td Tue Oct  9 13:49:01 2012
@@ -1022,6 +1022,16 @@
 
   def UINT_TO_FLT_eg : UINT_TO_FLT_Common<0x9C>;
 
+  // TRUNC is used for the FLT_TO_INT instructions to work around a
+  // perceived problem where the rounding modes are applied differently
+  // depending on the instruction and the slot they are in.
+  // See:
+  // https://bugs.freedesktop.org/show_bug.cgi?id=50232
+  // Mesa commit: a1a0974401c467cb86ef818f22df67c21774a38c
+  //
+  // XXX: Lowering SELECT_CC will sometimes generate fp_to_[su]int nodes,
+  // which do not need to be truncated since the fp values are 0.0f or 1.0f.
+  // We should look into handling these cases separately.
   def : Pat<(fp_to_sint R600_Reg32:$src),
     (FLT_TO_INT_eg (TRUNC R600_Reg32:$src))>;
 





More information about the llvm-branch-commits mailing list