138 lines · plain
1// RUN: llvm-mc -triple=aarch64 < %s | FileCheck %s --check-prefixes=CHECK,ALIAS2// RUN: llvm-mc -triple=aarch64 -M no-aliases < %s | FileCheck %s --check-prefixes=CHECK,NOALIAS3// RUN: not llvm-mc -mattr=+no-neg-immediates -triple=aarch64-none-linux-gnu < %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-NEG-IMM4 5/// +all does not imply +no-neg-immediates.6// RUN: llvm-mc -triple=aarch64 -mattr=+all -M no-aliases %s | FileCheck %s --check-prefixes=CHECK,NOALIAS7 8 add w0, w2, #40969 sub w0, w2, #409610// CHECK: add w0, w2, #1, lsl #1211// CHECK: sub w0, w2, #1, lsl #1212 13 add w0, w2, #-409614 sub w0, w2, #-409615// CHECK: sub w0, w2, #1, lsl #1216// CHECK: add w0, w2, #1, lsl #1217 18// CHECK: sub w0, w2, #2, lsl #1219// CHECK: sub w0, w2, #2, lsl #1220// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates21 sub w0, w2, #2, lsl 1222 add w0, w2, #-2, lsl 1223// CHECK: sub x1, x3, #2, lsl #1224// CHECK: sub x1, x3, #2, lsl #1225// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates26 sub x1, x3, #2, lsl 1227 add x1, x3, #-2, lsl 1228// CHECK: sub x1, x3, #429// CHECK: sub x1, x3, #430// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates31 sub x1, x3, #432 add x1, x3, #-433// CHECK: sub x1, x3, #409534// CHECK: sub x1, x3, #409535// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates36 sub x1, x3, #4095, lsl 037 add x1, x3, #-4095, lsl 038// CHECK: sub x3, x4, #039 sub x3, x4, #040 41// CHECK: add w0, w2, #2, lsl #1242// CHECK: add w0, w2, #2, lsl #1243// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates44 add w0, w2, #2, lsl 1245 sub w0, w2, #-2, lsl 1246// CHECK: add x1, x3, #2, lsl #1247// CHECK: add x1, x3, #2, lsl #1248// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates49 add x1, x3, #2, lsl 1250 sub x1, x3, #-2, lsl 1251// CHECK: add x1, x3, #452// CHECK: add x1, x3, #453// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates54 add x1, x3, #455 sub x1, x3, #-456// CHECK: add x1, x3, #409557// CHECK: add x1, x3, #409558// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates59 add x1, x3, #4095, lsl 060 sub x1, x3, #-4095, lsl 061// CHECK: add x2, x5, #062 add x2, x5, #063 64// CHECK: subs w0, w2, #2, lsl #1265// CHECK: subs w0, w2, #2, lsl #1266// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates67 subs w0, w2, #2, lsl 1268 adds w0, w2, #-2, lsl 1269// CHECK: subs x1, x3, #2, lsl #1270// CHECK: subs x1, x3, #2, lsl #1271// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates72 subs x1, x3, #2, lsl 1273 adds x1, x3, #-2, lsl 1274// CHECK: subs x1, x3, #475// CHECK: subs x1, x3, #476// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates77 subs x1, x3, #478 adds x1, x3, #-479// CHECK: subs x1, x3, #409580// CHECK: subs x1, x3, #409581// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates82 subs x1, x3, #4095, lsl 083 adds x1, x3, #-4095, lsl 084// CHECK: subs x3, x4, #085 subs x3, x4, #086 87// CHECK: adds w0, w2, #2, lsl #1288// CHECK: adds w0, w2, #2, lsl #1289// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates90 adds w0, w2, #2, lsl 1291 subs w0, w2, #-2, lsl 1292// CHECK: adds x1, x3, #2, lsl #1293// CHECK: adds x1, x3, #2, lsl #1294// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates95 adds x1, x3, #2, lsl 1296 subs x1, x3, #-2, lsl 1297// CHECK: adds x1, x3, #498// CHECK: adds x1, x3, #499// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates100 adds x1, x3, #4101 subs x1, x3, #-4102// CHECK: adds x1, x3, #4095103// CHECK: adds x1, x3, #4095104// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates105 adds x1, x3, #4095, lsl 0106 subs x1, x3, #-4095, lsl 0107// CHECK: adds x2, x5, #0108 adds x2, x5, #0109 110// ALIAS: cmn x5, #5111// ALIAS: cmn x5, #5112// NOALIAS: adds xzr, x5, #5113// NOALIAS: adds xzr, x5, #5114// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates115 cmn x5, #5116 cmp x5, #-5117// ALIAS: cmp x6, #4095118// ALIAS: cmp x6, #4095119// NOALIAS: subs xzr, x6, #4095120// NOALIAS: subs xzr, x6, #4095121// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates122 cmp x6, #4095123 cmn x6, #-4095124// ALIAS: cmn w7, #5125// ALIAS: cmn w7, #5126// NOALIAS: adds wzr, w7, #5127// NOALIAS: adds wzr, w7, #5128// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates129 cmn w7, #5130 cmp w7, #-5131// ALIAS: cmp w8, #4095132// ALIAS: cmp w8, #4095133// NOALIAS: subs wzr, w8, #4095134// NOALIAS: subs wzr, w8, #4095135// CHECK-NO-NEG-IMM: instruction requires: NegativeImmediates136 cmp w8, #4095137 cmn w8, #-4095138