[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
llvm-svn: 237682
2015-05-19 19:06:56 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+avx512f | FileCheck %s --check-prefix=DARWIN
|
|
|
|
; RUN: llc < %s -mtriple=i686-pc-linux -mattr=+avx512f | FileCheck %s --check-prefix=LINUX
|
|
|
|
|
|
|
|
; CHECK-LABEL: test_sse:
|
2016-07-18 14:14:54 +08:00
|
|
|
; DARWIN: vpaddd %xmm3, %xmm2, %xmm2
|
|
|
|
; DARWIN: vpaddd %xmm2, %xmm1, %xmm1
|
[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
llvm-svn: 237682
2015-05-19 19:06:56 +08:00
|
|
|
; DARWIN: vpaddd %xmm1, %xmm0, %xmm0
|
2016-07-18 14:14:54 +08:00
|
|
|
; LINUX: vpaddd {{[0-9]+}}(%e{{s|b}}p), %xmm2, %xmm2
|
|
|
|
; LINUX: vpaddd %xmm2, %xmm1, %xmm1
|
[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
llvm-svn: 237682
2015-05-19 19:06:56 +08:00
|
|
|
; LINUX: vpaddd %xmm1, %xmm0, %xmm0
|
|
|
|
define <4 x i32> @test_sse(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> %d) nounwind {
|
|
|
|
%r0 = add <4 x i32> %a, %b
|
|
|
|
%r1 = add <4 x i32> %c, %d
|
|
|
|
%ret = add <4 x i32> %r0, %r1
|
|
|
|
ret <4 x i32> %ret
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: test_avx:
|
2016-07-18 14:14:54 +08:00
|
|
|
; DARWIN: vpaddd %ymm3, %ymm2, %ymm2
|
|
|
|
; DARWIN: vpaddd %ymm2, %ymm1, %ymm1
|
[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
llvm-svn: 237682
2015-05-19 19:06:56 +08:00
|
|
|
; DARWIN: vpaddd %ymm1, %ymm0, %ymm0
|
2016-07-18 14:14:54 +08:00
|
|
|
; LINUX: vpaddd {{[0-9]+}}(%e{{s|b}}p), %ymm2, %ymm2
|
|
|
|
; LINUX: vpaddd %ymm2, %ymm1, %ymm1
|
[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
llvm-svn: 237682
2015-05-19 19:06:56 +08:00
|
|
|
; LINUX: vpaddd %ymm1, %ymm0, %ymm0
|
|
|
|
define <8 x i32> @test_avx(<8 x i32> %a, <8 x i32> %b, <8 x i32> %c, <8 x i32> %d) nounwind {
|
|
|
|
%r0 = add <8 x i32> %a, %b
|
|
|
|
%r1 = add <8 x i32> %c, %d
|
|
|
|
%ret = add <8 x i32> %r0, %r1
|
|
|
|
ret <8 x i32> %ret
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: test_avx512:
|
2016-07-18 14:14:54 +08:00
|
|
|
; DARWIN: vpaddd %zmm3, %zmm2, %zmm2
|
|
|
|
; DARWIN: vpaddd %zmm2, %zmm1, %zmm1
|
[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
llvm-svn: 237682
2015-05-19 19:06:56 +08:00
|
|
|
; DARWIN: vpaddd %zmm1, %zmm0, %zmm0
|
2016-07-18 14:14:54 +08:00
|
|
|
; LINUX: vpaddd {{[0-9]+}}(%e{{s|b}}p), %zmm2, %zmm2
|
|
|
|
; LINUX: vpaddd %zmm2, %zmm1, %zmm1
|
[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
llvm-svn: 237682
2015-05-19 19:06:56 +08:00
|
|
|
; LINUX: vpaddd %zmm1, %zmm0, %zmm0
|
|
|
|
define <16 x i32> @test_avx512(<16 x i32> %a, <16 x i32> %b, <16 x i32> %c, <16 x i32> %d) nounwind {
|
|
|
|
%r0 = add <16 x i32> %a, %b
|
|
|
|
%r1 = add <16 x i32> %c, %d
|
|
|
|
%ret = add <16 x i32> %r0, %r1
|
|
|
|
ret <16 x i32> %ret
|
|
|
|
}
|