mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-01 08:28:19 +00:00
Pass AVX vectors which are arguments to varargs functions on the stack. <rdar://problem/10463281>.
llvm-svn: 145573
This commit is contained in:
parent
d4569610df
commit
ad916965a6
@ -158,10 +158,15 @@ def CC_X86_64_C : CallingConv<[
|
||||
CCIfSubtarget<"hasXMM()",
|
||||
CCAssignToReg<[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7]>>>,
|
||||
|
||||
// The first 8 256-bit vector arguments are passed in YMM registers.
|
||||
CCIfType<[v32i8, v16i16, v8i32, v4i64, v8f32, v4f64],
|
||||
CCIfSubtarget<"hasAVX()",
|
||||
CCAssignToReg<[YMM0, YMM1, YMM2, YMM3, YMM4, YMM5, YMM6, YMM7]>>>,
|
||||
// The first 8 256-bit vector arguments are passed in YMM registers, unless
|
||||
// this is a vararg function.
|
||||
// FIXME: This isn't precisely correct; the x86-64 ABI document says that
|
||||
// fixed arguments to vararg functions are supposed to be passed in
|
||||
// registers. Actually modeling that would be a lot of work, though.
|
||||
CCIfNotVarArg<CCIfType<[v32i8, v16i16, v8i32, v4i64, v8f32, v4f64],
|
||||
CCIfSubtarget<"hasAVX()",
|
||||
CCAssignToReg<[YMM0, YMM1, YMM2, YMM3,
|
||||
YMM4, YMM5, YMM6, YMM7]>>>>,
|
||||
|
||||
// Integer/FP values get stored in stack slots that are 8 bytes in size and
|
||||
// 8-byte aligned if there are no more registers to hold them.
|
||||
|
15
test/CodeGen/X86/avx-varargs-x86_64.ll
Normal file
15
test/CodeGen/X86/avx-varargs-x86_64.ll
Normal file
@ -0,0 +1,15 @@
|
||||
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
|
||||
; <rdar://problem/10463281>
|
||||
; Check that the <8 x float> is passed on the stack.
|
||||
|
||||
@x = common global <8 x float> zeroinitializer, align 32
|
||||
declare i32 @f(i32, ...)
|
||||
|
||||
; CHECK: test1:
|
||||
; CHECK: vmovaps %ymm0, (%rsp)
|
||||
define void @test1() nounwind uwtable ssp {
|
||||
entry:
|
||||
%0 = load <8 x float>* @x, align 32
|
||||
%call = call i32 (i32, ...)* @f(i32 1, <8 x float> %0)
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue
Block a user