llvm.org GIT mirror llvm / 7b8defd
[ARM] Don't be overzealous converting Thumb1 3 to 2 operands Differential Revision: http://reviews.llvm.org/D11056 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241801 91177308-0d34-0410-b5e6-96231b3b80d8 Scott Douglass 5 years ago
2 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
55115511 if (((Mnemonic == "add" && CarrySetting) || Mnemonic == "sub") &&
55125512 Op5.isReg())
55135513 Transform = false;
5514
5515 // Don't transform 'add/sub{s} Rd, Rd, #imm' if the immediate fits into
5516 // 3-bits because the ARMARM says not to.
5517 if ((Mnemonic == "add" || Mnemonic == "sub") && Op5.isImm0_7())
5518 Transform = false;
55145519 }
55155520
55165521 if (Transform)
0 @ RUN: llvm-mc -triple thumbv6m -show-encoding < %s | FileCheck %s
1
2 adds r1, r1, #3
3 @ CHECK: adds r1, r1, #3 @ encoding: [0xc9,0x1c]
4
5 adds r1, #3
6 @ CHECK: adds r1, #3 @ encoding: [0x03,0x31]
17
28 adds r0, r0, #8
39 @ CHECK: adds r0, #8 @ encoding: [0x08,0x30]
3238
3339 subs r0, r0, r0
3440 @ CHECK: subs r0, r0, r0 @ encoding: [0x00,0x1a]
41
42 subs r3, r3, #5
43 @ CHECK: subs r3, r3, #5 @ encoding: [0x5b,0x1f]
44
45 subs r3, #5
46 @ CHECK: subs r3, #5 @ encoding: [0x05,0x3b]
3547
3648 subs r2, r2, #8
3749 @ CHECK: subs r2, #8 @ encoding: [0x08,0x3a]