[AVR] Fix I/O instructions on XMEGA
authorDylan McKay <me@dylanmckay.io>
Sun, 17 May 2020 04:25:12 +0000 (16:25 +1200)
committerDylan McKay <me@dylanmckay.io>
Sun, 17 May 2020 07:46:09 +0000 (19:46 +1200)
commit1420f4efbe7ca34355b2dd85d396197d92cd5e3f
tree0ba7b827231e97a3cf88360e7a912a3741d3cd83
parent3841ed4104ac32eae7305d07e4558ea607fa69f3
[AVR]  Fix I/O instructions on XMEGA

Summary:
On XMEGA, I/O address space is same as data address space - there is no 0x20 offset,
because CPU General Purpose Registers are not mapped in data address space.

From https://en.wikipedia.org/wiki/AVR_microcontrollers
> In the XMEGA variant, the working register file is not mapped into the data address space; as such, it is not possible to treat any of the XMEGA's working registers as though they were SRAM. Instead, the I/O registers are mapped into the data address space starting at the very beginning of the address space.

Reviewers: dylanmckay

Reviewed By: dylanmckay

Subscribers: hiraditya, Jim, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77207

Patch by Vlastimil Labsky.
llvm/lib/Target/AVR/AVRDevices.td
llvm/lib/Target/AVR/AVRInstrInfo.td
llvm/lib/Target/AVR/AVRSubtarget.cpp
llvm/lib/Target/AVR/AVRSubtarget.h
llvm/test/CodeGen/AVR/features/xmega_io.ll [new file with mode: 0644]