Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit e8b41f4

Browse files
committed
[AVR] Fix #84 movw instruction
1 parent 732c621 commit e8b41f4

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lib/Target/AVR/AVRInstrFormats.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ class FMOVWRdRr<dag outs, dag ins, string asmstr, list<dag> pattern>
292292
bits<5> r;
293293

294294
let Inst{15-8} = 0b00000001;
295-
let Inst{7-4} = d{3-0};
296-
let Inst{3-0} = r{3-0};
295+
let Inst{7-4} = d{4-1};
296+
let Inst{3-0} = r{4-1};
297297
}
298298

299299
//===----------------------------------------------------------------------===//

test/MC/AVR/inst-movw.s

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
; RUN: llvm-mc -triple avr-none -mattr=movw -show-encoding < %s | FileCheck %s
2-
; XFAIL: *
32

43

54
foo:
@@ -9,7 +8,7 @@ foo:
98
movw r20, r22
109
movw r8, r12
1110

12-
; CHECK: movw r10, r8 ; encoding: [0x54,0x01]
13-
; CHECK: movw r12, r16 ; encoding: [0x68,0x01]
14-
; CHECK: movw r20, r22 ; encoding: [0xab,0x01]
15-
; CHECK: movw r8, r12 ; encoding: [0x46,0x01]
11+
; CHECK: movw r11:r10, r9:r8 ; encoding: [0x54,0x01]
12+
; CHECK: movw r13:r12, r17:r16 ; encoding: [0x68,0x01]
13+
; CHECK: movw r21:r20, r23:r22 ; encoding: [0xab,0x01]
14+
; CHECK: movw r9:r8, r13:r12 ; encoding: [0x46,0x01]

test/MC/AVR/inst-st.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ foo:
6363

6464
; Predecrement
6565

66-
; CHECK: st -x, r10 ; encoding: [0xae,0x92]
66+
; CHECK: st -x, r10 ; encoding: [0xae,0x92]
6767
; CHECK: st -x, r17 ; encoding: [0x1e,0x93]
6868

6969
; CHECK: st -y, r30 ; encoding: [0xea,0x93]

0 commit comments

Comments
 (0)