llvm.org GIT mirror llvm / 551a3d7
[PowerPC] Clean up -mattr=+vsx tests to always specify -mcpu We recently discovered an issue that reinforces what a good idea it is to always specify -mcpu in our code generation tests, particularly for -mattr=+vsx. This patch ensures that all tests that specify -mattr=+vsx also specify -mcpu=pwr7 or -mcpu=pwr8, as appropriate. Some of the uses of -mattr=+vsx added recently don't make much sense (when specified for -mtriple=powerpc-apple-darwin8 or -march=ppc32, for example). For cases like this I've just removed the extra VSX test commands; there's enough coverage without them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220173 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Schmidt 5 years ago
11 changed file(s) with 8 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
11 ; RUN: llc -mattr=-vsx < %s | grep stfs | count 1
22 ; RUN: llc -mattr=-vsx < %s | grep lfd | count 2
33 ; RUN: llc -mattr=-vsx < %s | grep lfs | count 2
4 ; RUN: llc -mattr=+vsx < %s | grep stxsdx | count 3
5 ; RUN: llc -mattr=+vsx < %s | grep stfs | count 1
6 ; RUN: llc -mattr=+vsx < %s | grep lxsdx | count 2
7 ; RUN: llc -mattr=+vsx < %s | grep lfs | count 2
84 ; ModuleID = 'foo.c'
95 target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
106 target triple = "powerpc-apple-darwin8"
None ; RUN: llc -mattr=-vsx -mattr=+altivec < %s | FileCheck %s
1 ; RUN: llc -mattr=+vsx -mattr=+altivec < %s | FileCheck -check-prefix=CHECK-VSX %s
0 ; RUN: llc -mattr=-vsx -mattr=+altivec -mcpu=pwr7 < %s | FileCheck %s
1 ; RUN: llc -mattr=+vsx -mattr=+altivec -mcpu=pwr7 < %s | FileCheck -check-prefix=CHECK-VSX %s
22 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
33 target triple = "powerpc64-unknown-linux-gnu"
44
0 ; RUN: llc < %s -mattr=-vsx -march=ppc32 -mattr=+altivec --enable-unsafe-fp-math | FileCheck %s
1 ; RUN: llc < %s -mattr=+vsx -march=ppc32 -mattr=+altivec --enable-unsafe-fp-math | FileCheck -check-prefix=CHECK-VSX %s
21
32 define void @VXOR(<4 x float>* %P1, <4 x i32>* %P2, <4 x float>* %P3) {
43 %tmp = load <4 x float>* %P3 ; <<4 x float>> [#uses=1]
1413 ; CHECK: @VXOR
1514 ; CHECK: vsplti
1615 ; CHECK: vxor
17 ; CHECK-VSX: @VXOR
18 ; CHECK-VSX: vxor
19 ; CHECK-VSX: xvmulsp
2016
2117 define void @VSPLTI(<4 x i32>* %P2, <8 x i16>* %P3) {
2218 store <4 x i32> bitcast (<16 x i8> < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1 > to <4 x i32>), <4 x i32>* %P2
2521 }
2622 ; CHECK: @VSPLTI
2723 ; CHECK: vsplti
28 ; CHECK-VSX: @VSPLTI
29 ; CHECK-VSX: vsplti
0 ; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin | grep "fabs f1, f1"
1 ; RUN: llc < %s -mattr=+vsx -march=ppc32 -mtriple=powerpc-apple-darwin | grep "xsabsdp f1, f1"
21
32 define double @fabs(double %f) {
43 entry:
0 ; RUN: llc < %s -mattr=-vsx -march=ppc32 | grep fnabs
1 ; RUN: llc < %s -mattr=+vsx -march=ppc32 | grep xsnabsdp
21
32 declare double @fabs(double)
43
0 ; RUN: llc < %s -mattr=-vsx -march=ppc32 | grep fcmp | count 1
1 ; RUN: llc < %s -mattr=+vsx -march=ppc32 | grep xscmpudp | count 1
21
32 declare i1 @llvm.isunordered.f64(double, double)
43
0 ; RUN: llc < %s -mattr=-vsx -march=ppc32 | grep fctiwz | count 1
1 ; RUN: llc < %s -mattr=+vsx -march=ppc32 | grep xscvdpsxws | count 1
21
32
43 define i16 @foo(float %a) {
1616 ; RUN: not grep fcfid
1717 ; RUN: llc < %s -mattr=-vsx -march=ppc32 -mcpu=g4 | \
1818 ; RUN: not grep fctidz
19 ; RUN: llc < %s -mattr=+vsx -march=ppc32 -mattr=+64bit | \
20 ; RUN: grep xscvdpsxds
21 ; RUN: llc < %s -mattr=+vsx -march=ppc32 -mattr=+64bit | \
22 ; RUN: grep xscvsxddp
2319
2420 define double @X(double %Y) {
2521 %A = fptosi double %Y to i64 ; [#uses=1]
0 ; RUN: llc < %s -mattr=-vsx -march=ppc32 | grep fmul | count 2
11 ; RUN: llc < %s -mattr=-vsx -march=ppc32 -enable-unsafe-fp-math | \
22 ; RUN: grep fmul | count 1
3 ; RUN: llc < %s -mattr=+vsx -march=ppc32 | grep xsmuldp | count 2
4 ; RUN: llc < %s -mattr=+vsx -march=ppc32 -enable-unsafe-fp-math | \
5 ; RUN: grep xsmuldp | count 1
63
74 define double @foo(double %X) nounwind {
85 %tmp1 = fmul double %X, 1.23
0 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -march=ppc32 -mattr=+altivec -mattr=-vsx | FileCheck %s
1 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=-vsx | FileCheck %s
2 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=-vsx | FileCheck %s -check-prefix=CHECK-LE
3 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -march=ppc32 -mattr=+altivec -mattr=+vsx | FileCheck %s -check-prefix=CHECK-VSX
4 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=+vsx | FileCheck %s -check-prefix=CHECK-VSX
5 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=+vsx | FileCheck %s -check-prefix=CHECK-LE-VSX
1 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=-vsx -mcpu=pwr7 | FileCheck %s
2 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=-vsx -mcpu=pwr8 | FileCheck %s -check-prefix=CHECK-LE
3 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=+vsx -mcpu=pwr7 | FileCheck %s -check-prefix=CHECK-VSX
4 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -march=ppc64 -mattr=+altivec -mattr=+vsx -mcpu=pwr8 | FileCheck %s -check-prefix=CHECK-LE-VSX
65
76 define <4 x i32> @test_v4i32(<4 x i32>* %X, <4 x i32>* %Y) {
87 %tmp = load <4 x i32>* %X ; <<4 x i32>> [#uses=1]
0 ; RUN: llc -O0 -mtriple=powerpc-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -verify-machineinstrs < %s | FileCheck %s
1 ; RUN: llc -O0 -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -verify-machineinstrs -fast-isel=false < %s | FileCheck %s
2 ; RUN: llc -O0 -mtriple=powerpc-unknown-linux-gnu -mattr=+altivec -mattr=+vsx -verify-machineinstrs < %s | FileCheck -check-prefix=CHECK-VSX %s
3 ; RUN: llc -O0 -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=+vsx -verify-machineinstrs -fast-isel=false < %s | FileCheck -check-prefix=CHECK-VSX %s
1 ; RUN: llc -O0 -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -verify-machineinstrs -fast-isel=false -mcpu=pwr7 < %s | FileCheck %s
2 ; RUN: llc -O0 -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=+vsx -verify-machineinstrs -fast-isel=false -mcpu=pwr7 < %s | FileCheck -check-prefix=CHECK-VSX %s
43
54 ; This verifies that we generate correct spill/reload code for vector regs.
65