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

Chris Lattner sabre at nondot.org
Sat Sep 20 12:17:54 PDT 2008


Author: lattner
Date: Sat Sep 20 14:17:53 2008
New Revision: 56391

URL: http://llvm.org/viewvc/llvm-project?rev=56391&view=rev
Log:
add a note

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

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

==============================================================================
--- llvm/trunk/lib/Target/X86/README-SSE.txt (original)
+++ llvm/trunk/lib/Target/X86/README-SSE.txt Sat Sep 20 14:17:53 2008
@@ -17,7 +17,7 @@
 
 //===---------------------------------------------------------------------===//
 
-Think about doing i64 math in SSE regs.
+Think about doing i64 math in SSE regs on x86-32.
 
 //===---------------------------------------------------------------------===//
 
@@ -876,3 +876,34 @@
 subsd		%xmm1,		%xmm0	// x in double precision
 cvtsd2ss	%xmm0,		%xmm0	// x in single precision
 
+//===---------------------------------------------------------------------===//
+rdar://5907648
+
+This function:
+
+float foo(unsigned char x) {
+  return x;
+}
+
+compiles to (x86-32):
+
+define float @foo(i8 zeroext  %x) nounwind  {
+	%tmp12 = uitofp i8 %x to float		; <float> [#uses=1]
+	ret float %tmp12
+}
+
+compiles to:
+
+_foo:
+	subl	$4, %esp
+	movzbl	8(%esp), %eax
+	cvtsi2ss	%eax, %xmm0
+	movss	%xmm0, (%esp)
+	flds	(%esp)
+	addl	$4, %esp
+	ret
+
+We should be able to use:
+  cvtsi2ss 8($esp), %xmm0
+since we know the stack slot is already zext'd.
+





More information about the llvm-commits mailing list