[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / test / MC / PowerPC / ppc64-operands.s
blob392b3b7893e4e3e46e34caf468a4554ec391c5e6
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 # Register operands
7 # CHECK-BE: add 1, 2, 3 # encoding: [0x7c,0x22,0x1a,0x14]
8 # CHECK-LE: add 1, 2, 3 # encoding: [0x14,0x1a,0x22,0x7c]
9 add 1, 2, 3
11 # CHECK-BE: add 1, 2, 3 # encoding: [0x7c,0x22,0x1a,0x14]
12 # CHECK-LE: add 1, 2, 3 # encoding: [0x14,0x1a,0x22,0x7c]
13 add %r1, %r2, %r3
15 # CHECK-BE: add 0, 0, 0 # encoding: [0x7c,0x00,0x02,0x14]
16 # CHECK-LE: add 0, 0, 0 # encoding: [0x14,0x02,0x00,0x7c]
17 add 0, 0, 0
19 # CHECK-BE: add 31, 31, 31 # encoding: [0x7f,0xff,0xfa,0x14]
20 # CHECK-LE: add 31, 31, 31 # encoding: [0x14,0xfa,0xff,0x7f]
21 add 31, 31, 31
23 # CHECK-BE: addi 1, 0, 0 # encoding: [0x38,0x20,0x00,0x00]
24 # CHECK-LE: addi 1, 0, 0 # encoding: [0x00,0x00,0x20,0x38]
25 addi 1, 0, 0
27 # CHECK-BE: addi 1, 0, 0 # encoding: [0x38,0x20,0x00,0x00]
28 # CHECK-LE: addi 1, 0, 0 # encoding: [0x00,0x00,0x20,0x38]
29 addi 1, %r0, 0
31 # Signed 16-bit immediate operands
33 # CHECK-BE: addi 1, 2, 0 # encoding: [0x38,0x22,0x00,0x00]
34 # CHECK-LE: addi 1, 2, 0 # encoding: [0x00,0x00,0x22,0x38]
35 addi 1, 2, 0
37 # CHECK-BE: addi 1, 0, -32768 # encoding: [0x38,0x20,0x80,0x00]
38 # CHECK-LE: addi 1, 0, -32768 # encoding: [0x00,0x80,0x20,0x38]
39 addi 1, 0, -32768
41 # CHECK-BE: addi 1, 0, 32767 # encoding: [0x38,0x20,0x7f,0xff]
42 # CHECK-LE: addi 1, 0, 32767 # encoding: [0xff,0x7f,0x20,0x38]
43 addi 1, 0, 32767
45 # Unsigned 16-bit immediate operands
47 # CHECK-BE: ori 1, 2, 0 # encoding: [0x60,0x41,0x00,0x00]
48 # CHECK-LE: ori 1, 2, 0 # encoding: [0x00,0x00,0x41,0x60]
49 ori 1, 2, 0
51 # CHECK-BE: ori 1, 2, 65535 # encoding: [0x60,0x41,0xff,0xff]
52 # CHECK-LE: ori 1, 2, 65535 # encoding: [0xff,0xff,0x41,0x60]
53 ori 1, 2, 65535
55 # Signed 16-bit immediate operands (extended range for addis)
57 # CHECK-BE: addis 1, 0, 0 # encoding: [0x3c,0x20,0x00,0x00]
58 # CHECK-LE: addis 1, 0, 0 # encoding: [0x00,0x00,0x20,0x3c]
59 addis 1, 0, -65536
61 # CHECK-BE: addis 1, 0, -1 # encoding: [0x3c,0x20,0xff,0xff]
62 # CHECK-LE: addis 1, 0, -1 # encoding: [0xff,0xff,0x20,0x3c]
63 addis 1, 0, 65535
65 # D-Form memory operands
67 # CHECK-BE: lwz 1, 0(0) # encoding: [0x80,0x20,0x00,0x00]
68 # CHECK-LE: lwz 1, 0(0) # encoding: [0x00,0x00,0x20,0x80]
69 lwz 1, 0(0)
71 # CHECK-BE: lwz 1, 0(0) # encoding: [0x80,0x20,0x00,0x00]
72 # CHECK-LE: lwz 1, 0(0) # encoding: [0x00,0x00,0x20,0x80]
73 lwz 1, 0(%r0)
75 # CHECK-BE: lwz 1, 0(31) # encoding: [0x80,0x3f,0x00,0x00]
76 # CHECK-LE: lwz 1, 0(31) # encoding: [0x00,0x00,0x3f,0x80]
77 lwz 1, 0(31)
79 # CHECK-BE: lwz 1, 0(31) # encoding: [0x80,0x3f,0x00,0x00]
80 # CHECK-LE: lwz 1, 0(31) # encoding: [0x00,0x00,0x3f,0x80]
81 lwz 1, 0(%r31)
83 # CHECK-BE: lwz 1, -32768(2) # encoding: [0x80,0x22,0x80,0x00]
84 # CHECK-LE: lwz 1, -32768(2) # encoding: [0x00,0x80,0x22,0x80]
85 lwz 1, -32768(2)
87 # CHECK-BE: lwz 1, 32767(2) # encoding: [0x80,0x22,0x7f,0xff]
88 # CHECK-LE: lwz 1, 32767(2) # encoding: [0xff,0x7f,0x22,0x80]
89 lwz 1, 32767(2)
92 # CHECK-BE: ld 1, 0(0) # encoding: [0xe8,0x20,0x00,0x00]
93 # CHECK-LE: ld 1, 0(0) # encoding: [0x00,0x00,0x20,0xe8]
94 ld 1, 0(0)
96 # CHECK-BE: ld 1, 0(0) # encoding: [0xe8,0x20,0x00,0x00]
97 # CHECK-LE: ld 1, 0(0) # encoding: [0x00,0x00,0x20,0xe8]
98 ld 1, 0(%r0)
100 # CHECK-BE: ld 1, 0(31) # encoding: [0xe8,0x3f,0x00,0x00]
101 # CHECK-LE: ld 1, 0(31) # encoding: [0x00,0x00,0x3f,0xe8]
102 ld 1, 0(31)
104 # CHECK-BE: ld 1, 0(31) # encoding: [0xe8,0x3f,0x00,0x00]
105 # CHECK-LE: ld 1, 0(31) # encoding: [0x00,0x00,0x3f,0xe8]
106 ld 1, 0(%r31)
108 # CHECK-BE: ld 1, -32768(2) # encoding: [0xe8,0x22,0x80,0x00]
109 # CHECK-LE: ld 1, -32768(2) # encoding: [0x00,0x80,0x22,0xe8]
110 ld 1, -32768(2)
112 # CHECK-BE: ld 1, 32764(2) # encoding: [0xe8,0x22,0x7f,0xfc]
113 # CHECK-LE: ld 1, 32764(2) # encoding: [0xfc,0x7f,0x22,0xe8]
114 ld 1, 32764(2)
116 # CHECK-BE: ld 1, 4(2) # encoding: [0xe8,0x22,0x00,0x04]
117 # CHECK-LE: ld 1, 4(2) # encoding: [0x04,0x00,0x22,0xe8]
118 ld 1, 4(2)
120 # CHECK-BE: ld 1, -4(2) # encoding: [0xe8,0x22,0xff,0xfc]
121 # CHECK-LE: ld 1, -4(2) # encoding: [0xfc,0xff,0x22,0xe8]
122 ld 1, -4(2)
125 # Immediate branch operands
127 # CHECK-BE: b .+1024 # encoding: [0x48,0x00,0x04,0x00]
128 # CHECK-LE: b .+1024 # encoding: [0x00,0x04,0x00,0x48]
129 b 1024
131 # CHECK-BE: ba 1024 # encoding: [0x48,0x00,0x04,0x02]
132 # CHECK-LE: ba 1024 # encoding: [0x02,0x04,0x00,0x48]
133 ba 1024
135 # CHECK-BE: beq 0, .+1024 # encoding: [0x41,0x82,0x04,0x00]
136 # CHECK-LE: beq 0, .+1024 # encoding: [0x00,0x04,0x82,0x41]
137 beq 1024
139 # CHECK-BE: beqa 0, 1024 # encoding: [0x41,0x82,0x04,0x02]
140 # CHECK-LE: beqa 0, 1024 # encoding: [0x02,0x04,0x82,0x41]
141 beqa 1024
143 # CHECK-BE: # encoding: [0x42,0x9f,A,0bAAAAAA01]
144 # CHECK-LE: # encoding: [0bAAAAAA01,A,0x9f,0x42]
145 bcl 20, 31, $+4
147 # CHECK-BE: # encoding: [0x42,0x00,A,0bAAAAAA00]
148 # CHECK-LE: # encoding: [0bAAAAAA00,A,0x00,0x42]
149 bdnz $-8
151 # CHECK-BE: andi. 0, 3, 32767 # encoding: [0x70,0x60,0x7f,0xff]
152 # CHECK-LE: andi. 0, 3, 32767 # encoding: [0xff,0x7f,0x60,0x70]
153 andi. %r0,%r3,~0x8000@l
155 # CHECK-BE: andi. 0, 3, 0 # encoding: [0x70,0x60,0x00,0x00]
156 # CHECK-LE: andi. 0, 3, 0 # encoding: [0x00,0x00,0x60,0x70]
157 andi. %r0,%r3,!0x8000@l