-; RUN: llc < %s -mtriple=i386-pc-win32 -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck --check-prefix=X32 %s\r
-; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck --check-prefix=WIN64 %s\r
-; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck --check-prefix=LINUXOSX64 %s \r
-\r
-; X32-LABEL: test_argReti1:\r
-; X32: kmov{{.*}} %eax, %k{{[0-7]}}\r
-; X32: kmov{{.*}} %k{{[0-7]}}, %eax\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argReti1:\r
-; WIN64: kmov{{.*}} %eax, %k{{[0-7]}}\r
-; WIN64: kmov{{.*}} %k{{[0-7]}}, %eax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning i1\r
-define x86_regcallcc i1 @test_argReti1(i1 %a) {\r
- %add = add i1 %a, 1\r
- ret i1 %add\r
-}\r
-\r
-; X32-LABEL: test_CallargReti1:\r
-; X32: kmov{{.*}} %k{{[0-7]}}, %eax\r
-; X32: call{{.*}} {{.*}}test_argReti1\r
-; X32: kmov{{.*}} %eax, %k{{[0-7]}}\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargReti1:\r
-; WIN64: kmov{{.*}} %k{{[0-7]}}, %eax\r
-; WIN64: call{{.*}} {{.*}}test_argReti1\r
-; WIN64: kmov{{.*}} %eax, %k{{[0-7]}}\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving i1\r
-define x86_regcallcc i1 @test_CallargReti1(i1 %a) {\r
- %b = add i1 %a, 1\r
- %c = call x86_regcallcc i1 @test_argReti1(i1 %b)\r
- %d = add i1 %c, 1\r
- ret i1 %d\r
-}\r
-\r
-; X32-LABEL: test_argReti8:\r
-; X32: incb %al\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argReti8:\r
-; WIN64: incb %al\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning i8\r
-define x86_regcallcc i8 @test_argReti8(i8 %a) {\r
- %add = add i8 %a, 1\r
- ret i8 %add\r
-}\r
-\r
-; X32-LABEL: test_CallargReti8:\r
-; X32: incb %al\r
-; X32: call{{.*}} {{.*}}test_argReti8\r
-; X32: incb %al\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargReti8:\r
-; WIN64: incb %al\r
-; WIN64: call{{.*}} {{.*}}test_argReti8\r
-; WIN64: incb %al\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving i8\r
-define x86_regcallcc i8 @test_CallargReti8(i8 %a) {\r
- %b = add i8 %a, 1\r
- %c = call x86_regcallcc i8 @test_argReti8(i8 %b)\r
- %d = add i8 %c, 1\r
- ret i8 %d\r
-}\r
-\r
-; X32-LABEL: test_argReti16:\r
-; X32: incl %eax\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argReti16:\r
-; WIN64: incl %eax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning i16\r
-define x86_regcallcc i16 @test_argReti16(i16 %a) {\r
- %add = add i16 %a, 1\r
- ret i16 %add\r
-}\r
-\r
-; X32-LABEL: test_CallargReti16:\r
-; X32: incl %eax\r
-; X32: call{{.*}} {{.*}}test_argReti16\r
-; X32: incl %eax\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargReti16:\r
-; WIN64: incl %eax\r
-; WIN64: call{{.*}} {{.*}}test_argReti16\r
-; WIN64: incl %eax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving i16\r
-define x86_regcallcc i16 @test_CallargReti16(i16 %a) {\r
- %b = add i16 %a, 1\r
- %c = call x86_regcallcc i16 @test_argReti16(i16 %b)\r
- %d = add i16 %c, 1\r
- ret i16 %d\r
-}\r
-\r
-; X32-LABEL: test_argReti32:\r
-; X32: incl %eax\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argReti32:\r
-; WIN64: incl %eax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning i32\r
-define x86_regcallcc i32 @test_argReti32(i32 %a) {\r
- %add = add i32 %a, 1\r
- ret i32 %add\r
-}\r
-\r
-; X32-LABEL: test_CallargReti32:\r
-; X32: incl %eax\r
-; X32: call{{.*}} {{.*}}test_argReti32\r
-; X32: incl %eax\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargReti32:\r
-; WIN64: incl %eax\r
-; WIN64: call{{.*}} {{.*}}test_argReti32\r
-; WIN64: incl %eax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving i32\r
-define x86_regcallcc i32 @test_CallargReti32(i32 %a) {\r
- %b = add i32 %a, 1\r
- %c = call x86_regcallcc i32 @test_argReti32(i32 %b)\r
- %d = add i32 %c, 1\r
- ret i32 %d\r
-}\r
-\r
-; X32-LABEL: test_argReti64:\r
-; X32: addl $3, %eax\r
-; X32: adcl $1, %ecx\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argReti64:\r
-; WIN64: movabsq $4294967299, %r{{.*}}\r
-; WIN64: addq %r{{.*}}, %rax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning i64\r
-define x86_regcallcc i64 @test_argReti64(i64 %a) {\r
- %add = add i64 %a, 4294967299\r
- ret i64 %add\r
-}\r
-\r
-; X32-LABEL: test_CallargReti64:\r
-; X32: add{{.*}} $1, %eax\r
-; X32: adcl $0, {{%e(cx|dx|si|di|bx|bp)}}\r
-; X32: call{{.*}} {{.*}}test_argReti64\r
-; X32: add{{.*}} $1, %eax\r
-; X32: adcl $0, {{%e(cx|dx|si|di|bx|bp)}}\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargReti64:\r
-; WIN64: incq %rax\r
-; WIN64: call{{.*}} {{.*}}test_argReti64\r
-; WIN64: incq %rax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving i64\r
-define x86_regcallcc i64 @test_CallargReti64(i64 %a) {\r
- %b = add i64 %a, 1\r
- %c = call x86_regcallcc i64 @test_argReti64(i64 %b)\r
- %d = add i64 %c, 1\r
- ret i64 %d\r
-}\r
-\r
-; X32-LABEL: test_argRetFloat:\r
-; X32: vadd{{.*}} {{.*}}, %xmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argRetFloat:\r
-; WIN64: vadd{{.*}} {{.*}}, %xmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning float\r
-define x86_regcallcc float @test_argRetFloat(float %a) {\r
- %add = fadd float 1.0, %a\r
- ret float %add\r
-}\r
-\r
-; X32-LABEL: test_CallargRetFloat:\r
-; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0\r
-; X32: call{{.*}} {{.*}}test_argRetFloat\r
-; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargRetFloat:\r
-; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0\r
-; WIN64: call{{.*}} {{.*}}test_argRetFloat\r
-; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving float\r
-define x86_regcallcc float @test_CallargRetFloat(float %a) {\r
- %b = fadd float 1.0, %a\r
- %c = call x86_regcallcc float @test_argRetFloat(float %b)\r
- %d = fadd float 1.0, %c\r
- ret float %d\r
-}\r
-\r
-; X32-LABEL: test_argRetDouble:\r
-; X32: vadd{{.*}} {{.*}}, %xmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argRetDouble:\r
-; WIN64: vadd{{.*}} {{.*}}, %xmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning double\r
-define x86_regcallcc double @test_argRetDouble(double %a) {\r
- %add = fadd double %a, 1.0\r
- ret double %add\r
-}\r
-\r
-; X32-LABEL: test_CallargRetDouble:\r
-; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0\r
-; X32: call{{.*}} {{.*}}test_argRetDouble\r
-; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargRetDouble:\r
-; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0\r
-; WIN64: call{{.*}} {{.*}}test_argRetDouble\r
-; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving double\r
-define x86_regcallcc double @test_CallargRetDouble(double %a) {\r
- %b = fadd double 1.0, %a\r
- %c = call x86_regcallcc double @test_argRetDouble(double %b)\r
- %d = fadd double 1.0, %c\r
- ret double %d\r
-}\r
-\r
-; X32-LABEL: test_argRetPointer:\r
-; X32: incl %eax\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argRetPointer:\r
-; WIN64: incl %eax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning pointer\r
-define x86_regcallcc [4 x i32]* @test_argRetPointer([4 x i32]* %a) {\r
- %b = ptrtoint [4 x i32]* %a to i32\r
- %c = add i32 %b, 1\r
- %d = inttoptr i32 %c to [4 x i32]*\r
- ret [4 x i32]* %d\r
-}\r
-\r
-; X32-LABEL: test_CallargRetPointer:\r
-; X32: incl %eax\r
-; X32: call{{.*}} {{.*}}test_argRetPointer\r
-; X32: incl %eax\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargRetPointer:\r
-; WIN64: incl %eax\r
-; WIN64: call{{.*}} {{.*}}test_argRetPointer\r
-; WIN64: incl %eax\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving pointer\r
-define x86_regcallcc [4 x i32]* @test_CallargRetPointer([4 x i32]* %a) {\r
- %b = ptrtoint [4 x i32]* %a to i32\r
- %c = add i32 %b, 1\r
- %d = inttoptr i32 %c to [4 x i32]*\r
- %e = call x86_regcallcc [4 x i32]* @test_argRetPointer([4 x i32]* %d)\r
- %f = ptrtoint [4 x i32]* %e to i32\r
- %g = add i32 %f, 1\r
- %h = inttoptr i32 %g to [4 x i32]*\r
- ret [4 x i32]* %h\r
-}\r
-\r
-; X32-LABEL: test_argRet128Vector:\r
-; X32: vpblend{{.*}} %xmm0, %xmm1, %xmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argRet128Vector:\r
-; WIN64: vpblend{{.*}} %xmm0, %xmm1, %xmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning 128 bit vector\r
-define x86_regcallcc <4 x i32> @test_argRet128Vector(<4 x i32> %a, <4 x i32> %b) {\r
- %d = select <4 x i1> undef , <4 x i32> %a, <4 x i32> %b\r
- ret <4 x i32> %d\r
-}\r
-\r
-; X32-LABEL: test_CallargRet128Vector:\r
-; X32: vmov{{.*}} %xmm0, {{%xmm([0-7])}}\r
-; X32: call{{.*}} {{.*}}test_argRet128Vector\r
-; X32: vpblend{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargRet128Vector:\r
-; WIN64: vmov{{.*}} %xmm0, {{%xmm([0-9]+)}}\r
-; WIN64: call{{.*}} {{.*}}test_argRet128Vector\r
-; WIN64: vpblend{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving 128 bit vector\r
-define x86_regcallcc <4 x i32> @test_CallargRet128Vector(<4 x i32> %a) {\r
- %b = call x86_regcallcc <4 x i32> @test_argRet128Vector(<4 x i32> %a, <4 x i32> %a)\r
- %c = select <4 x i1> undef , <4 x i32> %a, <4 x i32> %b\r
- ret <4 x i32> %c\r
-}\r
-\r
-; X32-LABEL: test_argRet256Vector:\r
-; X32: vpblend{{.*}} %ymm0, %ymm1, %ymm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argRet256Vector:\r
-; WIN64: vpblend{{.*}} %ymm0, %ymm1, %ymm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning 256 bit vector\r
-define x86_regcallcc <8 x i32> @test_argRet256Vector(<8 x i32> %a, <8 x i32> %b) {\r
- %d = select <8 x i1> undef , <8 x i32> %a, <8 x i32> %b\r
- ret <8 x i32> %d\r
-}\r
-\r
-; X32-LABEL: test_CallargRet256Vector:\r
-; X32: vmov{{.*}} %ymm0, %ymm1\r
-; X32: call{{.*}} {{.*}}test_argRet256Vector\r
-; X32: vpblend{{.*}} %ymm1, %ymm0, %ymm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargRet256Vector:\r
-; WIN64: vmov{{.*}} %ymm0, %ymm1\r
-; WIN64: call{{.*}} {{.*}}test_argRet256Vector\r
-; WIN64: vpblend{{.*}} %ymm1, %ymm0, %ymm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving 256 bit vector\r
-define x86_regcallcc <8 x i32> @test_CallargRet256Vector(<8 x i32> %a) {\r
- %b = call x86_regcallcc <8 x i32> @test_argRet256Vector(<8 x i32> %a, <8 x i32> %a)\r
- %c = select <8 x i1> undef , <8 x i32> %a, <8 x i32> %b\r
- ret <8 x i32> %c\r
-}\r
-\r
-; X32-LABEL: test_argRet512Vector:\r
-; X32: vpblend{{.*}} %zmm0, %zmm1, %zmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argRet512Vector:\r
-; WIN64: vpblend{{.*}} %zmm0, %zmm1, %zmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning 512 bit vector\r
-define x86_regcallcc <16 x i32> @test_argRet512Vector(<16 x i32> %a, <16 x i32> %b) {\r
- %d = select <16 x i1> undef , <16 x i32> %a, <16 x i32> %b\r
- ret <16 x i32> %d\r
-}\r
-\r
-; X32-LABEL: test_CallargRet512Vector:\r
-; X32: vmov{{.*}} %zmm0, %zmm1\r
-; X32: call{{.*}} {{.*}}test_argRet512Vector\r
-; X32: vpblend{{.*}} %zmm1, %zmm0, %zmm0\r
-; X32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargRet512Vector:\r
-; WIN64: vmov{{.*}} %zmm0, %zmm1\r
-; WIN64: call{{.*}} {{.*}}test_argRet512Vector\r
-; WIN64: vpblend{{.*}} %zmm1, %zmm0, %zmm0\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving 512 bit vector\r
-define x86_regcallcc <16 x i32> @test_CallargRet512Vector(<16 x i32> %a) {\r
- %b = call x86_regcallcc <16 x i32> @test_argRet512Vector(<16 x i32> %a, <16 x i32> %a)\r
- %c = select <16 x i1> undef , <16 x i32> %a, <16 x i32> %b\r
- ret <16 x i32> %c\r
-}\r
-\r
-; WIN64-LABEL: testf32_inp\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; WIN64: retq\r
-\r
-; X32-LABEL: testf32_inp\r
-; X32: vmovups {{%xmm([0-7])}}, {{.*(%esp).*}} {{#+}} 16-byte Spill\r
-; X32: vmovups {{%xmm([0-7])}}, {{.*(%esp).*}} {{#+}} 16-byte Spill\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}\r
-; X32: vmovups {{.*(%esp).*}}, {{%xmm([0-7])}} {{#+}} 16-byte Reload\r
-; X32: vmovups {{.*(%esp).*}}, {{%xmm([0-7])}} {{#+}} 16-byte Reload\r
-; X32: retl\r
-\r
-; LINUXOSX64-LABEL: testf32_inp\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}\r
-; LINUXOSX64: retq\r
-\r
-; Test regcall when running multiple input parameters - callee saved XMMs\r
-define x86_regcallcc <32 x float> @testf32_inp(<32 x float> %a, <32 x float> %b, <32 x float> %c) nounwind {\r
- %x1 = fadd <32 x float> %a, %b\r
- %x2 = fmul <32 x float> %a, %b\r
- %x3 = fsub <32 x float> %x1, %x2\r
- %x4 = fadd <32 x float> %x3, %c\r
- ret <32 x float> %x4\r
-}\r
-\r
-; X32-LABEL: pushl {{%e(si|di|bx|bp)}}\r
-; X32: pushl {{%e(si|di|bx|bp)}}\r
-; X32: pushl {{%e(si|di|bx|bp)}}\r
-; X32: pushl {{%e(si|di|bx|bp)}}\r
-; X32: popl {{%e(si|di|bx|bp)}}\r
-; X32: popl {{%e(si|di|bx|bp)}}\r
-; X32: popl {{%e(si|di|bx|bp)}}\r
-; X32: popl {{%e(si|di|bx|bp)}}\r
-; X32: retl\r
-\r
-; WIN64-LABEL: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: retq\r
-\r
-; LINUXOSX64-LABEL: pushq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX64: pushq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX64: pushq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX64: popq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX64: popq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX64: popq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX64: retq\r
-\r
-; Test regcall when running multiple input parameters - callee saved GPRs\r
-define x86_regcallcc i32 @testi32_inp(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6,\r
- i32 %b1, i32 %b2, i32 %b3, i32 %b4, i32 %b5, i32 %b6) nounwind {\r
- %x1 = sub i32 %a1, %a2\r
- %x2 = sub i32 %a3, %a4\r
- %x3 = sub i32 %a5, %a6\r
- %y1 = sub i32 %b1, %b2\r
- %y2 = sub i32 %b3, %b4\r
- %y3 = sub i32 %b5, %b6\r
- %v1 = add i32 %a1, %a2\r
- %v2 = add i32 %a3, %a4\r
- %v3 = add i32 %a5, %a6\r
- %w1 = add i32 %b1, %b2\r
- %w2 = add i32 %b3, %b4\r
- %w3 = add i32 %b5, %b6\r
- %s1 = mul i32 %x1, %y1\r
- %s2 = mul i32 %x2, %y2\r
- %s3 = mul i32 %x3, %y3\r
- %t1 = mul i32 %v1, %w1\r
- %t2 = mul i32 %v2, %w2\r
- %t3 = mul i32 %v3, %w3\r
- %m1 = add i32 %s1, %s2\r
- %m2 = add i32 %m1, %s3\r
- %n1 = add i32 %t1, %t2\r
- %n2 = add i32 %n1, %t3\r
- %r1 = add i32 %m2, %n2\r
- ret i32 %r1\r
-}\r
-\r
-; X32-LABEL: testf32_stack\r
-; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-1])}}\r
-; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-1])}}\r
-; X32: retl\r
-\r
-; LINUXOSX64-LABEL: testf32_stack\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}\r
-; LINUXOSX64: vaddps {{([0-9])+}}(%rbp), {{%zmm([0-9]+)}}, {{%zmm([0-1])}}\r
-; LINUXOSX64: vaddps {{([0-9])+}}(%rbp), {{%zmm([0-9]+)}}, {{%zmm([0-1])}}\r
-; LINUXOSX64: retq\r
-\r
-; Test that parameters, overflowing register capacity, are passed through the stack\r
-define x86_regcallcc <32 x float> @testf32_stack(<32 x float> %a0, <32 x float> %b0, <32 x float> %c0, \r
- <32 x float> %a1, <32 x float> %b1, <32 x float> %c1,\r
- <32 x float> %a2, <32 x float> %b2, <32 x float> %c2) nounwind {\r
- %x1 = fadd <32 x float> %a0, %b0\r
- %x2 = fadd <32 x float> %c0, %x1\r
- %x3 = fadd <32 x float> %a1, %x2\r
- %x4 = fadd <32 x float> %b1, %x3\r
- %x5 = fadd <32 x float> %c1, %x4\r
- %x6 = fadd <32 x float> %a2, %x5\r
- %x7 = fadd <32 x float> %b2, %x6\r
- %x8 = fadd <32 x float> %c2, %x7\r
- ret <32 x float> %x8\r
-}\r
-\r
-; X32-LABEL: vmovd %edx, {{%xmm([0-9])}}\r
-; X32: vcvtsi2sdl %eax, {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; X32: vcvtsi2sdl %ecx, {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; X32: vcvtsi2sdl %esi, {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; X32: vaddsd %xmm1, %xmm0, %xmm0\r
-; X32: vcvttsd2si %xmm0, %eax\r
-; X32: retl\r
-\r
-; LINUXOSX64-LABEL: test_argRetMixTypes\r
-; LINUXOSX64: vcvtss2sd %xmm1, %xmm1, %xmm1\r
-; LINUXOSX64: vcvtsi2sdl %eax, {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; LINUXOSX64: vcvtsi2sdl %ecx, {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; LINUXOSX64: vcvtsi2sdq %rdx, {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; LINUXOSX64: vcvtsi2sdl %edi, {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; LINUXOSX64: vcvtsi2sdl (%rsi), {{%xmm([0-9])}}, {{%xmm([0-9])}}\r
-; LINUXOSX64: vcvttsd2si {{%xmm([0-9])}}, %eax\r
-\r
-; Test regcall when passing/retrieving mixed types\r
-define x86_regcallcc i32 @test_argRetMixTypes(double, float, i8 signext, i32, i64, i16 signext, i32*) #0 {\r
- %8 = fpext float %1 to double\r
- %9 = fadd double %8, %0\r
- %10 = sitofp i8 %2 to double\r
- %11 = fadd double %9, %10\r
- %12 = sitofp i32 %3 to double\r
- %13 = fadd double %11, %12\r
- %14 = sitofp i64 %4 to double\r
- %15 = fadd double %13, %14\r
- %16 = sitofp i16 %5 to double\r
- %17 = fadd double %15, %16\r
- %18 = load i32, i32* %6, align 4\r
- %19 = sitofp i32 %18 to double\r
- %20 = fadd double %17, %19\r
- %21 = fptosi double %20 to i32\r
- ret i32 %21\r
-}\r
-\r
-%struct.complex = type { float, double, i32, i8, i64}\r
-\r
-\r
-; X32-LABEL: test_argMultiRet \r
-; X32: vaddsd {{.*}}, %xmm1, %xmm1\r
-; X32: movl $4, %eax\r
-; X32: movb $7, %cl\r
-; X32: movl $999, %edx\r
-; X32: xorl %edi, %edi\r
-; X32: retl\r
-\r
-; LINUXOSX64-LABEL: test_argMultiRet \r
-; LINUXOSX64: vaddsd {{.*}}, %xmm1, %xmm1\r
-; LINUXOSX64: movl $4, %eax\r
-; LINUXOSX64: movb $7, %cl\r
-; LINUXOSX64: movl $999, %edx\r
-; LINUXOSX64: retq\r
- \r
-define x86_regcallcc %struct.complex @test_argMultiRet(float, double, i32, i8, i64) local_unnamed_addr #0 {\r
- %6 = fadd double %1, 5.000000e+00\r
- %7 = insertvalue %struct.complex undef, float %0, 0\r
- %8 = insertvalue %struct.complex %7, double %6, 1\r
- %9 = insertvalue %struct.complex %8, i32 4, 2\r
- %10 = insertvalue %struct.complex %9, i8 7, 3\r
- %11 = insertvalue %struct.complex %10, i64 999, 4\r
- ret %struct.complex %11\r
-}\r
-\r
+; RUN: llc < %s -mtriple=i386-pc-win32 -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck --check-prefix=X32 %s
+; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck --check-prefix=WIN64 %s
+; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck --check-prefix=LINUXOSX64 %s
+
+; X32-LABEL: test_argReti1:
+; X32: kmov{{.*}} %eax, %k{{[0-7]}}
+; X32: kmov{{.*}} %k{{[0-7]}}, %eax
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argReti1:
+; WIN64: kmov{{.*}} %eax, %k{{[0-7]}}
+; WIN64: kmov{{.*}} %k{{[0-7]}}, %eax
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning i1
+define x86_regcallcc i1 @test_argReti1(i1 %a) {
+ %add = add i1 %a, 1
+ ret i1 %add
+}
+
+; X32-LABEL: test_CallargReti1:
+; X32: kmov{{.*}} %k{{[0-7]}}, %eax
+; X32: call{{.*}} {{.*}}test_argReti1
+; X32: kmov{{.*}} %eax, %k{{[0-7]}}
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargReti1:
+; WIN64: kmov{{.*}} %k{{[0-7]}}, %eax
+; WIN64: call{{.*}} {{.*}}test_argReti1
+; WIN64: kmov{{.*}} %eax, %k{{[0-7]}}
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving i1
+define x86_regcallcc i1 @test_CallargReti1(i1 %a) {
+ %b = add i1 %a, 1
+ %c = call x86_regcallcc i1 @test_argReti1(i1 %b)
+ %d = add i1 %c, 1
+ ret i1 %d
+}
+
+; X32-LABEL: test_argReti8:
+; X32: incb %al
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argReti8:
+; WIN64: incb %al
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning i8
+define x86_regcallcc i8 @test_argReti8(i8 %a) {
+ %add = add i8 %a, 1
+ ret i8 %add
+}
+
+; X32-LABEL: test_CallargReti8:
+; X32: incb %al
+; X32: call{{.*}} {{.*}}test_argReti8
+; X32: incb %al
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargReti8:
+; WIN64: incb %al
+; WIN64: call{{.*}} {{.*}}test_argReti8
+; WIN64: incb %al
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving i8
+define x86_regcallcc i8 @test_CallargReti8(i8 %a) {
+ %b = add i8 %a, 1
+ %c = call x86_regcallcc i8 @test_argReti8(i8 %b)
+ %d = add i8 %c, 1
+ ret i8 %d
+}
+
+; X32-LABEL: test_argReti16:
+; X32: incl %eax
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argReti16:
+; WIN64: incl %eax
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning i16
+define x86_regcallcc i16 @test_argReti16(i16 %a) {
+ %add = add i16 %a, 1
+ ret i16 %add
+}
+
+; X32-LABEL: test_CallargReti16:
+; X32: incl %eax
+; X32: call{{.*}} {{.*}}test_argReti16
+; X32: incl %eax
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargReti16:
+; WIN64: incl %eax
+; WIN64: call{{.*}} {{.*}}test_argReti16
+; WIN64: incl %eax
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving i16
+define x86_regcallcc i16 @test_CallargReti16(i16 %a) {
+ %b = add i16 %a, 1
+ %c = call x86_regcallcc i16 @test_argReti16(i16 %b)
+ %d = add i16 %c, 1
+ ret i16 %d
+}
+
+; X32-LABEL: test_argReti32:
+; X32: incl %eax
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argReti32:
+; WIN64: incl %eax
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning i32
+define x86_regcallcc i32 @test_argReti32(i32 %a) {
+ %add = add i32 %a, 1
+ ret i32 %add
+}
+
+; X32-LABEL: test_CallargReti32:
+; X32: incl %eax
+; X32: call{{.*}} {{.*}}test_argReti32
+; X32: incl %eax
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargReti32:
+; WIN64: incl %eax
+; WIN64: call{{.*}} {{.*}}test_argReti32
+; WIN64: incl %eax
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving i32
+define x86_regcallcc i32 @test_CallargReti32(i32 %a) {
+ %b = add i32 %a, 1
+ %c = call x86_regcallcc i32 @test_argReti32(i32 %b)
+ %d = add i32 %c, 1
+ ret i32 %d
+}
+
+; X32-LABEL: test_argReti64:
+; X32: addl $3, %eax
+; X32: adcl $1, %ecx
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argReti64:
+; WIN64: movabsq $4294967299, %r{{.*}}
+; WIN64: addq %r{{.*}}, %rax
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning i64
+define x86_regcallcc i64 @test_argReti64(i64 %a) {
+ %add = add i64 %a, 4294967299
+ ret i64 %add
+}
+
+; X32-LABEL: test_CallargReti64:
+; X32: add{{.*}} $1, %eax
+; X32: adcl $0, {{%e(cx|dx|si|di|bx|bp)}}
+; X32: call{{.*}} {{.*}}test_argReti64
+; X32: add{{.*}} $1, %eax
+; X32: adcl $0, {{%e(cx|dx|si|di|bx|bp)}}
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargReti64:
+; WIN64: incq %rax
+; WIN64: call{{.*}} {{.*}}test_argReti64
+; WIN64: incq %rax
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving i64
+define x86_regcallcc i64 @test_CallargReti64(i64 %a) {
+ %b = add i64 %a, 1
+ %c = call x86_regcallcc i64 @test_argReti64(i64 %b)
+ %d = add i64 %c, 1
+ ret i64 %d
+}
+
+; X32-LABEL: test_argRetFloat:
+; X32: vadd{{.*}} {{.*}}, %xmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argRetFloat:
+; WIN64: vadd{{.*}} {{.*}}, %xmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning float
+define x86_regcallcc float @test_argRetFloat(float %a) {
+ %add = fadd float 1.0, %a
+ ret float %add
+}
+
+; X32-LABEL: test_CallargRetFloat:
+; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0
+; X32: call{{.*}} {{.*}}test_argRetFloat
+; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargRetFloat:
+; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0
+; WIN64: call{{.*}} {{.*}}test_argRetFloat
+; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving float
+define x86_regcallcc float @test_CallargRetFloat(float %a) {
+ %b = fadd float 1.0, %a
+ %c = call x86_regcallcc float @test_argRetFloat(float %b)
+ %d = fadd float 1.0, %c
+ ret float %d
+}
+
+; X32-LABEL: test_argRetDouble:
+; X32: vadd{{.*}} {{.*}}, %xmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argRetDouble:
+; WIN64: vadd{{.*}} {{.*}}, %xmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning double
+define x86_regcallcc double @test_argRetDouble(double %a) {
+ %add = fadd double %a, 1.0
+ ret double %add
+}
+
+; X32-LABEL: test_CallargRetDouble:
+; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0
+; X32: call{{.*}} {{.*}}test_argRetDouble
+; X32: vadd{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargRetDouble:
+; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0
+; WIN64: call{{.*}} {{.*}}test_argRetDouble
+; WIN64: vadd{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving double
+define x86_regcallcc double @test_CallargRetDouble(double %a) {
+ %b = fadd double 1.0, %a
+ %c = call x86_regcallcc double @test_argRetDouble(double %b)
+ %d = fadd double 1.0, %c
+ ret double %d
+}
+
+; X32-LABEL: test_argRetPointer:
+; X32: incl %eax
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argRetPointer:
+; WIN64: incl %eax
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning pointer
+define x86_regcallcc [4 x i32]* @test_argRetPointer([4 x i32]* %a) {
+ %b = ptrtoint [4 x i32]* %a to i32
+ %c = add i32 %b, 1
+ %d = inttoptr i32 %c to [4 x i32]*
+ ret [4 x i32]* %d
+}
+
+; X32-LABEL: test_CallargRetPointer:
+; X32: incl %eax
+; X32: call{{.*}} {{.*}}test_argRetPointer
+; X32: incl %eax
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargRetPointer:
+; WIN64: incl %eax
+; WIN64: call{{.*}} {{.*}}test_argRetPointer
+; WIN64: incl %eax
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving pointer
+define x86_regcallcc [4 x i32]* @test_CallargRetPointer([4 x i32]* %a) {
+ %b = ptrtoint [4 x i32]* %a to i32
+ %c = add i32 %b, 1
+ %d = inttoptr i32 %c to [4 x i32]*
+ %e = call x86_regcallcc [4 x i32]* @test_argRetPointer([4 x i32]* %d)
+ %f = ptrtoint [4 x i32]* %e to i32
+ %g = add i32 %f, 1
+ %h = inttoptr i32 %g to [4 x i32]*
+ ret [4 x i32]* %h
+}
+
+; X32-LABEL: test_argRet128Vector:
+; X32: vpblend{{.*}} %xmm0, %xmm1, %xmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argRet128Vector:
+; WIN64: vpblend{{.*}} %xmm0, %xmm1, %xmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning 128 bit vector
+define x86_regcallcc <4 x i32> @test_argRet128Vector(<4 x i32> %a, <4 x i32> %b) {
+ %d = select <4 x i1> undef , <4 x i32> %a, <4 x i32> %b
+ ret <4 x i32> %d
+}
+
+; X32-LABEL: test_CallargRet128Vector:
+; X32: vmov{{.*}} %xmm0, {{%xmm([0-7])}}
+; X32: call{{.*}} {{.*}}test_argRet128Vector
+; X32: vpblend{{.*}} {{%xmm([0-7])}}, %xmm0, %xmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargRet128Vector:
+; WIN64: vmov{{.*}} %xmm0, {{%xmm([0-9]+)}}
+; WIN64: call{{.*}} {{.*}}test_argRet128Vector
+; WIN64: vpblend{{.*}} {{%xmm([0-9]+)}}, %xmm0, %xmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving 128 bit vector
+define x86_regcallcc <4 x i32> @test_CallargRet128Vector(<4 x i32> %a) {
+ %b = call x86_regcallcc <4 x i32> @test_argRet128Vector(<4 x i32> %a, <4 x i32> %a)
+ %c = select <4 x i1> undef , <4 x i32> %a, <4 x i32> %b
+ ret <4 x i32> %c
+}
+
+; X32-LABEL: test_argRet256Vector:
+; X32: vpblend{{.*}} %ymm0, %ymm1, %ymm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argRet256Vector:
+; WIN64: vpblend{{.*}} %ymm0, %ymm1, %ymm0
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning 256 bit vector
+define x86_regcallcc <8 x i32> @test_argRet256Vector(<8 x i32> %a, <8 x i32> %b) {
+ %d = select <8 x i1> undef , <8 x i32> %a, <8 x i32> %b
+ ret <8 x i32> %d
+}
+
+; X32-LABEL: test_CallargRet256Vector:
+; X32: vmov{{.*}} %ymm0, %ymm1
+; X32: call{{.*}} {{.*}}test_argRet256Vector
+; X32: vpblend{{.*}} %ymm1, %ymm0, %ymm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargRet256Vector:
+; WIN64: vmov{{.*}} %ymm0, %ymm1
+; WIN64: call{{.*}} {{.*}}test_argRet256Vector
+; WIN64: vpblend{{.*}} %ymm1, %ymm0, %ymm0
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving 256 bit vector
+define x86_regcallcc <8 x i32> @test_CallargRet256Vector(<8 x i32> %a) {
+ %b = call x86_regcallcc <8 x i32> @test_argRet256Vector(<8 x i32> %a, <8 x i32> %a)
+ %c = select <8 x i1> undef , <8 x i32> %a, <8 x i32> %b
+ ret <8 x i32> %c
+}
+
+; X32-LABEL: test_argRet512Vector:
+; X32: vpblend{{.*}} %zmm0, %zmm1, %zmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_argRet512Vector:
+; WIN64: vpblend{{.*}} %zmm0, %zmm1, %zmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning 512 bit vector
+define x86_regcallcc <16 x i32> @test_argRet512Vector(<16 x i32> %a, <16 x i32> %b) {
+ %d = select <16 x i1> undef , <16 x i32> %a, <16 x i32> %b
+ ret <16 x i32> %d
+}
+
+; X32-LABEL: test_CallargRet512Vector:
+; X32: vmov{{.*}} %zmm0, %zmm1
+; X32: call{{.*}} {{.*}}test_argRet512Vector
+; X32: vpblend{{.*}} %zmm1, %zmm0, %zmm0
+; X32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargRet512Vector:
+; WIN64: vmov{{.*}} %zmm0, %zmm1
+; WIN64: call{{.*}} {{.*}}test_argRet512Vector
+; WIN64: vpblend{{.*}} %zmm1, %zmm0, %zmm0
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving 512 bit vector
+define x86_regcallcc <16 x i32> @test_CallargRet512Vector(<16 x i32> %a) {
+ %b = call x86_regcallcc <16 x i32> @test_argRet512Vector(<16 x i32> %a, <16 x i32> %a)
+ %c = select <16 x i1> undef , <16 x i32> %a, <16 x i32> %b
+ ret <16 x i32> %c
+}
+
+; WIN64-LABEL: testf32_inp
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; WIN64: retq
+
+; X32-LABEL: testf32_inp
+; X32: vmovups {{%xmm([0-7])}}, {{.*(%esp).*}} {{#+}} 16-byte Spill
+; X32: vmovups {{%xmm([0-7])}}, {{.*(%esp).*}} {{#+}} 16-byte Spill
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: {{.*}} {{%zmm[0-7]}}, {{%zmm[0-7]}}, {{%zmm[0-7]}}
+; X32: vmovups {{.*(%esp).*}}, {{%xmm([0-7])}} {{#+}} 16-byte Reload
+; X32: vmovups {{.*(%esp).*}}, {{%xmm([0-7])}} {{#+}} 16-byte Reload
+; X32: retl
+
+; LINUXOSX64-LABEL: testf32_inp
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: {{.*}} {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}, {{%zmm([0-9]|1[0-1])}}
+; LINUXOSX64: retq
+
+; Test regcall when running multiple input parameters - callee saved XMMs
+define x86_regcallcc <32 x float> @testf32_inp(<32 x float> %a, <32 x float> %b, <32 x float> %c) nounwind {
+ %x1 = fadd <32 x float> %a, %b
+ %x2 = fmul <32 x float> %a, %b
+ %x3 = fsub <32 x float> %x1, %x2
+ %x4 = fadd <32 x float> %x3, %c
+ ret <32 x float> %x4
+}
+
+; X32-LABEL: pushl {{%e(si|di|bx|bp)}}
+; X32: pushl {{%e(si|di|bx|bp)}}
+; X32: pushl {{%e(si|di|bx|bp)}}
+; X32: pushl {{%e(si|di|bx|bp)}}
+; X32: popl {{%e(si|di|bx|bp)}}
+; X32: popl {{%e(si|di|bx|bp)}}
+; X32: popl {{%e(si|di|bx|bp)}}
+; X32: popl {{%e(si|di|bx|bp)}}
+; X32: retl
+
+; WIN64-LABEL: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: retq
+
+; LINUXOSX64-LABEL: pushq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX64: pushq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX64: pushq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX64: popq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX64: popq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX64: popq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX64: retq
+
+; Test regcall when running multiple input parameters - callee saved GPRs
+define x86_regcallcc i32 @testi32_inp(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6,
+ i32 %b1, i32 %b2, i32 %b3, i32 %b4, i32 %b5, i32 %b6) nounwind {
+ %x1 = sub i32 %a1, %a2
+ %x2 = sub i32 %a3, %a4
+ %x3 = sub i32 %a5, %a6
+ %y1 = sub i32 %b1, %b2
+ %y2 = sub i32 %b3, %b4
+ %y3 = sub i32 %b5, %b6
+ %v1 = add i32 %a1, %a2
+ %v2 = add i32 %a3, %a4
+ %v3 = add i32 %a5, %a6
+ %w1 = add i32 %b1, %b2
+ %w2 = add i32 %b3, %b4
+ %w3 = add i32 %b5, %b6
+ %s1 = mul i32 %x1, %y1
+ %s2 = mul i32 %x2, %y2
+ %s3 = mul i32 %x3, %y3
+ %t1 = mul i32 %v1, %w1
+ %t2 = mul i32 %v2, %w2
+ %t3 = mul i32 %v3, %w3
+ %m1 = add i32 %s1, %s2
+ %m2 = add i32 %m1, %s3
+ %n1 = add i32 %t1, %t2
+ %n2 = add i32 %n1, %t3
+ %r1 = add i32 %m2, %n2
+ ret i32 %r1
+}
+
+; X32-LABEL: testf32_stack
+; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{%zmm([0-7])}}, {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-7])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-1])}}
+; X32: vaddps {{([0-9])+}}(%ebp), {{%zmm([0-7])}}, {{%zmm([0-1])}}
+; X32: retl
+
+; LINUXOSX64-LABEL: testf32_stack
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}, {{%zmm([0-9]+)}}
+; LINUXOSX64: vaddps {{([0-9])+}}(%rbp), {{%zmm([0-9]+)}}, {{%zmm([0-1])}}
+; LINUXOSX64: vaddps {{([0-9])+}}(%rbp), {{%zmm([0-9]+)}}, {{%zmm([0-1])}}
+; LINUXOSX64: retq
+
+; Test that parameters, overflowing register capacity, are passed through the stack
+define x86_regcallcc <32 x float> @testf32_stack(<32 x float> %a0, <32 x float> %b0, <32 x float> %c0,
+ <32 x float> %a1, <32 x float> %b1, <32 x float> %c1,
+ <32 x float> %a2, <32 x float> %b2, <32 x float> %c2) nounwind {
+ %x1 = fadd <32 x float> %a0, %b0
+ %x2 = fadd <32 x float> %c0, %x1
+ %x3 = fadd <32 x float> %a1, %x2
+ %x4 = fadd <32 x float> %b1, %x3
+ %x5 = fadd <32 x float> %c1, %x4
+ %x6 = fadd <32 x float> %a2, %x5
+ %x7 = fadd <32 x float> %b2, %x6
+ %x8 = fadd <32 x float> %c2, %x7
+ ret <32 x float> %x8
+}
+
+; X32-LABEL: vmovd %edx, {{%xmm([0-9])}}
+; X32: vcvtsi2sdl %eax, {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; X32: vcvtsi2sdl %ecx, {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; X32: vcvtsi2sdl %esi, {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; X32: vaddsd %xmm1, %xmm0, %xmm0
+; X32: vcvttsd2si %xmm0, %eax
+; X32: retl
+
+; LINUXOSX64-LABEL: test_argRetMixTypes
+; LINUXOSX64: vcvtss2sd %xmm1, %xmm1, %xmm1
+; LINUXOSX64: vcvtsi2sdl %eax, {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; LINUXOSX64: vcvtsi2sdl %ecx, {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; LINUXOSX64: vcvtsi2sdq %rdx, {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; LINUXOSX64: vcvtsi2sdl %edi, {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; LINUXOSX64: vcvtsi2sdl (%rsi), {{%xmm([0-9])}}, {{%xmm([0-9])}}
+; LINUXOSX64: vcvttsd2si {{%xmm([0-9])}}, %eax
+
+; Test regcall when passing/retrieving mixed types
+define x86_regcallcc i32 @test_argRetMixTypes(double, float, i8 signext, i32, i64, i16 signext, i32*) #0 {
+ %8 = fpext float %1 to double
+ %9 = fadd double %8, %0
+ %10 = sitofp i8 %2 to double
+ %11 = fadd double %9, %10
+ %12 = sitofp i32 %3 to double
+ %13 = fadd double %11, %12
+ %14 = sitofp i64 %4 to double
+ %15 = fadd double %13, %14
+ %16 = sitofp i16 %5 to double
+ %17 = fadd double %15, %16
+ %18 = load i32, i32* %6, align 4
+ %19 = sitofp i32 %18 to double
+ %20 = fadd double %17, %19
+ %21 = fptosi double %20 to i32
+ ret i32 %21
+}
+
+%struct.complex = type { float, double, i32, i8, i64}
+
+
+; X32-LABEL: test_argMultiRet
+; X32: vaddsd {{.*}}, %xmm1, %xmm1
+; X32: movl $4, %eax
+; X32: movb $7, %cl
+; X32: movl $999, %edx
+; X32: xorl %edi, %edi
+; X32: retl
+
+; LINUXOSX64-LABEL: test_argMultiRet
+; LINUXOSX64: vaddsd {{.*}}, %xmm1, %xmm1
+; LINUXOSX64: movl $4, %eax
+; LINUXOSX64: movb $7, %cl
+; LINUXOSX64: movl $999, %edx
+; LINUXOSX64: retq
+
+define x86_regcallcc %struct.complex @test_argMultiRet(float, double, i32, i8, i64) local_unnamed_addr #0 {
+ %6 = fadd double %1, 5.000000e+00
+ %7 = insertvalue %struct.complex undef, float %0, 0
+ %8 = insertvalue %struct.complex %7, double %6, 1
+ %9 = insertvalue %struct.complex %8, i32 4, 2
+ %10 = insertvalue %struct.complex %9, i8 7, 3
+ %11 = insertvalue %struct.complex %10, i64 999, 4
+ ret %struct.complex %11
+}
+
-; RUN: llc < %s -mtriple=i386-pc-win32 -mattr=+sse | FileCheck --check-prefix=WIN32 %s\r
-; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+sse | FileCheck --check-prefix=WIN64 %s\r
-; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=+sse | FileCheck --check-prefix=LINUXOSX %s\r
-\r
-; WIN32-LABEL: test_argReti1:\r
-; WIN32: incb %al\r
-; WIN32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_argReti1:\r
-; WIN64: incb %al\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when receiving/returning i1\r
-define x86_regcallcc i1 @test_argReti1(i1 %a) {\r
- %add = add i1 %a, 1\r
- ret i1 %add\r
-}\r
-\r
-; WIN32-LABEL: test_CallargReti1:\r
-; WIN32: movzbl %al, %eax\r
-; WIN32: call{{.*}} {{.*}}test_argReti1\r
-; WIN32: incb %al\r
-; WIN32: ret{{.*}}\r
-\r
-; WIN64-LABEL: test_CallargReti1:\r
-; WIN64: movzbl %al, %eax\r
-; WIN64: call{{.*}} {{.*}}test_argReti1\r
-; WIN64: incb %al\r
-; WIN64: ret{{.*}}\r
-\r
-; Test regcall when passing/retrieving i1\r
-define x86_regcallcc i1 @test_CallargReti1(i1 %a) {\r
- %b = add i1 %a, 1\r
- %c = call x86_regcallcc i1 @test_argReti1(i1 %b)\r
- %d = add i1 %c, 1\r
- ret i1 %d\r
-}\r
-\r
-; WIN64-LABEL: testf32_inp\r
-; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; WIN64: retq\r
-\r
-; WIN32-LABEL: testf32_inp\r
-; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill\r
-; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill\r
-; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill\r
-; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill\r
-; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}\r
-; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}\r
-; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}\r
-; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}\r
-; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload\r
-; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload\r
-; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload\r
-; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload\r
-; WIN32: retl\r
-\r
-; LINUXOSX-LABEL: testf32_inp\r
-; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill\r
-; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}\r
-; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload\r
-; LINUXOSX: retq\r
-\r
-;test calling conventions - input parameters, callee saved XMMs\r
-define x86_regcallcc <16 x float> @testf32_inp(<16 x float> %a, <16 x float> %b, <16 x float> %c) nounwind {\r
- %x1 = fadd <16 x float> %a, %b\r
- %x2 = fmul <16 x float> %a, %b\r
- %x3 = fsub <16 x float> %x1, %x2\r
- %x4 = fadd <16 x float> %x3, %c\r
- ret <16 x float> %x4\r
-}\r
-\r
-; WIN32-LABEL: testi32_inp\r
-; WIN32: pushl {{%e(si|di|bx|bp)}}\r
-; WIN32: pushl {{%e(si|di|bx|bp)}}\r
-; WIN32: pushl {{%e(si|di|bx|bp)}}\r
-; WIN32: pushl {{%e(si|di|bx|bp)}}\r
-; WIN32: popl {{%e(si|di|bx|bp)}}\r
-; WIN32: popl {{%e(si|di|bx|bp)}}\r
-; WIN32: popl {{%e(si|di|bx|bp)}}\r
-; WIN32: popl {{%e(si|di|bx|bp)}}\r
-; WIN32: retl\r
-\r
-; WIN64-LABEL: testi32_inp\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: pushq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: popq {{%r(bp|bx|1[0-5])}}\r
-; WIN64: retq\r
-\r
-; LINUXOSX-LABEL: testi32_inp\r
-; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}\r
-; LINUXOSX: retq\r
-\r
-;test calling conventions - input parameters, callee saved GPRs\r
-define x86_regcallcc i32 @testi32_inp(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6,\r
- i32 %b1, i32 %b2, i32 %b3, i32 %b4, i32 %b5, i32 %b6) nounwind {\r
- %x1 = sub i32 %a1, %a2\r
- %x2 = sub i32 %a3, %a4\r
- %x3 = sub i32 %a5, %a6\r
- %y1 = sub i32 %b1, %b2\r
- %y2 = sub i32 %b3, %b4\r
- %y3 = sub i32 %b5, %b6\r
- %v1 = add i32 %a1, %a2\r
- %v2 = add i32 %a3, %a4\r
- %v3 = add i32 %a5, %a6\r
- %w1 = add i32 %b1, %b2\r
- %w2 = add i32 %b3, %b4\r
- %w3 = add i32 %b5, %b6\r
- %s1 = mul i32 %x1, %y1\r
- %s2 = mul i32 %x2, %y2\r
- %s3 = mul i32 %x3, %y3\r
- %t1 = mul i32 %v1, %w1\r
- %t2 = mul i32 %v2, %w2\r
- %t3 = mul i32 %v3, %w3\r
- %m1 = add i32 %s1, %s2\r
- %m2 = add i32 %m1, %s3\r
- %n1 = add i32 %t1, %t2\r
- %n2 = add i32 %n1, %t3\r
- %r1 = add i32 %m2, %n2\r
- ret i32 %r1\r
-}\r
-\r
-; X32: testf32_stack\r
-; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)\r
-; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)\r
-; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)\r
-; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}\r
-\r
-; LINUXOSX: testf32_stack\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}\r
-; LINUXOSX: retq\r
-\r
-; Test that parameters, overflowing register capacity, are passed through the stack\r
-define x86_regcallcc <32 x float> @testf32_stack(<32 x float> %a, <32 x float> %b, <32 x float> %c) nounwind {\r
- %x1 = fadd <32 x float> %a, %b\r
- %x2 = fadd <32 x float> %x1, %c\r
- ret <32 x float> %x2\r
-}\r
+; RUN: llc < %s -mtriple=i386-pc-win32 -mattr=+sse | FileCheck --check-prefix=WIN32 %s
+; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+sse | FileCheck --check-prefix=WIN64 %s
+; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=+sse | FileCheck --check-prefix=LINUXOSX %s
+
+; WIN32-LABEL: test_argReti1:
+; WIN32: incb %al
+; WIN32: ret{{.*}}
+
+; WIN64-LABEL: test_argReti1:
+; WIN64: incb %al
+; WIN64: ret{{.*}}
+
+; Test regcall when receiving/returning i1
+define x86_regcallcc i1 @test_argReti1(i1 %a) {
+ %add = add i1 %a, 1
+ ret i1 %add
+}
+
+; WIN32-LABEL: test_CallargReti1:
+; WIN32: movzbl %al, %eax
+; WIN32: call{{.*}} {{.*}}test_argReti1
+; WIN32: incb %al
+; WIN32: ret{{.*}}
+
+; WIN64-LABEL: test_CallargReti1:
+; WIN64: movzbl %al, %eax
+; WIN64: call{{.*}} {{.*}}test_argReti1
+; WIN64: incb %al
+; WIN64: ret{{.*}}
+
+; Test regcall when passing/retrieving i1
+define x86_regcallcc i1 @test_CallargReti1(i1 %a) {
+ %b = add i1 %a, 1
+ %c = call x86_regcallcc i1 @test_argReti1(i1 %b)
+ %d = add i1 %c, 1
+ ret i1 %d
+}
+
+; WIN64-LABEL: testf32_inp
+; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; WIN64: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; WIN64: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; WIN64: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; WIN64: retq
+
+; WIN32-LABEL: testf32_inp
+; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill
+; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill
+; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill
+; WIN32: movaps {{%xmm([4-7])}}, {{.*(%ebp).*}} {{#+}} 16-byte Spill
+; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}
+; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}
+; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}
+; WIN32: {{.*}} {{%xmm[0-7]}}, {{%xmm[4-7]}}
+; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload
+; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload
+; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload
+; WIN32: movaps {{.*(%ebp).*}}, {{%xmm([4-7])}} {{#+}} 16-byte Reload
+; WIN32: retl
+
+; LINUXOSX-LABEL: testf32_inp
+; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; LINUXOSX: movaps {{%xmm(1[2-5])}}, {{.*(%rsp).*}} {{#+}} 16-byte Spill
+; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; LINUXOSX: {{.*}} {{%xmm([0-9]|1[0-1])}}, {{%xmm(1[2-5])}}
+; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; LINUXOSX: movaps {{.*(%rsp).*}}, {{%xmm(1[2-5])}} {{#+}} 16-byte Reload
+; LINUXOSX: retq
+
+;test calling conventions - input parameters, callee saved XMMs
+define x86_regcallcc <16 x float> @testf32_inp(<16 x float> %a, <16 x float> %b, <16 x float> %c) nounwind {
+ %x1 = fadd <16 x float> %a, %b
+ %x2 = fmul <16 x float> %a, %b
+ %x3 = fsub <16 x float> %x1, %x2
+ %x4 = fadd <16 x float> %x3, %c
+ ret <16 x float> %x4
+}
+
+; WIN32-LABEL: testi32_inp
+; WIN32: pushl {{%e(si|di|bx|bp)}}
+; WIN32: pushl {{%e(si|di|bx|bp)}}
+; WIN32: pushl {{%e(si|di|bx|bp)}}
+; WIN32: pushl {{%e(si|di|bx|bp)}}
+; WIN32: popl {{%e(si|di|bx|bp)}}
+; WIN32: popl {{%e(si|di|bx|bp)}}
+; WIN32: popl {{%e(si|di|bx|bp)}}
+; WIN32: popl {{%e(si|di|bx|bp)}}
+; WIN32: retl
+
+; WIN64-LABEL: testi32_inp
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: pushq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: popq {{%r(bp|bx|1[0-5])}}
+; WIN64: retq
+
+; LINUXOSX-LABEL: testi32_inp
+; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: pushq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: popq {{%r(bp|bx|1[2-5])}}
+; LINUXOSX: retq
+
+;test calling conventions - input parameters, callee saved GPRs
+define x86_regcallcc i32 @testi32_inp(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6,
+ i32 %b1, i32 %b2, i32 %b3, i32 %b4, i32 %b5, i32 %b6) nounwind {
+ %x1 = sub i32 %a1, %a2
+ %x2 = sub i32 %a3, %a4
+ %x3 = sub i32 %a5, %a6
+ %y1 = sub i32 %b1, %b2
+ %y2 = sub i32 %b3, %b4
+ %y3 = sub i32 %b5, %b6
+ %v1 = add i32 %a1, %a2
+ %v2 = add i32 %a3, %a4
+ %v3 = add i32 %a5, %a6
+ %w1 = add i32 %b1, %b2
+ %w2 = add i32 %b3, %b4
+ %w3 = add i32 %b5, %b6
+ %s1 = mul i32 %x1, %y1
+ %s2 = mul i32 %x2, %y2
+ %s3 = mul i32 %x3, %y3
+ %t1 = mul i32 %v1, %w1
+ %t2 = mul i32 %v2, %w2
+ %t3 = mul i32 %v3, %w3
+ %m1 = add i32 %s1, %s2
+ %m2 = add i32 %m1, %s3
+ %n1 = add i32 %t1, %t2
+ %n2 = add i32 %n1, %t3
+ %r1 = add i32 %m2, %n2
+ ret i32 %r1
+}
+
+; X32: testf32_stack
+; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)
+; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)
+; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)
+; X32: movaps {{%xmm([0-7])}}, {{(-*[0-9])+}}(%ebp)
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: addps {{([0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}
+; X32: movaps {{(-*[0-9])+}}(%ebp), {{%xmm([0-7])}}
+
+; LINUXOSX: testf32_stack
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{%xmm([0-9]+)}}, {{%xmm([0-9]+)}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: addps {{([0-9])+}}(%rsp), {{%xmm([0-7])}}
+; LINUXOSX: retq
+
+; Test that parameters, overflowing register capacity, are passed through the stack
+define x86_regcallcc <32 x float> @testf32_stack(<32 x float> %a, <32 x float> %b, <32 x float> %c) nounwind {
+ %x1 = fadd <32 x float> %a, %b
+ %x2 = fadd <32 x float> %x1, %c
+ ret <32 x float> %x2
+}