[ARM] Better OR's for MVE compares
[llvm-core.git] / test / MC / ELF / relax-arith2.s
blob19dacbf64ef26a9a78a50be110896e01f104beae
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-objdump -d - | FileCheck %s
3 // Test that we avoid relaxing these instructions and instead generate versions
4 // that use 8-bit immediate values.
6 bar:
7 // CHECK: Disassembly of section imul:
8 // CHECK-EMPTY:
9 // CHECK-NEXT: imul:
10 // CHECK-NEXT: 0: 66 6b db 80 imulw $-128, %bx, %bx
11 // CHECK-NEXT: 4: 66 6b 1c 25 00 00 00 00 7f imulw $127, 0, %bx
12 // CHECK-NEXT: d: 6b db 00 imull $0, %ebx, %ebx
13 // CHECK-NEXT: 10: 6b 1c 25 00 00 00 00 01 imull $1, 0, %ebx
14 // CHECK-NEXT: 18: 48 6b db ff imulq $-1, %rbx, %rbx
15 // CHECK-NEXT: 1c: 48 6b 1c 25 00 00 00 00 2a imulq $42, 0, %rbx
16 .section imul,"x"
17 imul $-128, %bx, %bx
18 imul $127, bar, %bx
19 imul $0, %ebx, %ebx
20 imul $1, bar, %ebx
21 imul $-1, %rbx, %rbx
22 imul $42, bar, %rbx
25 // CHECK: Disassembly of section and:
26 // CHECK-EMPTY:
27 // CHECK-NEXT: and:
28 // CHECK-NEXT: 0: 66 83 e3 7f andw $127, %bx
29 // CHECK-NEXT: 4: 66 83 24 25 00 00 00 00 00 andw $0, 0
30 // CHECK-NEXT: d: 83 e3 01 andl $1, %ebx
31 // CHECK-NEXT: 10: 83 24 25 00 00 00 00 ff andl $-1, 0
32 // CHECK-NEXT: 18: 48 83 e3 2a andq $42, %rbx
33 // CHECK-NEXT: 1c: 48 83 24 25 00 00 00 00 80 andq $-128, 0
34 .section and,"x"
35 and $127, %bx
36 andw $0, bar
37 and $1, %ebx
38 andl $-1, bar
39 and $42, %rbx
40 andq $-128, bar
42 // CHECK: Disassembly of section or:
43 // CHECK-EMPTY:
44 // CHECK-NEXT: or:
45 // CHECK-NEXT: 0: 66 83 cb 00 orw $0, %bx
46 // CHECK-NEXT: 4: 66 83 0c 25 00 00 00 00 01 orw $1, 0
47 // CHECK-NEXT: d: 83 cb ff orl $-1, %ebx
48 // CHECK-NEXT: 10: 83 0c 25 00 00 00 00 2a orl $42, 0
49 // CHECK-NEXT: 18: 48 83 cb 80 orq $-128, %rbx
50 // CHECK-NEXT: 1c: 48 83 0c 25 00 00 00 00 7f orq $127, 0
51 .section or,"x"
52 or $0, %bx
53 orw $1, bar
54 or $-1, %ebx
55 orl $42, bar
56 or $-128, %rbx
57 orq $127, bar
59 // CHECK: Disassembly of section xor:
60 // CHECK-EMPTY:
61 // CHECK-NEXT: xor:
62 // CHECK-NEXT: 0: 66 83 f3 01 xorw $1, %bx
63 // CHECK-NEXT: 4: 66 83 34 25 00 00 00 00 ff xorw $-1, 0
64 // CHECK-NEXT: d: 83 f3 2a xorl $42, %ebx
65 // CHECK-NEXT: 10: 83 34 25 00 00 00 00 80 xorl $-128, 0
66 // CHECK-NEXT: 18: 48 83 f3 7f xorq $127, %rbx
67 // CHECK-NEXT: 1c: 48 83 34 25 00 00 00 00 00 xorq $0, 0
68 .section xor,"x"
69 xor $1, %bx
70 xorw $-1, bar
71 xor $42, %ebx
72 xorl $-128, bar
73 xor $127, %rbx
74 xorq $0, bar
76 // CHECK: Disassembly of section add:
77 // CHECK-EMPTY:
78 // CHECK-NEXT: add:
79 // CHECK-NEXT: 0: 66 83 c3 ff addw $-1, %bx
80 // CHECK-NEXT: 4: 66 83 04 25 00 00 00 00 2a addw $42, 0
81 // CHECK-NEXT: d: 83 c3 80 addl $-128, %ebx
82 // CHECK-NEXT: 10: 83 04 25 00 00 00 00 7f addl $127, 0
83 // CHECK-NEXT: 18: 48 83 c3 00 addq $0, %rbx
84 // CHECK-NEXT: 1c: 48 83 04 25 00 00 00 00 01 addq $1, 0
85 .section add,"x"
86 add $-1, %bx
87 addw $42, bar
88 add $-128, %ebx
89 addl $127, bar
90 add $0, %rbx
91 addq $1, bar
93 // CHECK: Disassembly of section sub:
94 // CHECK-EMPTY:
95 // CHECK-NEXT: sub:
96 // CHECK-NEXT: 0: 66 83 eb 2a subw $42, %bx
97 // CHECK-NEXT: 4: 66 83 2c 25 00 00 00 00 80 subw $-128, 0
98 // CHECK-NEXT: d: 83 eb 7f subl $127, %ebx
99 // CHECK-NEXT: 10: 83 2c 25 00 00 00 00 00 subl $0, 0
100 // CHECK-NEXT: 18: 48 83 eb 01 subq $1, %rbx
101 // CHECK-NEXT: 1c: 48 83 2c 25 00 00 00 00 ff subq $-1, 0
102 .section sub,"x"
103 sub $42, %bx
104 subw $-128, bar
105 sub $127, %ebx
106 subl $0, bar
107 sub $1, %rbx
108 subq $-1, bar
110 // CHECK: Disassembly of section cmp:
111 // CHECK-EMPTY:
112 // CHECK-NEXT: cmp:
113 // CHECK-NEXT: 0: 66 83 fb 80 cmpw $-128, %bx
114 // CHECK-NEXT: 4: 66 83 3c 25 00 00 00 00 7f cmpw $127, 0
115 // CHECK-NEXT: d: 83 fb 00 cmpl $0, %ebx
116 // CHECK-NEXT: 10: 83 3c 25 00 00 00 00 01 cmpl $1, 0
117 // CHECK-NEXT: 18: 48 83 fb ff cmpq $-1, %rbx
118 // CHECK-NEXT: 1c: 48 83 3c 25 00 00 00 00 2a cmpq $42, 0
119 .section cmp,"x"
120 cmp $-128, %bx
121 cmpw $127, bar
122 cmp $0, %ebx
123 cmpl $1, bar
124 cmp $-1, %rbx
125 cmpq $42, bar
127 // CHECK: Disassembly of section push:
128 // CHECK-EMPTY:
129 // CHECK-NEXT: push:
130 // CHECK-NEXT: 0: 66 6a 80 pushw $-128
131 // CHECK-NEXT: 3: 66 6a 7f pushw $127
132 // CHECK-NEXT: 6: 6a 80 pushq $-128
133 // CHECK-NEXT: 8: 6a 7f pushq $127
134 .section push,"x"
135 pushw $-128
136 pushw $127
137 push $-128
138 push $127