[llvm-commits] [llvm] r45723 - /llvm/trunk/lib/Target/X86/README.txt

Chris Lattner sabre at nondot.org
Mon Jan 7 13:59:59 PST 2008


Author: lattner
Date: Mon Jan  7 15:59:58 2008
New Revision: 45723

URL: http://llvm.org/viewvc/llvm-project?rev=45723&view=rev
Log:
add a note that is important for some fp apps.

Modified:
    llvm/trunk/lib/Target/X86/README.txt

Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=45723&r1=45722&r2=45723&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Mon Jan  7 15:59:58 2008
@@ -1597,3 +1597,24 @@
 This would result in smaller code and more efficient microops.
 
 //===---------------------------------------------------------------------===//
+
+In SSE mode, we turn abs and neg into a load from the constant pool plus a xor
+or and instruction, for example:
+
+	xorpd	LCPI2_0-"L2$pb"(%esi), %xmm2
+
+However, if xmm2 gets spilled, we end up with really ugly code like this:
+
+	%xmm2 = reload [mem]
+	xorpd	LCPI2_0-"L2$pb"(%esi), %xmm2
+	store %xmm2 -> [mem]
+
+Since we 'know' that this is a 'neg', we can actually "fold" the spill into
+the neg/abs instruction, turning it into an *integer* operation, like this:
+
+	xorl 2147483648, [mem+4]     ## 2147483648 = (1 << 31)
+
+you could also use xorb, but xorl is less likely to lead to a partial register
+stall.
+
+//===---------------------------------------------------------------------===//





More information about the llvm-commits mailing list