xref: /aosp_15_r20/external/llvm/test/MC/PowerPC/ppc64-encoding-bookII.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker
2*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc -triple powerpc64-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-BE %s
3*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc -triple powerpc64le-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-LE %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker# Cache management instruction
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker# CHECK-BE: icbi 2, 3                       # encoding: [0x7c,0x02,0x1f,0xac]
8*9880d681SAndroid Build Coastguard Worker# CHECK-LE: icbi 2, 3                       # encoding: [0xac,0x1f,0x02,0x7c]
9*9880d681SAndroid Build Coastguard Worker            icbi 2, 3
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker# CHECK-BE: icbt 0, 5, 31                   # encoding: [0x7c,0x05,0xf8,0x2c]
12*9880d681SAndroid Build Coastguard Worker# CHECK-LE: icbt 0, 5, 31                   # encoding: [0x2c,0xf8,0x05,0x7c]
13*9880d681SAndroid Build Coastguard Worker            icbt 0, 5, 31
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbt 2, 3, 10                   # encoding: [0x7d,0x42,0x1a,0x2c]
16*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbt 2, 3, 10                   # encoding: [0x2c,0x1a,0x42,0x7d]
17*9880d681SAndroid Build Coastguard Worker            dcbt 2, 3, 10
18*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbt 2, 3, 10                   # encoding: [0x7d,0x42,0x1a,0x2c]
19*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbt 2, 3, 10                   # encoding: [0x2c,0x1a,0x42,0x7d]
20*9880d681SAndroid Build Coastguard Worker            dcbtct 2, 3, 10
21*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbt 2, 3, 10                   # encoding: [0x7d,0x42,0x1a,0x2c]
22*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbt 2, 3, 10                   # encoding: [0x2c,0x1a,0x42,0x7d]
23*9880d681SAndroid Build Coastguard Worker            dcbtds 2, 3, 10
24*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbt 2, 3                       # encoding: [0x7c,0x02,0x1a,0x2c]
25*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbt 2, 3                       # encoding: [0x2c,0x1a,0x02,0x7c]
26*9880d681SAndroid Build Coastguard Worker            dcbt 2, 3
27*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbt 2, 3                       # encoding: [0x7c,0x02,0x1a,0x2c]
28*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbt 2, 3                       # encoding: [0x2c,0x1a,0x02,0x7c]
29*9880d681SAndroid Build Coastguard Worker            dcbt 2, 3, 0
30*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtt 2, 3                      # encoding: [0x7e,0x02,0x1a,0x2c]
31*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtt 2, 3                      # encoding: [0x2c,0x1a,0x02,0x7e]
32*9880d681SAndroid Build Coastguard Worker            dcbtt 2, 3
33*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtt 2, 3                      # encoding: [0x7e,0x02,0x1a,0x2c]
34*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtt 2, 3                      # encoding: [0x2c,0x1a,0x02,0x7e]
35*9880d681SAndroid Build Coastguard Worker            dcbt 2, 3, 16
36*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtst 2, 3, 10                 # encoding: [0x7d,0x42,0x19,0xec]
37*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtst 2, 3, 10                 # encoding: [0xec,0x19,0x42,0x7d]
38*9880d681SAndroid Build Coastguard Worker            dcbtst 2, 3, 10
39*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtst 2, 3, 10                 # encoding: [0x7d,0x42,0x19,0xec]
40*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtst 2, 3, 10                 # encoding: [0xec,0x19,0x42,0x7d]
41*9880d681SAndroid Build Coastguard Worker            dcbtstct 2, 3, 10
42*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtst 2, 3, 10                 # encoding: [0x7d,0x42,0x19,0xec]
43*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtst 2, 3, 10                 # encoding: [0xec,0x19,0x42,0x7d]
44*9880d681SAndroid Build Coastguard Worker            dcbtstds 2, 3, 10
45*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtst 2, 3                     # encoding: [0x7c,0x02,0x19,0xec]
46*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtst 2, 3                     # encoding: [0xec,0x19,0x02,0x7c]
47*9880d681SAndroid Build Coastguard Worker            dcbtst 2, 3
48*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtst 2, 3                     # encoding: [0x7c,0x02,0x19,0xec]
49*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtst 2, 3                     # encoding: [0xec,0x19,0x02,0x7c]
50*9880d681SAndroid Build Coastguard Worker            dcbtst 2, 3, 0
51*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtstt 2, 3                    # encoding: [0x7e,0x02,0x19,0xec]
52*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtstt 2, 3                    # encoding: [0xec,0x19,0x02,0x7e]
53*9880d681SAndroid Build Coastguard Worker            dcbtstt 2, 3
54*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbtstt 2, 3                    # encoding: [0x7e,0x02,0x19,0xec]
55*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbtstt 2, 3                    # encoding: [0xec,0x19,0x02,0x7e]
56*9880d681SAndroid Build Coastguard Worker            dcbtst 2, 3, 16
57*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbz 2, 3                       # encoding: [0x7c,0x02,0x1f,0xec]
58*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbz 2, 3                       # encoding: [0xec,0x1f,0x02,0x7c]
59*9880d681SAndroid Build Coastguard Worker            dcbz 2, 3
60*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbst 2, 3                      # encoding: [0x7c,0x02,0x18,0x6c]
61*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbst 2, 3                      # encoding: [0x6c,0x18,0x02,0x7c]
62*9880d681SAndroid Build Coastguard Worker            dcbst 2, 3
63*9880d681SAndroid Build Coastguard Worker# FIXME:    dcbf 2, 3, 1
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Worker# Synchronization instructions
66*9880d681SAndroid Build Coastguard Worker
67*9880d681SAndroid Build Coastguard Worker# CHECK-BE: isync                           # encoding: [0x4c,0x00,0x01,0x2c]
68*9880d681SAndroid Build Coastguard Worker# CHECK-LE: isync                           # encoding: [0x2c,0x01,0x00,0x4c]
69*9880d681SAndroid Build Coastguard Worker            isync
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard Worker# FIXME:    stbcx. 2, 3, 4
72*9880d681SAndroid Build Coastguard Worker# FIXME:    sthcx. 2, 3, 4
73*9880d681SAndroid Build Coastguard Worker# CHECK-BE: stwcx. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0x2d]
74*9880d681SAndroid Build Coastguard Worker# CHECK-LE: stwcx. 2, 3, 4                  # encoding: [0x2d,0x21,0x43,0x7c]
75*9880d681SAndroid Build Coastguard Worker            stwcx. 2, 3, 4
76*9880d681SAndroid Build Coastguard Worker
77*9880d681SAndroid Build Coastguard Worker# CHECK-BE: stdcx. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0xad]
78*9880d681SAndroid Build Coastguard Worker# CHECK-LE: stdcx. 2, 3, 4                  # encoding: [0xad,0x21,0x43,0x7c]
79*9880d681SAndroid Build Coastguard Worker            stdcx. 2, 3, 4
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Worker# CHECK-BE: stwat 2, 3, 28                  # encoding: [0x7c,0x43,0xe5,0x8c]
82*9880d681SAndroid Build Coastguard Worker# CHECK-LE: stwat 2, 3, 28                  # encoding: [0x8c,0xe5,0x43,0x7c]
83*9880d681SAndroid Build Coastguard Worker            stwat 2, 3, 28
84*9880d681SAndroid Build Coastguard Worker
85*9880d681SAndroid Build Coastguard Worker# CHECK-BE: stdat 2, 3, 28                  # encoding: [0x7c,0x43,0xe5,0xcc]
86*9880d681SAndroid Build Coastguard Worker# CHECK-LE: stdat 2, 3, 28                  # encoding: [0xcc,0xe5,0x43,0x7c]
87*9880d681SAndroid Build Coastguard Worker            stdat 2, 3, 28
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard Worker# CHECK-BE: ptesync                         # encoding: [0x7c,0x40,0x04,0xac]
90*9880d681SAndroid Build Coastguard Worker# CHECK-LE: ptesync                         # encoding: [0xac,0x04,0x40,0x7c]
91*9880d681SAndroid Build Coastguard Worker            sync 2
92*9880d681SAndroid Build Coastguard Worker# CHECK-BE: eieio                           # encoding: [0x7c,0x00,0x06,0xac]
93*9880d681SAndroid Build Coastguard Worker# CHECK-LE: eieio                           # encoding: [0xac,0x06,0x00,0x7c]
94*9880d681SAndroid Build Coastguard Worker            eieio
95*9880d681SAndroid Build Coastguard Worker# CHECK-BE: waitimpl                        # encoding: [0x7c,0x40,0x00,0x7c]
96*9880d681SAndroid Build Coastguard Worker# CHECK-LE: waitimpl                        # encoding: [0x7c,0x00,0x40,0x7c]
97*9880d681SAndroid Build Coastguard Worker            wait 2
98*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mbar 1                          # encoding: [0x7c,0x20,0x06,0xac]
99*9880d681SAndroid Build Coastguard Worker# CHECK-LE: mbar 1                          # encoding: [0xac,0x06,0x20,0x7c]
100*9880d681SAndroid Build Coastguard Worker            mbar 1
101*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mbar                            # encoding: [0x7c,0x00,0x06,0xac]
102*9880d681SAndroid Build Coastguard Worker            mbar
103*9880d681SAndroid Build Coastguard Worker
104*9880d681SAndroid Build Coastguard Worker# Extended mnemonics
105*9880d681SAndroid Build Coastguard Worker
106*9880d681SAndroid Build Coastguard Worker# CHECK-BE: dcbf 2, 3                       # encoding: [0x7c,0x02,0x18,0xac]
107*9880d681SAndroid Build Coastguard Worker# CHECK-LE: dcbf 2, 3                       # encoding: [0xac,0x18,0x02,0x7c]
108*9880d681SAndroid Build Coastguard Worker            dcbf 2, 3
109*9880d681SAndroid Build Coastguard Worker# FIXME:    dcbfl 2, 3
110*9880d681SAndroid Build Coastguard Worker
111*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lbarx 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x68]
112*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lbarx 2, 3, 4                   # encoding: [0x68,0x20,0x43,0x7c]
113*9880d681SAndroid Build Coastguard Worker            lbarx 2, 3, 4
114*9880d681SAndroid Build Coastguard Worker
115*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lharx 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0xe8]
116*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lharx 2, 3, 4                   # encoding: [0xe8,0x20,0x43,0x7c]
117*9880d681SAndroid Build Coastguard Worker            lharx 2, 3, 4
118*9880d681SAndroid Build Coastguard Worker
119*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lwarx 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x28]
120*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lwarx 2, 3, 4                   # encoding: [0x28,0x20,0x43,0x7c]
121*9880d681SAndroid Build Coastguard Worker            lwarx 2, 3, 4
122*9880d681SAndroid Build Coastguard Worker
123*9880d681SAndroid Build Coastguard Worker# CHECK-BE: ldarx 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0xa8]
124*9880d681SAndroid Build Coastguard Worker# CHECK-LE: ldarx 2, 3, 4                   # encoding: [0xa8,0x20,0x43,0x7c]
125*9880d681SAndroid Build Coastguard Worker            ldarx 2, 3, 4
126*9880d681SAndroid Build Coastguard Worker
127*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lbarx 2, 3, 4, 1                # encoding: [0x7c,0x43,0x20,0x69]
128*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lbarx 2, 3, 4, 1                # encoding: [0x69,0x20,0x43,0x7c]
129*9880d681SAndroid Build Coastguard Worker            lbarx 2, 3, 4, 1
130*9880d681SAndroid Build Coastguard Worker
131*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lharx 2, 3, 4, 1                # encoding: [0x7c,0x43,0x20,0xe9]
132*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lharx 2, 3, 4, 1                # encoding: [0xe9,0x20,0x43,0x7c]
133*9880d681SAndroid Build Coastguard Worker            lharx 2, 3, 4, 1
134*9880d681SAndroid Build Coastguard Worker
135*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lwarx 2, 3, 4, 1                # encoding: [0x7c,0x43,0x20,0x29]
136*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lwarx 2, 3, 4, 1                # encoding: [0x29,0x20,0x43,0x7c]
137*9880d681SAndroid Build Coastguard Worker            lwarx 2, 3, 4, 1
138*9880d681SAndroid Build Coastguard Worker
139*9880d681SAndroid Build Coastguard Worker# CHECK-BE: ldarx 2, 3, 4, 1                # encoding: [0x7c,0x43,0x20,0xa9]
140*9880d681SAndroid Build Coastguard Worker# CHECK-LE: ldarx 2, 3, 4, 1                # encoding: [0xa9,0x20,0x43,0x7c]
141*9880d681SAndroid Build Coastguard Worker            ldarx 2, 3, 4, 1
142*9880d681SAndroid Build Coastguard Worker
143*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lwat 2, 3, 28                   # encoding: [0x7c,0x43,0xe4,0x8c]
144*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lwat 2, 3, 28                   # encoding: [0x8c,0xe4,0x43,0x7c]
145*9880d681SAndroid Build Coastguard Worker            lwat 2, 3, 28
146*9880d681SAndroid Build Coastguard Worker
147*9880d681SAndroid Build Coastguard Worker# CHECK-BE: ldat 2, 3, 28                   # encoding: [0x7c,0x43,0xe4,0xcc]
148*9880d681SAndroid Build Coastguard Worker# CHECK-LE: ldat 2, 3, 28                   # encoding: [0xcc,0xe4,0x43,0x7c]
149*9880d681SAndroid Build Coastguard Worker            ldat 2, 3, 28
150*9880d681SAndroid Build Coastguard Worker
151*9880d681SAndroid Build Coastguard Worker# CHECK-BE: sync                            # encoding: [0x7c,0x00,0x04,0xac]
152*9880d681SAndroid Build Coastguard Worker# CHECK-LE: sync                            # encoding: [0xac,0x04,0x00,0x7c]
153*9880d681SAndroid Build Coastguard Worker            sync
154*9880d681SAndroid Build Coastguard Worker# CHECK-BE: sync                            # encoding: [0x7c,0x00,0x04,0xac]
155*9880d681SAndroid Build Coastguard Worker# CHECK-LE: sync                            # encoding: [0xac,0x04,0x00,0x7c]
156*9880d681SAndroid Build Coastguard Worker            msync
157*9880d681SAndroid Build Coastguard Worker# CHECK-BE: lwsync                          # encoding: [0x7c,0x20,0x04,0xac]
158*9880d681SAndroid Build Coastguard Worker# CHECK-LE: lwsync                          # encoding: [0xac,0x04,0x20,0x7c]
159*9880d681SAndroid Build Coastguard Worker            lwsync
160*9880d681SAndroid Build Coastguard Worker# CHECK-BE: ptesync                         # encoding: [0x7c,0x40,0x04,0xac]
161*9880d681SAndroid Build Coastguard Worker# CHECK-LE: ptesync                         # encoding: [0xac,0x04,0x40,0x7c]
162*9880d681SAndroid Build Coastguard Worker            ptesync
163*9880d681SAndroid Build Coastguard Worker
164*9880d681SAndroid Build Coastguard Worker# CHECK-BE: wait                            # encoding: [0x7c,0x00,0x00,0x7c]
165*9880d681SAndroid Build Coastguard Worker# CHECK-LE: wait                            # encoding: [0x7c,0x00,0x00,0x7c]
166*9880d681SAndroid Build Coastguard Worker            wait
167*9880d681SAndroid Build Coastguard Worker# CHECK-BE: waitrsv                         # encoding: [0x7c,0x20,0x00,0x7c]
168*9880d681SAndroid Build Coastguard Worker# CHECK-LE: waitrsv                         # encoding: [0x7c,0x00,0x20,0x7c]
169*9880d681SAndroid Build Coastguard Worker            waitrsv
170*9880d681SAndroid Build Coastguard Worker# CHECK-BE: waitimpl                        # encoding: [0x7c,0x40,0x00,0x7c]
171*9880d681SAndroid Build Coastguard Worker# CHECK-LE: waitimpl                        # encoding: [0x7c,0x00,0x40,0x7c]
172*9880d681SAndroid Build Coastguard Worker            waitimpl
173*9880d681SAndroid Build Coastguard Worker
174*9880d681SAndroid Build Coastguard Worker# Time base instructions
175*9880d681SAndroid Build Coastguard Worker
176*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mftb 2, 123                     # encoding: [0x7c,0x5b,0x1a,0xe6]
177*9880d681SAndroid Build Coastguard Worker# CHECK-LE: mftb 2, 123                     # encoding: [0xe6,0x1a,0x5b,0x7c]
178*9880d681SAndroid Build Coastguard Worker            mftb 2, 123
179*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mftb 2, 268                     # encoding: [0x7c,0x4c,0x42,0xe6]
180*9880d681SAndroid Build Coastguard Worker# CHECK-LE: mftb 2, 268                     # encoding: [0xe6,0x42,0x4c,0x7c]
181*9880d681SAndroid Build Coastguard Worker            mftb 2
182*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mftb 2, 268                     # encoding: [0x7c,0x4c,0x42,0xe6]
183*9880d681SAndroid Build Coastguard Worker# CHECK-LE: mftb 2, 268                     # encoding: [0xe6,0x42,0x4c,0x7c]
184*9880d681SAndroid Build Coastguard Worker            mftbl 2
185*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mftbu 2                         # encoding: [0x7c,0x4d,0x42,0xe6]
186*9880d681SAndroid Build Coastguard Worker# CHECK-LE: mftbu 2                         # encoding: [0xe6,0x42,0x4d,0x7c]
187*9880d681SAndroid Build Coastguard Worker            mftbu 2
188*9880d681SAndroid Build Coastguard Worker
189*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mttbl 3                         # encoding: [0x7c,0x7c,0x43,0xa6]
190*9880d681SAndroid Build Coastguard Worker# CHECK-LE: mttbl 3                         # encoding: [0xa6,0x43,0x7c,0x7c]
191*9880d681SAndroid Build Coastguard Worker            mttbl 3
192*9880d681SAndroid Build Coastguard Worker# CHECK-BE: mttbu 3                         # encoding: [0x7c,0x7d,0x43,0xa6]
193*9880d681SAndroid Build Coastguard Worker# CHECK-LE: mttbu 3                         # encoding: [0xa6,0x43,0x7d,0x7c]
194*9880d681SAndroid Build Coastguard Worker            mttbu 3
195