[X86] ABI change for x86-32: pass 3 vector arguments in-register instead of 4, except...
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 19 May 2015 11:06:56 +0000 (11:06 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 19 May 2015 11:06:56 +0000 (11:06 +0000)
commit5440f2198dce5f02031d09390edf62a593af5370
tree6718394459ef395a86a598133f91c79e834fd1e3
parentef3ec7c7831f08b863daa9a66422eca8d68804d5
[X86] ABI change for x86-32: pass 3 vector arguments in-register instead of 4, except on Darwin.

This changes the ABI used on 32-bit x86 for passing vector arguments.
Historically, clang passes the first 4 vector arguments in-register, and additional vector arguments on the stack, regardless of platform. That is different from the behavior of gcc, icc, and msvc, all of which pass only the first 3 arguments in-register.
The 3-register convention is documented, unofficially, in Agner's calling convention guide, and, officially, in the recently released version 1.0 of the i386 psABI.

Darwin is kept as is because the OS X ABI Function Call Guide explicitly documents the current (4-register) behavior.

This fixes PR21510

Differential revision: http://reviews.llvm.org/D9644

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237682 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86CallingConv.td
test/CodeGen/X86/fp-trunc.ll
test/CodeGen/X86/illegal-vector-args-return.ll
test/CodeGen/X86/x86-32-vector-calling-conv.ll [new file with mode: 0644]