1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/MC/AVR/inst-lpm.s
Ayke van Laethem 75eff6e3b0 [AVR] Disassemble instructions with fixed Z operand
Some instructions have a fixed Z register and don't have an explicit
register operand. This can be worked around by simply printing the
operand directly if the particular register class is detected.

The LPM and ELPM instructions also needed a custom decoder, which is
also included in this patch.

Differential Revision: https://reviews.llvm.org/D82088
2020-06-23 02:17:53 +02:00

33 lines
773 B
ArmAsm

; RUN: llvm-mc -triple avr -mattr=lpm,lpmx -show-encoding < %s | FileCheck %s
; RUN: llvm-mc -filetype=obj -triple avr -mattr=lpm,lpmx < %s | llvm-objdump -d --mattr=lpm,lpmx - | FileCheck -check-prefix=CHECK-INST %s
foo:
lpm
lpm r3, Z
lpm r23, Z
lpm r8, Z+
lpm r0, Z+
lpm r31, Z+
; CHECK: lpm ; encoding: [0xc8,0x95]
; CHECK: lpm r3, Z ; encoding: [0x34,0x90]
; CHECK: lpm r23, Z ; encoding: [0x74,0x91]
; CHECK: lpm r8, Z+ ; encoding: [0x85,0x90]
; CHECK: lpm r0, Z+ ; encoding: [0x05,0x90]
; CHECK: lpm r31, Z+ ; encoding: [0xf5,0x91]
; CHECK-INST: lpm
; CHECK-INST: lpm r3, Z
; CHECK-INST: lpm r23, Z
; CHECK-INST: lpm r8, Z+
; CHECK-INST: lpm r0, Z+
; CHECK-INST: lpm r31, Z+