Skip to content

Commit 777b95d

Browse files
committed
[AVR] Redefine the 'SBR' instruction as an alias
This fixes a TableGen warning about duplicate bit patterns. SBR === This is an alias of 'ORI Rd, K'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341277 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent dfd17d0 commit 777b95d

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

lib/Target/AVR/AVRInstrInfo.td

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,14 @@ Defs = [SREG] in
732732
// This operation is identical to a `Rd AND Rd`.
733733
def : InstAlias<"tst\t$rd", (ANDRdRr GPR8:$rd, GPR8:$rd)>;
734734

735+
// SBR Rd, K
736+
//
737+
// Mnemonic alias to 'ORI Rd, K'. Same bit pattern, same operands,
738+
// same everything.
739+
def : InstAlias<"sbr\t$rd, $k",
740+
(ORIRdK LD8:$rd, imm_ldi8:$k),
741+
/* Disable display, so we don't override ORI */ 0>;
742+
735743
//===----------------------------------------------------------------------===//
736744
// Jump instructions
737745
//===----------------------------------------------------------------------===//
@@ -1730,15 +1738,6 @@ def BLD : FRdB<0b00,
17301738
let Constraints = "$src = $rd",
17311739
Defs = [SREG] in
17321740
{
1733-
// SBR Rd, K
1734-
// Alias for ORI Rd, K
1735-
def SBRRdK : FRdK<0b0110,
1736-
(outs LD8:$rd),
1737-
(ins LD8:$src, imm_ldi8:$k),
1738-
"sbr\t$rd, $k",
1739-
[(set i8:$rd, (or i8:$src, imm:$k)),
1740-
(implicit SREG)]>;
1741-
17421741
// CBR Rd, K
17431742
// Alias for `ANDI Rd, COM(K)` where COM(K) is the complement of K.
17441743
// FIXME: This uses the 'complement' encoder. We need it to also use the

test/MC/AVR/inst-sbr.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ foo:
99

1010
sbr r19, _start
1111

12-
; CHECK: sbr r17, 208 ; encoding: [0x10,0x6d]
13-
; CHECK: sbr r24, 190 ; encoding: [0x8e,0x6b]
14-
; CHECK: sbr r20, 173 ; encoding: [0x4d,0x6a]
15-
; CHECK: sbr r31, 0 ; encoding: [0xf0,0x60]
12+
; CHECK: ori r17, 208 ; encoding: [0x10,0x6d]
13+
; CHECK: ori r24, 190 ; encoding: [0x8e,0x6b]
14+
; CHECK: ori r20, 173 ; encoding: [0x4d,0x6a]
15+
; CHECK: ori r31, 0 ; encoding: [0xf0,0x60]
1616

17-
; CHECK: sbr r19, _start ; encoding: [0x30'A',0x60]
17+
; CHECK: ori r19, _start ; encoding: [0x30'A',0x60]
1818
; CHECK: ; fixup A - offset: 0, value: _start, kind: fixup_ldi

0 commit comments

Comments
 (0)