OLD | NEW |
1 ; Test the lowering sequence for commutative operations. If there is a source | 1 ; Test the lowering sequence for commutative operations. If there is a source |
2 ; operand whose lifetime ends in an operation, it should be the first operand, | 2 ; operand whose lifetime ends in an operation, it should be the first operand, |
3 ; eliminating the need for a move to start the new lifetime. | 3 ; eliminating the need for a move to start the new lifetime. |
4 | 4 |
5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
6 ; RUN: --target x8632 -i %s --args -O2 \ | 6 ; RUN: --target x8632 -i %s --args -O2 \ |
7 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 7 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
8 | 8 |
9 define internal i32 @integerAddLeft(i32 %a, i32 %b) { | 9 define internal i32 @integerAddLeft(i32 %a, i32 %b) { |
10 entry: | 10 entry: |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ; CHECK-NEXT: imul {{e..}},{{e..}} | 54 ; CHECK-NEXT: imul {{e..}},{{e..}} |
55 ; CHECK-NEXT: imul {{e..}},{{e..}} | 55 ; CHECK-NEXT: imul {{e..}},{{e..}} |
56 | 56 |
57 define internal float @floatAddLeft(float %a, float %b) { | 57 define internal float @floatAddLeft(float %a, float %b) { |
58 entry: | 58 entry: |
59 %tmp = fadd float %a, %b | 59 %tmp = fadd float %a, %b |
60 %result = fadd float %a, %tmp | 60 %result = fadd float %a, %tmp |
61 ret float %result | 61 ret float %result |
62 } | 62 } |
63 ; CHECK-LABEL: floatAddLeft | 63 ; CHECK-LABEL: floatAddLeft |
| 64 ; CHECK-NEXT: sub esp,0xc |
64 ; CHECK-NEXT: movss xmm0,DWORD PTR | 65 ; CHECK-NEXT: movss xmm0,DWORD PTR |
65 ; CHECK-NEXT: movss xmm1,DWORD PTR | 66 ; CHECK-NEXT: movss xmm1,DWORD PTR |
66 ; CHECK-NEXT: addss xmm1,xmm0 | 67 ; CHECK-NEXT: addss xmm1,xmm0 |
67 ; CHECK-NEXT: addss xmm0,xmm1 | 68 ; CHECK-NEXT: addss xmm0,xmm1 |
68 | 69 |
69 define internal float @floatAddRight(float %a, float %b) { | 70 define internal float @floatAddRight(float %a, float %b) { |
70 entry: | 71 entry: |
71 %tmp = fadd float %a, %b | 72 %tmp = fadd float %a, %b |
72 %result = fadd float %b, %tmp | 73 %result = fadd float %b, %tmp |
73 ret float %result | 74 ret float %result |
74 } | 75 } |
75 ; CHECK-LABEL: floatAddRight | 76 ; CHECK-LABEL: floatAddRight |
| 77 ; CHECK-NEXT: sub esp,0xc |
76 ; CHECK-NEXT: movss xmm0,DWORD PTR | 78 ; CHECK-NEXT: movss xmm0,DWORD PTR |
77 ; CHECK-NEXT: movss xmm1,DWORD PTR | 79 ; CHECK-NEXT: movss xmm1,DWORD PTR |
78 ; CHECK-NEXT: addss xmm0,xmm1 | 80 ; CHECK-NEXT: addss xmm0,xmm1 |
79 ; CHECK-NEXT: addss xmm1,xmm0 | 81 ; CHECK-NEXT: addss xmm1,xmm0 |
80 | 82 |
81 define internal float @floatMultiplyLeft(float %a, float %b) { | 83 define internal float @floatMultiplyLeft(float %a, float %b) { |
82 entry: | 84 entry: |
83 %tmp = fmul float %a, %b | 85 %tmp = fmul float %a, %b |
84 %result = fmul float %a, %tmp | 86 %result = fmul float %a, %tmp |
85 ret float %result | 87 ret float %result |
86 } | 88 } |
87 ; CHECK-LABEL: floatMultiplyLeft | 89 ; CHECK-LABEL: floatMultiplyLeft |
| 90 ; CHECK-NEXT: sub esp,0xc |
88 ; CHECK-NEXT: movss xmm0,DWORD PTR | 91 ; CHECK-NEXT: movss xmm0,DWORD PTR |
89 ; CHECK-NEXT: movss xmm1,DWORD PTR | 92 ; CHECK-NEXT: movss xmm1,DWORD PTR |
90 ; CHECK-NEXT: mulss xmm1,xmm0 | 93 ; CHECK-NEXT: mulss xmm1,xmm0 |
91 ; CHECK-NEXT: mulss xmm0,xmm1 | 94 ; CHECK-NEXT: mulss xmm0,xmm1 |
92 | 95 |
93 define internal float @floatMultiplyRight(float %a, float %b) { | 96 define internal float @floatMultiplyRight(float %a, float %b) { |
94 entry: | 97 entry: |
95 %tmp = fmul float %a, %b | 98 %tmp = fmul float %a, %b |
96 %result = fmul float %b, %tmp | 99 %result = fmul float %b, %tmp |
97 ret float %result | 100 ret float %result |
98 } | 101 } |
99 ; CHECK-LABEL: floatMultiplyRight | 102 ; CHECK-LABEL: floatMultiplyRight |
| 103 ; CHECK-NEXT: sub esp,0xc |
100 ; CHECK-NEXT: movss xmm0,DWORD PTR | 104 ; CHECK-NEXT: movss xmm0,DWORD PTR |
101 ; CHECK-NEXT: movss xmm1,DWORD PTR | 105 ; CHECK-NEXT: movss xmm1,DWORD PTR |
102 ; CHECK-NEXT: mulss xmm0,xmm1 | 106 ; CHECK-NEXT: mulss xmm0,xmm1 |
103 ; CHECK-NEXT: mulss xmm1,xmm0 | 107 ; CHECK-NEXT: mulss xmm1,xmm0 |
OLD | NEW |