vsx_insert_extract_le.ll
4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mattr=+vsx -ppc-vsr-nums-as-vr \
; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu < %s \
; RUN: | FileCheck %s
; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=-power9-vector -ppc-vsr-nums-as-vr \
; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu < %s \
; RUN: | FileCheck --check-prefix=CHECK-P9-VECTOR %s
; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s \
; RUN: --check-prefix=CHECK-P9 --implicit-check-not xxswapd
define <2 x double> @testi0(<2 x double>* %p1, double* %p2) {
; CHECK-LABEL: testi0:
; CHECK: # %bb.0:
; CHECK-NEXT: lxvd2x vs0, 0, r3
; CHECK-NEXT: lfdx f1, 0, r4
; CHECK-NEXT: xxswapd vs0, vs0
; CHECK-NEXT: xxspltd vs1, vs1, 0
; CHECK-NEXT: xxpermdi v2, vs0, vs1, 1
; CHECK-NEXT: blr
;
; CHECK-P9-VECTOR-LABEL: testi0:
; CHECK-P9-VECTOR: # %bb.0:
; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3
; CHECK-P9-VECTOR-NEXT: lfdx f1, 0, r4
; CHECK-P9-VECTOR-NEXT: xxspltd vs1, vs1, 0
; CHECK-P9-VECTOR-NEXT: xxswapd vs0, vs0
; CHECK-P9-VECTOR-NEXT: xxpermdi v2, vs0, vs1, 1
; CHECK-P9-VECTOR-NEXT: blr
;
; CHECK-P9-LABEL: testi0:
; CHECK-P9: # %bb.0:
; CHECK-P9-NEXT: lfd f1, 0(r4)
; CHECK-P9-NEXT: lxv vs0, 0(r3)
; CHECK-P9-NEXT: xxpermdi vs1, f1, f1, 2
; CHECK-P9-NEXT: xxpermdi v2, vs0, vs1, 1
; CHECK-P9-NEXT: blr
%v = load <2 x double>, <2 x double>* %p1
%s = load double, double* %p2
%r = insertelement <2 x double> %v, double %s, i32 0
ret <2 x double> %r
}
define <2 x double> @testi1(<2 x double>* %p1, double* %p2) {
; CHECK-LABEL: testi1:
; CHECK: # %bb.0:
; CHECK-NEXT: lxvd2x vs0, 0, r3
; CHECK-NEXT: lfdx f1, 0, r4
; CHECK-NEXT: xxswapd vs0, vs0
; CHECK-NEXT: xxspltd vs1, vs1, 0
; CHECK-NEXT: xxmrgld v2, vs1, vs0
; CHECK-NEXT: blr
;
; CHECK-P9-VECTOR-LABEL: testi1:
; CHECK-P9-VECTOR: # %bb.0:
; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3
; CHECK-P9-VECTOR-NEXT: lfdx f1, 0, r4
; CHECK-P9-VECTOR-NEXT: xxspltd vs1, vs1, 0
; CHECK-P9-VECTOR-NEXT: xxswapd vs0, vs0
; CHECK-P9-VECTOR-NEXT: xxmrgld v2, vs1, vs0
; CHECK-P9-VECTOR-NEXT: blr
;
; CHECK-P9-LABEL: testi1:
; CHECK-P9: # %bb.0:
; CHECK-P9-NEXT: lfd f1, 0(r4)
; CHECK-P9-NEXT: lxv vs0, 0(r3)
; CHECK-P9-NEXT: xxpermdi vs1, f1, f1, 2
; CHECK-P9-NEXT: xxmrgld v2, vs1, vs0
; CHECK-P9-NEXT: blr
%v = load <2 x double>, <2 x double>* %p1
%s = load double, double* %p2
%r = insertelement <2 x double> %v, double %s, i32 1
ret <2 x double> %r
}
define double @teste0(<2 x double>* %p1) {
; CHECK-LABEL: teste0:
; CHECK: # %bb.0:
; CHECK-NEXT: lxvd2x vs1, 0, r3
; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
; CHECK-NEXT: blr
;
; CHECK-P9-VECTOR-LABEL: teste0:
; CHECK-P9-VECTOR: # %bb.0:
; CHECK-P9-VECTOR-NEXT: lxvd2x vs1, 0, r3
; CHECK-P9-VECTOR-NEXT: # kill: def $f1 killed $f1 killed $vsl1
; CHECK-P9-VECTOR-NEXT: blr
;
; CHECK-P9-LABEL: teste0:
; CHECK-P9: # %bb.0:
; CHECK-P9-NEXT: lfd f1, 0(r3)
; CHECK-P9-NEXT: blr
%v = load <2 x double>, <2 x double>* %p1
%r = extractelement <2 x double> %v, i32 0
ret double %r
}
define double @teste1(<2 x double>* %p1) {
; CHECK-LABEL: teste1:
; CHECK: # %bb.0:
; CHECK-NEXT: lxvd2x vs0, 0, r3
; CHECK-NEXT: xxswapd vs1, vs0
; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
; CHECK-NEXT: blr
;
; CHECK-P9-VECTOR-LABEL: teste1:
; CHECK-P9-VECTOR: # %bb.0:
; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3
; CHECK-P9-VECTOR-NEXT: xxswapd vs1, vs0
; CHECK-P9-VECTOR-NEXT: # kill: def $f1 killed $f1 killed $vsl1
; CHECK-P9-VECTOR-NEXT: blr
;
; CHECK-P9-LABEL: teste1:
; CHECK-P9: # %bb.0:
; CHECK-P9-NEXT: lfd f1, 8(r3)
; CHECK-P9-NEXT: blr
%v = load <2 x double>, <2 x double>* %p1
%r = extractelement <2 x double> %v, i32 1
ret double %r
}