1 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mattr=+vsx -ppc-vsr-nums-as-vr \
2 ; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu < %s \
5 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=-power9-vector -ppc-vsr-nums-as-vr \
6 ; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu < %s \
7 ; RUN: | FileCheck --check-prefix=CHECK-P9-VECTOR %s
9 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
10 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s \
11 ; RUN: --check-prefix=CHECK-P9 --implicit-check-not xxswapd
13 define <2 x double> @testi0(<2 x double>* %p1, double* %p2) {
14 ; CHECK-LABEL: testi0:
16 ; CHECK-NEXT: lxvd2x vs0, 0, r3
17 ; CHECK-NEXT: lfdx f1, 0, r4
18 ; CHECK-NEXT: xxswapd vs0, vs0
19 ; CHECK-NEXT: xxspltd vs1, vs1, 0
20 ; CHECK-NEXT: xxpermdi v2, vs0, vs1, 1
23 ; CHECK-P9-VECTOR-LABEL: testi0:
24 ; CHECK-P9-VECTOR: # %bb.0:
25 ; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3
26 ; CHECK-P9-VECTOR-NEXT: lfdx f1, 0, r4
27 ; CHECK-P9-VECTOR-NEXT: xxspltd vs1, vs1, 0
28 ; CHECK-P9-VECTOR-NEXT: xxswapd vs0, vs0
29 ; CHECK-P9-VECTOR-NEXT: xxpermdi v2, vs0, vs1, 1
30 ; CHECK-P9-VECTOR-NEXT: blr
32 ; CHECK-P9-LABEL: testi0:
34 ; CHECK-P9-NEXT: lfd [[REG:f[0-9]+]], 0(r4)
35 ; CHECK-P9-NEXT: lxv [[REG1:vs[0-9]+]], 0(r3)
36 ; CHECK-P9-NEXT: xxpermdi [[REG2:vs[0-9]+]], [[REG]], [[REG]], 2
37 ; CHECK-P9-NEXT: xxpermdi v2, [[REG1]], [[REG2]], 1
39 %v = load <2 x double>, <2 x double>* %p1
40 %s = load double, double* %p2
41 %r = insertelement <2 x double> %v, double %s, i32 0
47 define <2 x double> @testi1(<2 x double>* %p1, double* %p2) {
48 ; CHECK-LABEL: testi1:
50 ; CHECK-NEXT: lxvd2x vs0, 0, r3
51 ; CHECK-NEXT: lfdx f1, 0, r4
52 ; CHECK-NEXT: xxswapd vs0, vs0
53 ; CHECK-NEXT: xxspltd vs1, vs1, 0
54 ; CHECK-NEXT: xxmrgld v2, vs1, vs0
57 ; CHECK-P9-VECTOR-LABEL: testi1:
58 ; CHECK-P9-VECTOR: # %bb.0:
59 ; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3
60 ; CHECK-P9-VECTOR-NEXT: lfdx f1, 0, r4
61 ; CHECK-P9-VECTOR-NEXT: xxspltd vs1, vs1, 0
62 ; CHECK-P9-VECTOR-NEXT: xxswapd vs0, vs0
63 ; CHECK-P9-VECTOR-NEXT: xxmrgld v2, vs1, vs0
64 ; CHECK-P9-VECTOR-NEXT: blr
66 ; CHECK-P9-LABEL: testi1:
68 ; CHECK-P9-NEXT: lfd [[REG:f[0-9]+]], 0(r4)
69 ; CHECK-P9-NEXT: lxv [[REG1:vs[0-9]+]], 0(r3)
70 ; CHECK-P9-NEXT: xxpermdi [[REG2:vs[0-9]+]], [[REG]], [[REG]], 2
71 ; CHECK-P9-NEXT: xxmrgld v2, [[REG2]], [[REG1]]
73 %v = load <2 x double>, <2 x double>* %p1
74 %s = load double, double* %p2
75 %r = insertelement <2 x double> %v, double %s, i32 1
81 define double @teste0(<2 x double>* %p1) {
82 ; CHECK-LABEL: teste0:
84 ; CHECK-NEXT: lxvd2x vs1, 0, r3
87 ; CHECK-P9-VECTOR-LABEL: teste0:
88 ; CHECK-P9-VECTOR: # %bb.0:
89 ; CHECK-P9-VECTOR-NEXT: lxvd2x vs1, 0, r3
90 ; CHECK-P9-VECTOR: blr
92 ; CHECK-P9-LABEL: teste0:
94 ; CHECK-P9-NEXT: lfd f1, 0(r3)
96 %v = load <2 x double>, <2 x double>* %p1
97 %r = extractelement <2 x double> %v, i32 0
103 define double @teste1(<2 x double>* %p1) {
104 ; CHECK-LABEL: teste1:
106 ; CHECK-NEXT: lxvd2x vs0, 0, r3
107 ; CHECK-NEXT: xxswapd vs1, vs0
110 ; CHECK-P9-VECTOR-LABEL: teste1:
111 ; CHECK-P9-VECTOR: # %bb.0:
112 ; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3
113 ; CHECK-P9-VECTOR-NEXT: xxswapd vs1, vs0
114 ; CHECK-P9-VECTOR: blr
116 ; CHECK-P9-LABEL: teste1:
118 ; CHECK-P9-NEXT: lfd f1, 8(r3)
120 %v = load <2 x double>, <2 x double>* %p1
121 %r = extractelement <2 x double> %v, i32 1