[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULT/SETUGT
[llvm-core.git] / test / MC / AArch64 / alias-addsubimm.s
blob5c1c4799828cab95738a306573a51f3ad1756437
1 // RUN: llvm-mc -triple=aarch64-none-linux-gnu < %s | FileCheck %s
2 // RUN: not llvm-mc -mattr=+no-neg-immediates -triple=aarch64-none-linux-gnu < %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-NEG-IMM
4 // CHECK: sub w0, w2, #2, lsl #12
5 // CHECK: sub w0, w2, #2, lsl #12
6 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
7 sub w0, w2, #2, lsl 12
8 add w0, w2, #-2, lsl 12
9 // CHECK: sub x1, x3, #2, lsl #12
10 // CHECK: sub x1, x3, #2, lsl #12
11 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
12 sub x1, x3, #2, lsl 12
13 add x1, x3, #-2, lsl 12
14 // CHECK: sub x1, x3, #4
15 // CHECK: sub x1, x3, #4
16 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
17 sub x1, x3, #4
18 add x1, x3, #-4
19 // CHECK: sub x1, x3, #4095
20 // CHECK: sub x1, x3, #4095
21 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
22 sub x1, x3, #4095, lsl 0
23 add x1, x3, #-4095, lsl 0
24 // CHECK: sub x3, x4, #0
25 sub x3, x4, #0
27 // CHECK: add w0, w2, #2, lsl #12
28 // CHECK: add w0, w2, #2, lsl #12
29 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
30 add w0, w2, #2, lsl 12
31 sub w0, w2, #-2, lsl 12
32 // CHECK: add x1, x3, #2, lsl #12
33 // CHECK: add x1, x3, #2, lsl #12
34 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
35 add x1, x3, #2, lsl 12
36 sub x1, x3, #-2, lsl 12
37 // CHECK: add x1, x3, #4
38 // CHECK: add x1, x3, #4
39 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
40 add x1, x3, #4
41 sub x1, x3, #-4
42 // CHECK: add x1, x3, #4095
43 // CHECK: add x1, x3, #4095
44 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
45 add x1, x3, #4095, lsl 0
46 sub x1, x3, #-4095, lsl 0
47 // CHECK: add x2, x5, #0
48 add x2, x5, #0
50 // CHECK: subs w0, w2, #2, lsl #12
51 // CHECK: subs w0, w2, #2, lsl #12
52 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
53 subs w0, w2, #2, lsl 12
54 adds w0, w2, #-2, lsl 12
55 // CHECK: subs x1, x3, #2, lsl #12
56 // CHECK: subs x1, x3, #2, lsl #12
57 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
58 subs x1, x3, #2, lsl 12
59 adds x1, x3, #-2, lsl 12
60 // CHECK: subs x1, x3, #4
61 // CHECK: subs x1, x3, #4
62 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
63 subs x1, x3, #4
64 adds x1, x3, #-4
65 // CHECK: subs x1, x3, #4095
66 // CHECK: subs x1, x3, #4095
67 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
68 subs x1, x3, #4095, lsl 0
69 adds x1, x3, #-4095, lsl 0
70 // CHECK: subs x3, x4, #0
71 subs x3, x4, #0
73 // CHECK: adds w0, w2, #2, lsl #12
74 // CHECK: adds w0, w2, #2, lsl #12
75 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
76 adds w0, w2, #2, lsl 12
77 subs w0, w2, #-2, lsl 12
78 // CHECK: adds x1, x3, #2, lsl #12
79 // CHECK: adds x1, x3, #2, lsl #12
80 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
81 adds x1, x3, #2, lsl 12
82 subs x1, x3, #-2, lsl 12
83 // CHECK: adds x1, x3, #4
84 // CHECK: adds x1, x3, #4
85 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
86 adds x1, x3, #4
87 subs x1, x3, #-4
88 // CHECK: adds x1, x3, #4095
89 // CHECK: adds x1, x3, #4095
90 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
91 adds x1, x3, #4095, lsl 0
92 subs x1, x3, #-4095, lsl 0
93 // CHECK: adds x2, x5, #0
94 adds x2, x5, #0
96 // CHECK: {{adds xzr,|cmn}} x5, #5
97 // CHECK: {{adds xzr,|cmn}} x5, #5
98 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
99 cmn x5, #5
100 cmp x5, #-5
101 // CHECK: {{subs xzr,|cmp}} x6, #4095
102 // CHECK: {{subs xzr,|cmp}} x6, #4095
103 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
104 cmp x6, #4095
105 cmn x6, #-4095
106 // CHECK: {{adds wzr,|cmn}} w7, #5
107 // CHECK: {{adds wzr,|cmn}} w7, #5
108 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
109 cmn w7, #5
110 cmp w7, #-5
111 // CHECK: {{subs wzr,|cmp}} w8, #4095
112 // CHECK: {{subs wzr,|cmp}} w8, #4095
113 // CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates
114 cmp w8, #4095
115 cmn w8, #-4095