| OLD | NEW |
| 1 ; This file checks that Subzero generates code in accordance with the | 1 ; This file checks that Subzero generates code in accordance with the |
| 2 ; calling convention for vectors. | 2 ; calling convention for vectors. |
| 3 | 3 |
| 4 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 4 ; RUN: %p2i -i %s --assemble --disassemble --args -O2 --verbose none \ |
| 5 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 5 ; RUN: | FileCheck %s |
| 6 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 6 ; RUN: %p2i -i %s --assemble --disassemble --args -Om1 --verbose none \ |
| 7 ; RUN: %p2i -i %s --args -Om1 --verbose none \ | |
| 8 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | |
| 9 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \ | |
| 10 ; RUN: | FileCheck --check-prefix=OPTM1 %s | 7 ; RUN: | FileCheck --check-prefix=OPTM1 %s |
| 11 | 8 |
| 12 ; The first five functions test that vectors are moved from their | 9 ; The first five functions test that vectors are moved from their |
| 13 ; correct argument location to xmm0. | 10 ; correct argument location to xmm0. |
| 14 | 11 |
| 15 define <4 x float> @test_returning_arg0(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { | 12 define <4 x float> @test_returning_arg0(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { |
| 16 entry: | 13 entry: |
| 17 ret <4 x float> %arg0 | 14 ret <4 x float> %arg0 |
| 18 ; CHECK-LABEL: test_returning_arg0: | 15 ; CHECK-LABEL: test_returning_arg0 |
| 19 ; CHECK-NOT: mov | 16 ; CHECK-NOT: mov |
| 20 ; CHECK: ret | 17 ; CHECK: ret |
| 21 | 18 |
| 22 ; OPTM1-LABEL: test_returning_arg0: | 19 ; OPTM1-LABEL: test_returning_arg0 |
| 23 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm0 | 20 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm0 |
| 24 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 21 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 25 ; OPTM1: ret | 22 ; OPTM1: ret |
| 26 } | 23 } |
| 27 | 24 |
| 28 define <4 x float> @test_returning_arg1(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { | 25 define <4 x float> @test_returning_arg1(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { |
| 29 entry: | 26 entry: |
| 30 ret <4 x float> %arg1 | 27 ret <4 x float> %arg1 |
| 31 ; CHECK-LABEL: test_returning_arg1: | 28 ; CHECK-LABEL: test_returning_arg1 |
| 32 ; CHECK: movups xmm0, xmm1 | 29 ; CHECK: movups xmm0,xmm1 |
| 33 ; CHECK: ret | 30 ; CHECK: ret |
| 34 | 31 |
| 35 ; OPTM1-LABEL: test_returning_arg1: | 32 ; OPTM1-LABEL: test_returning_arg1 |
| 36 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm1 | 33 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm1 |
| 37 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 34 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 38 ; OPTM1: ret | 35 ; OPTM1: ret |
| 39 } | 36 } |
| 40 | 37 |
| 41 define <4 x float> @test_returning_arg2(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { | 38 define <4 x float> @test_returning_arg2(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { |
| 42 entry: | 39 entry: |
| 43 ret <4 x float> %arg2 | 40 ret <4 x float> %arg2 |
| 44 ; CHECK-LABEL: test_returning_arg2: | 41 ; CHECK-LABEL: test_returning_arg2 |
| 45 ; CHECK: movups xmm0, xmm2 | 42 ; CHECK: movups xmm0,xmm2 |
| 46 ; CHECK: ret | 43 ; CHECK: ret |
| 47 | 44 |
| 48 ; OPTM1-LABEL: test_returning_arg2: | 45 ; OPTM1-LABEL: test_returning_arg2 |
| 49 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm2 | 46 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm2 |
| 50 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 47 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 51 ; OPTM1: ret | 48 ; OPTM1: ret |
| 52 } | 49 } |
| 53 | 50 |
| 54 define <4 x float> @test_returning_arg3(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { | 51 define <4 x float> @test_returning_arg3(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { |
| 55 entry: | 52 entry: |
| 56 ret <4 x float> %arg3 | 53 ret <4 x float> %arg3 |
| 57 ; CHECK-LABEL: test_returning_arg3: | 54 ; CHECK-LABEL: test_returning_arg3 |
| 58 ; CHECK: movups xmm0, xmm3 | 55 ; CHECK: movups xmm0,xmm3 |
| 59 ; CHECK: ret | 56 ; CHECK: ret |
| 60 | 57 |
| 61 ; OPTM1-LABEL: test_returning_arg3: | 58 ; OPTM1-LABEL: test_returning_arg3 |
| 62 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm3 | 59 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm3 |
| 63 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 60 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 64 ; OPTM1: ret | 61 ; OPTM1: ret |
| 65 } | 62 } |
| 66 | 63 |
| 67 define <4 x float> @test_returning_arg4(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { | 64 define <4 x float> @test_returning_arg4(<4 x float> %arg0, <4 x float> %arg1, <4
x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5) { |
| 68 entry: | 65 entry: |
| 69 ret <4 x float> %arg4 | 66 ret <4 x float> %arg4 |
| 70 ; CHECK-LABEL: test_returning_arg4: | 67 ; CHECK-LABEL: test_returning_arg4 |
| 71 ; CHECK: movups xmm0, xmmword ptr [esp + 4] | 68 ; CHECK: movups xmm0,XMMWORD PTR [esp+0x4] |
| 72 ; CHECK: ret | 69 ; CHECK: ret |
| 73 | 70 |
| 74 ; OPTM1-LABEL: test_returning_arg4: | 71 ; OPTM1-LABEL: test_returning_arg4 |
| 75 ; OPTM1: movups xmm0, xmmword ptr {{.*}} | 72 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
| 76 ; OPTM1: ret | 73 ; OPTM1: ret |
| 77 } | 74 } |
| 78 | 75 |
| 79 ; The next five functions check that xmm arguments are handled | 76 ; The next five functions check that xmm arguments are handled |
| 80 ; correctly when interspersed with stack arguments in the argument | 77 ; correctly when interspersed with stack arguments in the argument |
| 81 ; list. | 78 ; list. |
| 82 | 79 |
| 83 define <4 x float> @test_returning_interspersed_arg0(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { | 80 define <4 x float> @test_returning_interspersed_arg0(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { |
| 84 entry: | 81 entry: |
| 85 ret <4 x float> %arg0 | 82 ret <4 x float> %arg0 |
| 86 ; CHECK-LABEL: test_returning_interspersed_arg0: | 83 ; CHECK-LABEL: test_returning_interspersed_arg0 |
| 87 ; CHECK-NOT: mov | 84 ; CHECK-NOT: mov |
| 88 ; CHECK: ret | 85 ; CHECK: ret |
| 89 | 86 |
| 90 ; OPTM1-LABEL: test_returning_interspersed_arg0: | 87 ; OPTM1-LABEL: test_returning_interspersed_arg0 |
| 91 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm0 | 88 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm0 |
| 92 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 89 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 93 ; OPTM1: ret | 90 ; OPTM1: ret |
| 94 } | 91 } |
| 95 | 92 |
| 96 define <4 x float> @test_returning_interspersed_arg1(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { | 93 define <4 x float> @test_returning_interspersed_arg1(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { |
| 97 entry: | 94 entry: |
| 98 ret <4 x float> %arg1 | 95 ret <4 x float> %arg1 |
| 99 ; CHECK-LABEL: test_returning_interspersed_arg1: | 96 ; CHECK-LABEL: test_returning_interspersed_arg1 |
| 100 ; CHECK: movups xmm0, xmm1 | 97 ; CHECK: movups xmm0,xmm1 |
| 101 ; CHECK: ret | 98 ; CHECK: ret |
| 102 | 99 |
| 103 ; OPTM1-LABEL: test_returning_interspersed_arg1: | 100 ; OPTM1-LABEL: test_returning_interspersed_arg1 |
| 104 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm1 | 101 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm1 |
| 105 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 102 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 106 ; OPTM1: ret | 103 ; OPTM1: ret |
| 107 } | 104 } |
| 108 | 105 |
| 109 define <4 x float> @test_returning_interspersed_arg2(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { | 106 define <4 x float> @test_returning_interspersed_arg2(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { |
| 110 entry: | 107 entry: |
| 111 ret <4 x float> %arg2 | 108 ret <4 x float> %arg2 |
| 112 ; CHECK-LABEL: test_returning_interspersed_arg2: | 109 ; CHECK-LABEL: test_returning_interspersed_arg2 |
| 113 ; CHECK: movups xmm0, xmm2 | 110 ; CHECK: movups xmm0,xmm2 |
| 114 ; CHECK: ret | 111 ; CHECK: ret |
| 115 | 112 |
| 116 ; OPTM1-LABEL: test_returning_interspersed_arg2: | 113 ; OPTM1-LABEL: test_returning_interspersed_arg2 |
| 117 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm2 | 114 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm2 |
| 118 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 115 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 119 ; OPTM1: ret | 116 ; OPTM1: ret |
| 120 } | 117 } |
| 121 | 118 |
| 122 define <4 x float> @test_returning_interspersed_arg3(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { | 119 define <4 x float> @test_returning_interspersed_arg3(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { |
| 123 entry: | 120 entry: |
| 124 ret <4 x float> %arg3 | 121 ret <4 x float> %arg3 |
| 125 ; CHECK-LABEL: test_returning_interspersed_arg3: | 122 ; CHECK-LABEL: test_returning_interspersed_arg3 |
| 126 ; CHECK: movups xmm0, xmm3 | 123 ; CHECK: movups xmm0,xmm3 |
| 127 ; CHECK: ret | 124 ; CHECK: ret |
| 128 | 125 |
| 129 ; OPTM1-LABEL: test_returning_interspersed_arg3: | 126 ; OPTM1-LABEL: test_returning_interspersed_arg3 |
| 130 ; OPTM1: movups xmmword ptr [[LOC:.*]], xmm3 | 127 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm3 |
| 131 ; OPTM1: movups xmm0, xmmword ptr [[LOC]] | 128 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
| 132 ; OPTM1: ret | 129 ; OPTM1: ret |
| 133 } | 130 } |
| 134 | 131 |
| 135 define <4 x float> @test_returning_interspersed_arg4(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { | 132 define <4 x float> @test_returning_interspersed_arg4(i32 %i32arg0, double %doubl
earg0, <4 x float> %arg0, <4 x float> %arg1, i32 %i32arg1, <4 x float> %arg2, do
uble %doublearg1, <4 x float> %arg3, i32 %i32arg2, double %doublearg2, float %fl
oatarg0, <4 x float> %arg4, <4 x float> %arg5, float %floatarg1) { |
| 136 entry: | 133 entry: |
| 137 ret <4 x float> %arg4 | 134 ret <4 x float> %arg4 |
| 138 ; CHECK-LABEL: test_returning_interspersed_arg4: | 135 ; CHECK-LABEL: test_returning_interspersed_arg4 |
| 139 ; CHECK: movups xmm0, xmmword ptr [esp + 52] | 136 ; CHECK: movups xmm0,XMMWORD PTR [esp+0x34] |
| 140 ; CHECK: ret | 137 ; CHECK: ret |
| 141 | 138 |
| 142 ; OPTM1-LABEL: test_returning_interspersed_arg4: | 139 ; OPTM1-LABEL: test_returning_interspersed_arg4 |
| 143 ; OPTM1: movups xmm0, xmmword ptr {{.*}} | 140 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
| 144 ; OPTM1: ret | 141 ; OPTM1: ret |
| 145 } | 142 } |
| 146 | 143 |
| 147 ; Test that vectors are passed correctly as arguments to a function. | 144 ; Test that vectors are passed correctly as arguments to a function. |
| 148 | 145 |
| 149 declare void @VectorArgs(<4 x float>, <4 x float>, <4 x float>, <4 x float>, <4
x float>, <4 x float>) | 146 declare void @VectorArgs(<4 x float>, <4 x float>, <4 x float>, <4 x float>, <4
x float>, <4 x float>) |
| 150 | 147 |
| 151 declare void @killXmmRegisters() | 148 declare void @killXmmRegisters() |
| 152 | 149 |
| 153 define void @test_passing_vectors(<4 x float> %arg0, <4 x float> %arg1, <4 x flo
at> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5, <4 x float>
%arg6, <4 x float> %arg7, <4 x float> %arg8, <4 x float> %arg9) { | 150 define void @test_passing_vectors(<4 x float> %arg0, <4 x float> %arg1, <4 x flo
at> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5, <4 x float>
%arg6, <4 x float> %arg7, <4 x float> %arg8, <4 x float> %arg9) { |
| 154 entry: | 151 entry: |
| 155 ; Kills XMM registers so that no in-arg lowering code interferes | 152 ; Kills XMM registers so that no in-arg lowering code interferes |
| 156 ; with the test. | 153 ; with the test. |
| 157 call void @killXmmRegisters() | 154 call void @killXmmRegisters() |
| 158 call void @VectorArgs(<4 x float> %arg9, <4 x float> %arg8, <4 x float> %arg7,
<4 x float> %arg6, <4 x float> %arg5, <4 x float> %arg4) | 155 call void @VectorArgs(<4 x float> %arg9, <4 x float> %arg8, <4 x float> %arg7,
<4 x float> %arg6, <4 x float> %arg5, <4 x float> %arg4) |
| 159 ret void | 156 ret void |
| 160 ; CHECK-LABEL: test_passing_vectors: | 157 ; CHECK-LABEL: test_passing_vectors |
| 161 ; CHECK: sub esp, 32 | 158 ; CHECK: sub esp,0x20 |
| 162 ; CHECK: movups [[ARG5:.*]], xmmword ptr [esp + 64] | 159 ; CHECK: movups [[ARG5:.*]],XMMWORD PTR [esp+0x40] |
| 163 ; CHECK: movups xmmword ptr [esp], [[ARG5]] | 160 ; CHECK: movups XMMWORD PTR [esp],[[ARG5]] |
| 164 ; CHECK: movups [[ARG6:.*]], xmmword ptr [esp + 48] | 161 ; CHECK: movups [[ARG6:.*]],XMMWORD PTR [esp+0x30] |
| 165 ; CHECK: movups xmmword ptr [esp + 16], [[ARG6]] | 162 ; CHECK: movups XMMWORD PTR [esp+0x10],[[ARG6]] |
| 166 ; CHECK: movups xmm0, xmmword ptr [esp + 128] | 163 ; CHECK: movups xmm0,XMMWORD PTR [esp+0x80] |
| 167 ; CHECK: movups xmm1, xmmword ptr [esp + 112] | 164 ; CHECK: movups xmm1,XMMWORD PTR [esp+0x70] |
| 168 ; CHECK: movups xmm2, xmmword ptr [esp + 96] | 165 ; CHECK: movups xmm2,XMMWORD PTR [esp+0x60] |
| 169 ; CHECK: movups xmm3, xmmword ptr [esp + 80] | 166 ; CHECK: movups xmm3,XMMWORD PTR [esp+0x50] |
| 170 ; CHECK: call VectorArgs | 167 ; CHECK: call {{.*}} R_{{.*}} VectorArgs |
| 171 ; CHECK-NEXT: add esp, 32 | 168 ; CHECK-NEXT: add esp,0x20 |
| 172 | 169 |
| 173 ; OPTM1-LABEL: test_passing_vectors: | 170 ; OPTM1-LABEL: test_passing_vectors |
| 174 ; OPTM1: sub esp, 32 | 171 ; OPTM1: sub esp,0x20 |
| 175 ; OPTM1: movups [[ARG5:.*]], xmmword ptr {{.*}} | 172 ; OPTM1: movups [[ARG5:.*]],XMMWORD PTR {{.*}} |
| 176 ; OPTM1: movups xmmword ptr [esp], [[ARG5]] | 173 ; OPTM1: movups XMMWORD PTR [esp],[[ARG5]] |
| 177 ; OPTM1: movups [[ARG6:.*]], xmmword ptr {{.*}} | 174 ; OPTM1: movups [[ARG6:.*]],XMMWORD PTR {{.*}} |
| 178 ; OPTM1: movups xmmword ptr [esp + 16], [[ARG6]] | 175 ; OPTM1: movups XMMWORD PTR [esp+0x10],[[ARG6]] |
| 179 ; OPTM1: movups xmm0, xmmword ptr {{.*}} | 176 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
| 180 ; OPTM1: movups xmm1, xmmword ptr {{.*}} | 177 ; OPTM1: movups xmm1,XMMWORD PTR {{.*}} |
| 181 ; OPTM1: movups xmm2, xmmword ptr {{.*}} | 178 ; OPTM1: movups xmm2,XMMWORD PTR {{.*}} |
| 182 ; OPTM1: movups xmm3, xmmword ptr {{.*}} | 179 ; OPTM1: movups xmm3,XMMWORD PTR {{.*}} |
| 183 ; OPTM1: call VectorArgs | 180 ; OPTM1: call {{.*}} R_{{.*}} VectorArgs |
| 184 ; OPTM1-NEXT: add esp, 32 | 181 ; OPTM1-NEXT: add esp,0x20 |
| 185 } | 182 } |
| 186 | 183 |
| 187 declare void @InterspersedVectorArgs(<4 x float>, i64, <4 x float>, i64, <4 x fl
oat>, float, <4 x float>, double, <4 x float>, i32, <4 x float>) | 184 declare void @InterspersedVectorArgs(<4 x float>, i64, <4 x float>, i64, <4 x fl
oat>, float, <4 x float>, double, <4 x float>, i32, <4 x float>) |
| 188 | 185 |
| 189 define void @test_passing_vectors_interspersed(<4 x float> %arg0, <4 x float> %a
rg1, <4 x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5,
<4 x float> %arg6, <4 x float> %arg7, <4 x float> %arg8, <4 x float> %arg9) { | 186 define void @test_passing_vectors_interspersed(<4 x float> %arg0, <4 x float> %a
rg1, <4 x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5,
<4 x float> %arg6, <4 x float> %arg7, <4 x float> %arg8, <4 x float> %arg9) { |
| 190 entry: | 187 entry: |
| 191 ; Kills XMM registers so that no in-arg lowering code interferes | 188 ; Kills XMM registers so that no in-arg lowering code interferes |
| 192 ; with the test. | 189 ; with the test. |
| 193 call void @killXmmRegisters() | 190 call void @killXmmRegisters() |
| 194 call void @InterspersedVectorArgs(<4 x float> %arg9, i64 0, <4 x float> %arg8,
i64 1, <4 x float> %arg7, float 2.000000e+00, <4 x float> %arg6, double 3.00000
0e+00, <4 x float> %arg5, i32 4, <4 x float> %arg4) | 191 call void @InterspersedVectorArgs(<4 x float> %arg9, i64 0, <4 x float> %arg8,
i64 1, <4 x float> %arg7, float 2.000000e+00, <4 x float> %arg6, double 3.00000
0e+00, <4 x float> %arg5, i32 4, <4 x float> %arg4) |
| 195 ret void | 192 ret void |
| 196 ; CHECK-LABEL: test_passing_vectors_interspersed: | 193 ; CHECK-LABEL: test_passing_vectors_interspersed |
| 197 ; CHECK: sub esp, 80 | 194 ; CHECK: sub esp,0x50 |
| 198 ; CHECK: movups [[ARG9:.*]], xmmword ptr [esp + 112] | 195 ; CHECK: movups [[ARG9:.*]],XMMWORD PTR [esp+0x70] |
| 199 ; CHECK: movups xmmword ptr [esp + 32], [[ARG9]] | 196 ; CHECK: movups XMMWORD PTR [esp+0x20],[[ARG9]] |
| 200 ; CHECK: movups [[ARG11:.*]], xmmword ptr [esp + 96] | 197 ; CHECK: movups [[ARG11:.*]],XMMWORD PTR [esp+0x60] |
| 201 ; CHECK: movups xmmword ptr [esp + 64], [[ARG11]] | 198 ; CHECK: movups XMMWORD PTR [esp+0x40],[[ARG11]] |
| 202 ; CHECK: movups xmm0, xmmword ptr [esp + 176] | 199 ; CHECK: movups xmm0,XMMWORD PTR [esp+0xb0] |
| 203 ; CHECK: movups xmm1, xmmword ptr [esp + 160] | 200 ; CHECK: movups xmm1,XMMWORD PTR [esp+0xa0] |
| 204 ; CHECK: movups xmm2, xmmword ptr [esp + 144] | 201 ; CHECK: movups xmm2,XMMWORD PTR [esp+0x90] |
| 205 ; CHECK: movups xmm3, xmmword ptr [esp + 128] | 202 ; CHECK: movups xmm3,XMMWORD PTR [esp+0x80] |
| 206 ; CHECK: call InterspersedVectorArgs | 203 ; CHECK: call {{.*}} R_{{.*}} InterspersedVectorArgs |
| 207 ; CHECK-NEXT: add esp, 80 | 204 ; CHECK-NEXT: add esp,0x50 |
| 208 ; CHECK: ret | 205 ; CHECK: ret |
| 209 | 206 |
| 210 ; OPTM1-LABEL: test_passing_vectors_interspersed: | 207 ; OPTM1-LABEL: test_passing_vectors_interspersed |
| 211 ; OPTM1: sub esp, 80 | 208 ; OPTM1: sub esp,0x50 |
| 212 ; OPTM1: movups [[ARG9:.*]], xmmword ptr {{.*}} | 209 ; OPTM1: movups [[ARG9:.*]],XMMWORD PTR {{.*}} |
| 213 ; OPTM1: movups xmmword ptr [esp + 32], [[ARG9]] | 210 ; OPTM1: movups XMMWORD PTR [esp+0x20],[[ARG9]] |
| 214 ; OPTM1: movups [[ARG11:.*]], xmmword ptr {{.*}} | 211 ; OPTM1: movups [[ARG11:.*]],XMMWORD PTR {{.*}} |
| 215 ; OPTM1: movups xmmword ptr [esp + 64], [[ARG11]] | 212 ; OPTM1: movups XMMWORD PTR [esp+0x40],[[ARG11]] |
| 216 ; OPTM1: movups xmm0, xmmword ptr {{.*}} | 213 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
| 217 ; OPTM1: movups xmm1, xmmword ptr {{.*}} | 214 ; OPTM1: movups xmm1,XMMWORD PTR {{.*}} |
| 218 ; OPTM1: movups xmm2, xmmword ptr {{.*}} | 215 ; OPTM1: movups xmm2,XMMWORD PTR {{.*}} |
| 219 ; OPTM1: movups xmm3, xmmword ptr {{.*}} | 216 ; OPTM1: movups xmm3,XMMWORD PTR {{.*}} |
| 220 ; OPTM1: call InterspersedVectorArgs | 217 ; OPTM1: call {{.*}} R_{{.*}} InterspersedVectorArgs |
| 221 ; OPTM1-NEXT: add esp, 80 | 218 ; OPTM1-NEXT: add esp,0x50 |
| 222 ; OPTM1: ret | 219 ; OPTM1: ret |
| 223 } | 220 } |
| 224 | 221 |
| 225 ; Test that a vector returned from a function is recognized to be in | 222 ; Test that a vector returned from a function is recognized to be in |
| 226 ; xmm0. | 223 ; xmm0. |
| 227 | 224 |
| 228 declare <4 x float> @VectorReturn(<4 x float> %arg0) | 225 declare <4 x float> @VectorReturn(<4 x float> %arg0) |
| 229 | 226 |
| 230 define void @test_receiving_vectors(<4 x float> %arg0) { | 227 define void @test_receiving_vectors(<4 x float> %arg0) { |
| 231 entry: | 228 entry: |
| 232 %result = call <4 x float> @VectorReturn(<4 x float> %arg0) | 229 %result = call <4 x float> @VectorReturn(<4 x float> %arg0) |
| 233 %result2 = call <4 x float> @VectorReturn(<4 x float> %result) | 230 %result2 = call <4 x float> @VectorReturn(<4 x float> %result) |
| 234 ret void | 231 ret void |
| 235 ; CHECK-LABEL: test_receiving_vectors: | 232 ; CHECK-LABEL: test_receiving_vectors |
| 236 ; CHECK: call VectorReturn | 233 ; CHECK: call {{.*}} R_{{.*}} VectorReturn |
| 237 ; CHECK-NOT: movups xmm0 | 234 ; CHECK-NOT: movups xmm0 |
| 238 ; CHECK: call VectorReturn | 235 ; CHECK: call {{.*}} R_{{.*}} VectorReturn |
| 239 ; CHECK: ret | 236 ; CHECK: ret |
| 240 | 237 |
| 241 ; OPTM1-LABEL: test_receiving_vectors: | 238 ; OPTM1-LABEL: test_receiving_vectors |
| 242 ; OPTM1: call VectorReturn | 239 ; OPTM1: call {{.*}} R_{{.*}} VectorReturn |
| 243 ; OPTM1: movups {{.*}}, xmm0 | 240 ; OPTM1: movups {{.*}},xmm0 |
| 244 ; OPTM1: movups xmm0, {{.*}} | 241 ; OPTM1: movups xmm0,{{.*}} |
| 245 ; OPTM1: call VectorReturn | 242 ; OPTM1: call {{.*}} R_{{.*}} VectorReturn |
| 246 ; OPTM1: ret | 243 ; OPTM1: ret |
| 247 } | 244 } |
| OLD | NEW |