[ARM] Better OR's for MVE compares
[llvm-core.git] / test / MC / ELF / relax-arith.s
blob1591a77f22d0d4a48a06d3cc832c09027e51cca0
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-objdump -d - | FileCheck %s
3 // Test that we correctly relax these instructions into versions that use
4 // 16 or 32 bit immediate values.
6 bar:
7 // CHECK: Disassembly of section imul:
8 // CHECK-EMPTY:
9 // CHECK-NEXT: imul:
10 // CHECK-NEXT: 0: 66 69 db 00 00 imulw $0, %bx, %bx
11 // CHECK-NEXT: 5: 66 69 1c 25 00 00 00 00 00 00 imulw $0, 0, %bx
12 // CHECK-NEXT: f: 69 db 00 00 00 00 imull $0, %ebx, %ebx
13 // CHECK-NEXT: 15: 69 1c 25 00 00 00 00 00 00 00 00 imull $0, 0, %ebx
14 // CHECK-NEXT: 20: 48 69 db 00 00 00 00 imulq $0, %rbx, %rbx
15 // CHECK-NEXT: 27: 48 69 1c 25 00 00 00 00 00 00 00 00 imulq $0, 0, %rbx
16 .section imul,"x"
17 imul $foo, %bx, %bx
18 imul $foo, bar, %bx
19 imul $foo, %ebx, %ebx
20 imul $foo, bar, %ebx
21 imul $foo, %rbx, %rbx
22 imul $foo, bar, %rbx
24 // CHECK: Disassembly of section and:
25 // CHECK-EMPTY:
26 // CHECK-NEXT: and:
27 // CHECK-NEXT: 0: 66 81 e3 00 00 andw $0, %bx
28 // CHECK-NEXT: 5: 66 81 24 25 00 00 00 00 00 00 andw $0, 0
29 // CHECK-NEXT: f: 81 e3 00 00 00 00 andl $0, %ebx
30 // CHECK-NEXT: 15: 81 24 25 00 00 00 00 00 00 00 00 andl $0, 0
31 // CHECK-NEXT: 20: 48 81 e3 00 00 00 00 andq $0, %rbx
32 // CHECK-NEXT: 27: 48 81 24 25 00 00 00 00 00 00 00 00 andq $0, 0
33 .section and,"x"
34 and $foo, %bx
35 andw $foo, bar
36 and $foo, %ebx
37 andl $foo, bar
38 and $foo, %rbx
39 andq $foo, bar
41 // CHECK: Disassembly of section or:
42 // CHECK-EMPTY:
43 // CHECK-NEXT: or:
44 // CHECK-NEXT: 0: 66 81 cb 00 00 orw $0, %bx
45 // CHECK-NEXT: 5: 66 81 0c 25 00 00 00 00 00 00 orw $0, 0
46 // CHECK-NEXT: f: 81 cb 00 00 00 00 orl $0, %ebx
47 // CHECK-NEXT: 15: 81 0c 25 00 00 00 00 00 00 00 00 orl $0, 0
48 // CHECK-NEXT: 20: 48 81 cb 00 00 00 00 orq $0, %rbx
49 // CHECK-NEXT: 27: 48 81 0c 25 00 00 00 00 00 00 00 00 orq $0, 0
50 .section or,"x"
51 or $foo, %bx
52 orw $foo, bar
53 or $foo, %ebx
54 orl $foo, bar
55 or $foo, %rbx
56 orq $foo, bar
58 // CHECK: Disassembly of section xor:
59 // CHECK-EMPTY:
60 // CHECK-NEXT: xor:
61 // CHECK-NEXT: 0: 66 81 f3 00 00 xorw $0, %bx
62 // CHECK-NEXT: 5: 66 81 34 25 00 00 00 00 00 00 xorw $0, 0
63 // CHECK-NEXT: f: 81 f3 00 00 00 00 xorl $0, %ebx
64 // CHECK-NEXT: 15: 81 34 25 00 00 00 00 00 00 00 00 xorl $0, 0
65 // CHECK-NEXT: 20: 48 81 f3 00 00 00 00 xorq $0, %rbx
66 // CHECK-NEXT: 27: 48 81 34 25 00 00 00 00 00 00 00 00 xorq $0, 0
67 .section xor,"x"
68 xor $foo, %bx
69 xorw $foo, bar
70 xor $foo, %ebx
71 xorl $foo, bar
72 xor $foo, %rbx
73 xorq $foo, bar
75 // CHECK: Disassembly of section add:
76 // CHECK-EMPTY:
77 // CHECK-NEXT: add:
78 // CHECK-NEXT: 0: 66 81 c3 00 00 addw $0, %bx
79 // CHECK-NEXT: 5: 66 81 04 25 00 00 00 00 00 00 addw $0, 0
80 // CHECK-NEXT: f: 81 c3 00 00 00 00 addl $0, %ebx
81 // CHECK-NEXT: 15: 81 04 25 00 00 00 00 00 00 00 00 addl $0, 0
82 // CHECK-NEXT: 20: 48 81 c3 00 00 00 00 addq $0, %rbx
83 // CHECK-NEXT: 27: 48 81 04 25 00 00 00 00 00 00 00 00 addq $0, 0
84 .section add,"x"
85 add $foo, %bx
86 addw $foo, bar
87 add $foo, %ebx
88 addl $foo, bar
89 add $foo, %rbx
90 addq $foo, bar
92 // CHECK: Disassembly of section sub:
93 // CHECK-EMPTY:
94 // CHECK-NEXT: sub:
95 // CHECK-NEXT: 0: 66 81 eb 00 00 subw $0, %bx
96 // CHECK-NEXT: 5: 66 81 2c 25 00 00 00 00 00 00 subw $0, 0
97 // CHECK-NEXT: f: 81 eb 00 00 00 00 subl $0, %ebx
98 // CHECK-NEXT: 15: 81 2c 25 00 00 00 00 00 00 00 00 subl $0, 0
99 // CHECK-NEXT: 20: 48 81 eb 00 00 00 00 subq $0, %rbx
100 // CHECK-NEXT: 27: 48 81 2c 25 00 00 00 00 00 00 00 00 subq $0, 0
101 .section sub,"x"
102 sub $foo, %bx
103 subw $foo, bar
104 sub $foo, %ebx
105 subl $foo, bar
106 sub $foo, %rbx
107 subq $foo, bar
109 // CHECK: Disassembly of section cmp:
110 // CHECK-EMPTY:
111 // CHECK-NEXT: cmp:
112 // CHECK-NEXT: 0: 66 81 fb 00 00 cmpw $0, %bx
113 // CHECK-NEXT: 5: 66 81 3c 25 00 00 00 00 00 00 cmpw $0, 0
114 // CHECK-NEXT: f: 81 fb 00 00 00 00 cmpl $0, %ebx
115 // CHECK-NEXT: 15: 81 3c 25 00 00 00 00 00 00 00 00 cmpl $0, 0
116 // CHECK-NEXT: 20: 48 81 fb 00 00 00 00 cmpq $0, %rbx
117 // CHECK-NEXT: 27: 48 81 3c 25 00 00 00 00 00 00 00 00 cmpq $0, 0
118 .section cmp,"x"
119 cmp $foo, %bx
120 cmpw $foo, bar
121 cmp $foo, %ebx
122 cmpl $foo, bar
123 cmp $foo, %rbx
124 cmpq $foo, bar
126 // CHECK: Disassembly of section push:
127 // CHECK-EMPTY:
128 // CHECK-NEXT: push:
129 // CHECK-NEXT: 0: 66 68 00 00 pushw $0
130 // CHECK-NEXT: 4: 68 00 00 00 00 pushq $0
131 .section push,"x"
132 pushw $foo
133 push $foo
135 // CHECK: Disassembly of section adc:
136 // CHECK-EMPTY:
137 // CHECK-NEXT: adc:
138 // CHECK-NEXT: 0: 66 81 d3 00 00 adcw $0, %bx
139 // CHECK-NEXT: 5: 66 81 14 25 00 00 00 00 00 00 adcw $0, 0
140 // CHECK-NEXT: f: 81 d3 00 00 00 00 adcl $0, %ebx
141 // CHECK-NEXT: 15: 81 14 25 00 00 00 00 00 00 00 00 adcl $0, 0
142 // CHECK-NEXT: 20: 48 81 d3 00 00 00 00 adcq $0, %rbx
143 // CHECK-NEXT: 27: 48 81 14 25 00 00 00 00 00 00 00 00 adcq $0, 0
144 .section adc,"x"
145 adc $foo, %bx
146 adcw $foo, bar
147 adc $foo, %ebx
148 adcl $foo, bar
149 adc $foo, %rbx
150 adcq $foo, bar
152 // CHECK: Disassembly of section sbb:
153 // CHECK-EMPTY:
154 // CHECK-NEXT: sbb:
155 // CHECK-NEXT: 0: 66 81 db 00 00 sbbw $0, %bx
156 // CHECK-NEXT: 5: 66 81 1c 25 00 00 00 00 00 00 sbbw $0, 0
157 // CHECK-NEXT: f: 81 db 00 00 00 00 sbbl $0, %ebx
158 // CHECK-NEXT: 15: 81 1c 25 00 00 00 00 00 00 00 00 sbbl $0, 0
159 // CHECK-NEXT: 20: 48 81 db 00 00 00 00 sbbq $0, %rbx
160 // CHECK-NEXT: 27: 48 81 1c 25 00 00 00 00 00 00 00 00 sbbq $0, 0
161 .section sbb,"x"
162 sbb $foo, %bx
163 sbbw $foo, bar
164 sbb $foo, %ebx
165 sbbl $foo, bar
166 sbb $foo, %rbx
167 sbbq $foo, bar