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