2 # RUN: llvm-mc -triple powerpc64-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-BE %s
3 # RUN: llvm-mc -triple powerpc64le-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-LE %s
5 # Cache management instruction
7 # CHECK-BE: icbi 2, 3 # encoding: [0x7c,0x02,0x1f,0xac]
8 # CHECK-LE: icbi 2, 3 # encoding: [0xac,0x1f,0x02,0x7c]
11 # CHECK-BE: icbt 0, 5, 31 # encoding: [0x7c,0x05,0xf8,0x2c]
12 # CHECK-LE: icbt 0, 5, 31 # encoding: [0x2c,0xf8,0x05,0x7c]
15 # CHECK-BE: dcbt 2, 3, 10 # encoding: [0x7d,0x42,0x1a,0x2c]
16 # CHECK-LE: dcbt 2, 3, 10 # encoding: [0x2c,0x1a,0x42,0x7d]
18 # CHECK-BE: dcbt 2, 3, 10 # encoding: [0x7d,0x42,0x1a,0x2c]
19 # CHECK-LE: dcbt 2, 3, 10 # encoding: [0x2c,0x1a,0x42,0x7d]
21 # CHECK-BE: dcbt 2, 3, 10 # encoding: [0x7d,0x42,0x1a,0x2c]
22 # CHECK-LE: dcbt 2, 3, 10 # encoding: [0x2c,0x1a,0x42,0x7d]
24 # CHECK-BE: dcbt 2, 3 # encoding: [0x7c,0x02,0x1a,0x2c]
25 # CHECK-LE: dcbt 2, 3 # encoding: [0x2c,0x1a,0x02,0x7c]
27 # CHECK-BE: dcbt 2, 3 # encoding: [0x7c,0x02,0x1a,0x2c]
28 # CHECK-LE: dcbt 2, 3 # encoding: [0x2c,0x1a,0x02,0x7c]
30 # CHECK-BE: dcbtt 2, 3 # encoding: [0x7e,0x02,0x1a,0x2c]
31 # CHECK-LE: dcbtt 2, 3 # encoding: [0x2c,0x1a,0x02,0x7e]
33 # CHECK-BE: dcbtt 2, 3 # encoding: [0x7e,0x02,0x1a,0x2c]
34 # CHECK-LE: dcbtt 2, 3 # encoding: [0x2c,0x1a,0x02,0x7e]
36 # CHECK-BE: dcbtst 2, 3, 10 # encoding: [0x7d,0x42,0x19,0xec]
37 # CHECK-LE: dcbtst 2, 3, 10 # encoding: [0xec,0x19,0x42,0x7d]
39 # CHECK-BE: dcbtst 2, 3, 10 # encoding: [0x7d,0x42,0x19,0xec]
40 # CHECK-LE: dcbtst 2, 3, 10 # encoding: [0xec,0x19,0x42,0x7d]
42 # CHECK-BE: dcbtst 2, 3, 10 # encoding: [0x7d,0x42,0x19,0xec]
43 # CHECK-LE: dcbtst 2, 3, 10 # encoding: [0xec,0x19,0x42,0x7d]
45 # CHECK-BE: dcbtst 2, 3 # encoding: [0x7c,0x02,0x19,0xec]
46 # CHECK-LE: dcbtst 2, 3 # encoding: [0xec,0x19,0x02,0x7c]
48 # CHECK-BE: dcbtst 2, 3 # encoding: [0x7c,0x02,0x19,0xec]
49 # CHECK-LE: dcbtst 2, 3 # encoding: [0xec,0x19,0x02,0x7c]
51 # CHECK-BE: dcbtstt 2, 3 # encoding: [0x7e,0x02,0x19,0xec]
52 # CHECK-LE: dcbtstt 2, 3 # encoding: [0xec,0x19,0x02,0x7e]
54 # CHECK-BE: dcbtstt 2, 3 # encoding: [0x7e,0x02,0x19,0xec]
55 # CHECK-LE: dcbtstt 2, 3 # encoding: [0xec,0x19,0x02,0x7e]
57 # CHECK-BE: dcbz 2, 3 # encoding: [0x7c,0x02,0x1f,0xec]
58 # CHECK-LE: dcbz 2, 3 # encoding: [0xec,0x1f,0x02,0x7c]
60 # CHECK-BE: dcbst 2, 3 # encoding: [0x7c,0x02,0x18,0x6c]
61 # CHECK-LE: dcbst 2, 3 # encoding: [0x6c,0x18,0x02,0x7c]
63 # CHECK-BE: dcbfl 2, 3 # encoding: [0x7c,0x22,0x18,0xac]
64 # CHECK-LE: dcbfl 2, 3 # encoding: [0xac,0x18,0x22,0x7c]
66 # CHECK-BE: dcbflp 2, 3 # encoding: [0x7c,0x62,0x18,0xac]
67 # CHECK-LE: dcbflp 2, 3 # encoding: [0xac,0x18,0x62,0x7c]
70 # Synchronization instructions
72 # CHECK-BE: isync # encoding: [0x4c,0x00,0x01,0x2c]
73 # CHECK-LE: isync # encoding: [0x2c,0x01,0x00,0x4c]
76 # FIXME: stbcx. 2, 3, 4
77 # FIXME: sthcx. 2, 3, 4
78 # CHECK-BE: stwcx. 2, 3, 4 # encoding: [0x7c,0x43,0x21,0x2d]
79 # CHECK-LE: stwcx. 2, 3, 4 # encoding: [0x2d,0x21,0x43,0x7c]
82 # CHECK-BE: stdcx. 2, 3, 4 # encoding: [0x7c,0x43,0x21,0xad]
83 # CHECK-LE: stdcx. 2, 3, 4 # encoding: [0xad,0x21,0x43,0x7c]
86 # CHECK-BE: stwat 2, 3, 28 # encoding: [0x7c,0x43,0xe5,0x8c]
87 # CHECK-LE: stwat 2, 3, 28 # encoding: [0x8c,0xe5,0x43,0x7c]
90 # CHECK-BE: stdat 2, 3, 28 # encoding: [0x7c,0x43,0xe5,0xcc]
91 # CHECK-LE: stdat 2, 3, 28 # encoding: [0xcc,0xe5,0x43,0x7c]
94 # CHECK-BE: ptesync # encoding: [0x7c,0x40,0x04,0xac]
95 # CHECK-LE: ptesync # encoding: [0xac,0x04,0x40,0x7c]
97 # CHECK-BE: eieio # encoding: [0x7c,0x00,0x06,0xac]
98 # CHECK-LE: eieio # encoding: [0xac,0x06,0x00,0x7c]
100 # CHECK-BE: waitimpl # encoding: [0x7c,0x40,0x00,0x3c]
101 # CHECK-LE: waitimpl # encoding: [0x3c,0x00,0x40,0x7c]
103 # CHECK-BE: mbar 1 # encoding: [0x7c,0x20,0x06,0xac]
104 # CHECK-LE: mbar 1 # encoding: [0xac,0x06,0x20,0x7c]
106 # CHECK-BE: mbar # encoding: [0x7c,0x00,0x06,0xac]
111 # CHECK-BE: dcbf 2, 3 # encoding: [0x7c,0x02,0x18,0xac]
112 # CHECK-LE: dcbf 2, 3 # encoding: [0xac,0x18,0x02,0x7c]
114 # CHECK-BE: dcbfl 2, 3 # encoding: [0x7c,0x22,0x18,0xac]
115 # CHECK-LE: dcbfl 2, 3 # encoding: [0xac,0x18,0x22,0x7c]
117 # CHECK-BE: dcbflp 2, 3 # encoding: [0x7c,0x62,0x18,0xac]
118 # CHECK-LE: dcbflp 2, 3 # encoding: [0xac,0x18,0x62,0x7c]
121 # CHECK-BE: lbarx 2, 3, 4 # encoding: [0x7c,0x43,0x20,0x68]
122 # CHECK-LE: lbarx 2, 3, 4 # encoding: [0x68,0x20,0x43,0x7c]
125 # CHECK-BE: lharx 2, 3, 4 # encoding: [0x7c,0x43,0x20,0xe8]
126 # CHECK-LE: lharx 2, 3, 4 # encoding: [0xe8,0x20,0x43,0x7c]
129 # CHECK-BE: lwarx 2, 3, 4 # encoding: [0x7c,0x43,0x20,0x28]
130 # CHECK-LE: lwarx 2, 3, 4 # encoding: [0x28,0x20,0x43,0x7c]
133 # CHECK-BE: ldarx 2, 3, 4 # encoding: [0x7c,0x43,0x20,0xa8]
134 # CHECK-LE: ldarx 2, 3, 4 # encoding: [0xa8,0x20,0x43,0x7c]
137 # CHECK-BE: lbarx 2, 3, 4, 1 # encoding: [0x7c,0x43,0x20,0x69]
138 # CHECK-LE: lbarx 2, 3, 4, 1 # encoding: [0x69,0x20,0x43,0x7c]
141 # CHECK-BE: lharx 2, 3, 4, 1 # encoding: [0x7c,0x43,0x20,0xe9]
142 # CHECK-LE: lharx 2, 3, 4, 1 # encoding: [0xe9,0x20,0x43,0x7c]
145 # CHECK-BE: lwarx 2, 3, 4, 1 # encoding: [0x7c,0x43,0x20,0x29]
146 # CHECK-LE: lwarx 2, 3, 4, 1 # encoding: [0x29,0x20,0x43,0x7c]
149 # CHECK-BE: ldarx 2, 3, 4, 1 # encoding: [0x7c,0x43,0x20,0xa9]
150 # CHECK-LE: ldarx 2, 3, 4, 1 # encoding: [0xa9,0x20,0x43,0x7c]
153 # CHECK-BE: lwat 2, 3, 28 # encoding: [0x7c,0x43,0xe4,0x8c]
154 # CHECK-LE: lwat 2, 3, 28 # encoding: [0x8c,0xe4,0x43,0x7c]
157 # CHECK-BE: ldat 2, 3, 28 # encoding: [0x7c,0x43,0xe4,0xcc]
158 # CHECK-LE: ldat 2, 3, 28 # encoding: [0xcc,0xe4,0x43,0x7c]
161 # CHECK-BE: sync # encoding: [0x7c,0x00,0x04,0xac]
162 # CHECK-LE: sync # encoding: [0xac,0x04,0x00,0x7c]
164 # CHECK-BE: sync # encoding: [0x7c,0x00,0x04,0xac]
165 # CHECK-LE: sync # encoding: [0xac,0x04,0x00,0x7c]
167 # CHECK-BE: lwsync # encoding: [0x7c,0x20,0x04,0xac]
168 # CHECK-LE: lwsync # encoding: [0xac,0x04,0x20,0x7c]
170 # CHECK-BE: ptesync # encoding: [0x7c,0x40,0x04,0xac]
171 # CHECK-LE: ptesync # encoding: [0xac,0x04,0x40,0x7c]
174 # CHECK-BE: wait # encoding: [0x7c,0x00,0x00,0x3c]
175 # CHECK-LE: wait # encoding: [0x3c,0x00,0x00,0x7c]
177 # CHECK-BE: waitrsv # encoding: [0x7c,0x20,0x00,0x3c]
178 # CHECK-LE: waitrsv # encoding: [0x3c,0x00,0x20,0x7c]
180 # CHECK-BE: waitimpl # encoding: [0x7c,0x40,0x00,0x3c]
181 # CHECK-LE: waitimpl # encoding: [0x3c,0x00,0x40,0x7c]
184 # Time base instructions
186 # CHECK-BE: mftb 2, 123 # encoding: [0x7c,0x5b,0x1a,0xe6]
187 # CHECK-LE: mftb 2, 123 # encoding: [0xe6,0x1a,0x5b,0x7c]
189 # CHECK-BE: mftb 2, 268 # encoding: [0x7c,0x4c,0x42,0xe6]
190 # CHECK-LE: mftb 2, 268 # encoding: [0xe6,0x42,0x4c,0x7c]
192 # CHECK-BE: mftb 2, 268 # encoding: [0x7c,0x4c,0x42,0xe6]
193 # CHECK-LE: mftb 2, 268 # encoding: [0xe6,0x42,0x4c,0x7c]
195 # CHECK-BE: mftbu 2 # encoding: [0x7c,0x4d,0x42,0xe6]
196 # CHECK-LE: mftbu 2 # encoding: [0xe6,0x42,0x4d,0x7c]
199 # CHECK-BE: mttbl 3 # encoding: [0x7c,0x7c,0x43,0xa6]
200 # CHECK-LE: mttbl 3 # encoding: [0xa6,0x43,0x7c,0x7c]
202 # CHECK-BE: mttbu 3 # encoding: [0x7c,0x7d,0x43,0xa6]
203 # CHECK-LE: mttbu 3 # encoding: [0xa6,0x43,0x7d,0x7c]