mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
8301d3efae
This is a work-in-progress implementation of an assembler for M68k. Outstanding work: - Updating existing tests assembly syntax - Writing new tests for the assembler (and disassembler) I've left those until there's consensus that this approach is okay (I hope that's okay!). Questions I'm aware of: - Should this use Motorola or gas syntax? (At the moment it uses Motorola syntax.) - The disassembler produces a table at runtime for disassembly generated from the code beads. Is this okay? (This is less than ideal but as I mentioned in my llvm-dev post, it's quite complicated to write a table-gen parser for code beads.) Depends on D98519 Depends on D98532 Depends on D98534 Depends on D98535 Depends on D98536 Differential Revision: https://reviews.llvm.org/D98537
49 lines
1.1 KiB
ArmAsm
49 lines
1.1 KiB
ArmAsm
; RUN: llvm-mc -triple m68k -show-encoding -motorola-integers %s | FileCheck %s
|
|
|
|
; At the moment, all encoding tests for M68k live in llvm/test/CodeGen/M68k/.
|
|
; This is the first test included as part of the AsmMatcher and lacks encoding checks.
|
|
; The current migration plan is to consolidate all of the encoding tests in this
|
|
; directory along with AsmMatcher/ Disassembler tests like the other platforms.
|
|
; For more information and status updates see bug #49865.
|
|
|
|
.global ext_fn
|
|
|
|
; CHECK: move.l %a1, %a0
|
|
move.l %a1, %a0
|
|
; CHECK: add.l %a0, %a1
|
|
add.l %a0, %a1
|
|
; CHECK: addx.l %d1, %d2
|
|
addx.l %d1, %d2
|
|
; CHECK: sub.w #4, %d1
|
|
sub.w #4, %d1
|
|
; CHECK: cmp.w %a0, %d0
|
|
cmp.w %a0, %d0
|
|
; CHECK: neg.w %d0
|
|
neg.w %d0
|
|
; CHECK: btst #8, %d3
|
|
btst #$8, %d3
|
|
; CHECK: bra ext_fn
|
|
bra ext_fn
|
|
; CHECK: jsr ext_fn
|
|
jsr ext_fn
|
|
; CHECK: seq %d0
|
|
seq %d0
|
|
; CHECK: sgt %d0
|
|
sgt %d0
|
|
; CHECK: lea (80,%a0), %a1
|
|
lea $50(%a0), %a1
|
|
; CHECK: lsl.l #8, %a1
|
|
lsl.l #8, %a1
|
|
; CHECK: lsr.l #8, %a1
|
|
lsr.l #8, %a1
|
|
; CHECK: asr.l #8, %a1
|
|
asr.l #8, %a1
|
|
; CHECK: rol.l #8, %a1
|
|
rol.l #8, %a1
|
|
; CHECK: ror.l #8, %a1
|
|
ror.l #8, %a1
|
|
; CHECK: nop
|
|
nop
|
|
; CHECK: rts
|
|
rts
|