From 2cbdd27305ef23a8e3b5aa320c2a7c67993d3b60 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 22 Jan 2008 23:26:53 +0000 Subject: [PATCH] SSE varargs arguments are passed in memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46262 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86CallingConv.td | 4 ++-- test/CodeGen/X86/sse-varargs.ll | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test/CodeGen/X86/sse-varargs.ll diff --git a/lib/Target/X86/X86CallingConv.td b/lib/Target/X86/X86CallingConv.td index 1bfd021b365..4d674f73ce8 100644 --- a/lib/Target/X86/X86CallingConv.td +++ b/lib/Target/X86/X86CallingConv.td @@ -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>>, // 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 index 00000000000..806126da2fa --- /dev/null +++ b/test/CodeGen/X86/sse-varargs.ll @@ -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, ...) -- 2.34.1