SSE varargs arguments are passed in memory.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 22 Jan 2008 23:26:53 +0000 (23:26 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 22 Jan 2008 23:26:53 +0000 (23:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46262 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86CallingConv.td
test/CodeGen/X86/sse-varargs.ll [new file with mode: 0644]

index 1bfd021b365eb391dc85927dc132235db0cc7b11..4d674f73ce83196fcc923f4cbd7025e30b58b7ed 100644 (file)
@@ -190,8 +190,8 @@ def CC_X86_32_Common : CallingConv<[
   CCIfType<[f80], CCAssignToStack<0, 4>>,
 
   // The first 4 vector arguments are passed in XMM registers.
-  CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
-              CCAssignToReg<[XMM0, XMM1, XMM2, XMM3]>>,
+  CCIfNotVarArg<CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
+                CCAssignToReg<[XMM0, XMM1, XMM2, XMM3]>>>,
 
   // Other vectors get 16-byte stack slots that are 16-byte aligned.
   CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
diff --git a/test/CodeGen/X86/sse-varargs.ll b/test/CodeGen/X86/sse-varargs.ll
new file mode 100644 (file)
index 0000000..806126d
--- /dev/null
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xmm | grep esp
+
+define i32 @t() nounwind  {
+entry:
+       tail call void (i32, ...)* @foo( i32 1, <4 x i32> < i32 10, i32 11, i32 12, i32 13 > ) nounwind 
+       ret i32 0
+}
+
+declare void @foo(i32, ...)