[llvm-commits] [llvm] r55840 - in /llvm/trunk: lib/Target/X86/X86CallingConv.td test/CodeGen/X86/constant-pool-remat-0.ll test/CodeGen/X86/fastcc-2.ll test/CodeGen/X86/fastcc.ll
Evan Cheng
evan.cheng at apple.com
Fri Sep 5 10:24:09 PDT 2008
Author: evancheng
Date: Fri Sep 5 12:24:07 2008
New Revision: 55840
URL: http://llvm.org/viewvc/llvm-project?rev=55840&view=rev
Log:
If SSE2 is available, x86 should pass first 3 f32/f64 arguments in XMM registers for fastcc calls.
Added:
llvm/trunk/test/CodeGen/X86/fastcc-2.ll
Modified:
llvm/trunk/lib/Target/X86/X86CallingConv.td
llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll
llvm/trunk/test/CodeGen/X86/fastcc.ll
Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=55840&r1=55839&r2=55840&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallingConv.td (original)
+++ llvm/trunk/lib/Target/X86/X86CallingConv.td Fri Sep 5 12:24:07 2008
@@ -352,6 +352,12 @@
// The first 2 integer arguments are passed in ECX/EDX
CCIfType<[i32], CCAssignToReg<[ECX, EDX]>>,
+ // The first 3 float or double arguments, if the call is not a vararg
+ // call and if SSE2 is available, are passed in SSE registers.
+ CCIfNotVarArg<CCIfType<[f32,f64],
+ CCIfSubtarget<"hasSSE2()",
+ CCAssignToReg<[XMM0,XMM1,XMM2]>>>>,
+
// Doubles get 8-byte slots that are 8-byte aligned.
CCIfType<[f64], CCAssignToStack<8, 8>>,
Modified: llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll?rev=55840&r1=55839&r2=55840&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll (original)
+++ llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll Fri Sep 5 12:24:07 2008
@@ -1,13 +1,13 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep LCPI | count 3
; RUN: llvm-as < %s | llc -march=x86-64 -stats -info-output-file - | grep asm-printer | grep 6
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep LCPI | count 3
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -info-output-file - | grep asm-printer | grep 8
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -info-output-file - | grep asm-printer | grep 12
-declare fastcc float @qux(float %y)
+declare float @qux(float %y)
-define fastcc float @array(float %a) nounwind {
+define float @array(float %a) nounwind {
%n = mul float %a, 9.0
- %m = call fastcc float @qux(float %n)
+ %m = call float @qux(float %n)
%o = mul float %m, 9.0
ret float %o
}
Added: llvm/trunk/test/CodeGen/X86/fastcc-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastcc-2.ll?rev=55840&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fastcc-2.ll (added)
+++ llvm/trunk/test/CodeGen/X86/fastcc-2.ll Fri Sep 5 12:24:07 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | grep movsd
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | grep mov | count 1
+
+define i32 @foo() nounwind {
+entry:
+ tail call fastcc void @bar( double 1.000000e+00 ) nounwind
+ ret i32 0
+}
+
+declare fastcc void @bar(double)
Modified: llvm/trunk/test/CodeGen/X86/fastcc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastcc.ll?rev=55840&r1=55839&r2=55840&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fastcc.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fastcc.ll Fri Sep 5 12:24:07 2008
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep mov | grep ecx | grep 0
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep mov | grep xmm0 | grep 16
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep mov | grep xmm0 | grep 8
@d = external global double ; <double*> [#uses=1]
@c = external global double ; <double*> [#uses=1]
More information about the llvm-commits
mailing list