1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/CodeGen/M68k/CollapseMOVEM.mir
Min-Yih Hsu 33b1222ec6 [M68k][test](6/8) Add all of the tests
And a small utilities -- extract-section.py -- that helps extracting
specific object file section and printing in textual format. This
utility is just a workaround for tests inside `Encoding`. Hopefully in
the future we can replace dependencies in those tests with existing tools
(e.g. llvm-readobj). Please refer to this bug for more context:
https://bugs.llvm.org/show_bug.cgi?id=49245

Note that since we don't have AsmParser for now, we are testing the MC
part using MIR as input and put those tests under the `Encoding` folder.
In the future when AsmParser (and disassembler) is finished, those tests
will be moved to `test/MC/M68k`.

Authors: myhsu, m4yers, glaubitz

Differential Revision: https://reviews.llvm.org/D88392
2021-03-08 12:30:57 -08:00

164 lines
4.0 KiB
YAML

# NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=asm -o - \
# RUN: | FileCheck %s
#------------------------------------------------------------------------------
# CollapseMOVEM pass finds sequences of MOVEM instructions and collapse them
# into a single instruciton with merged masks. This only works with stack data
#------------------------------------------------------------------------------
--- # CollapseMOVEM_RM
#
# CHECK-LABEL: CollapseMOVEM_RM
# CHECK: movem.l (0,%sp), %d0-%d2,%d7,%a1-%a3,%a5
name: CollapseMOVEM_RM
body: |
bb.0:
MOVM32mp 1, 0, $sp
MOVM32mp 2, 4, $sp
MOVM32mp 4, 8, $sp
MOVM32mp 128, 12, $sp
MOVM32mp 512, 16, $sp
MOVM32mp 1024, 20, $sp
MOVM32mp 2048, 24, $sp
MOVM32mp 8192, 28, $sp
...
#
# CHECK-LABEL: CollapseMOVEM_RM_Reversed
# CHECK: movem.l (0,%sp), %d0-%d2,%d7,%a1-%a3,%a5
name: CollapseMOVEM_RM_Reversed
body: |
bb.0:
MOVM32mp 8192, 28, $sp
MOVM32mp 2048, 24, $sp
MOVM32mp 1024, 20, $sp
MOVM32mp 512, 16, $sp
MOVM32mp 128, 12, $sp
MOVM32mp 4, 8, $sp
MOVM32mp 2, 4, $sp
MOVM32mp 1, 0, $sp
...
# This async reg/mem order is impossible to store with MOVEM
# CHECK-LABEL: CollapseMOVEM_RM_ReversedStoreOrder
# CHECK: movem.l (0,%sp), %a5
# CHECK: movem.l (4,%sp), %a3
# CHECK: movem.l (8,%sp), %a2
# CHECK: movem.l (12,%sp), %a1
# CHECK: movem.l (16,%sp), %d7
# CHECK: movem.l (20,%sp), %d2
# CHECK: movem.l (24,%sp), %d1
# CHECK: movem.l (28,%sp), %d0
name: CollapseMOVEM_RM_ReversedStoreOrder
body: |
bb.0:
MOVM32mp 8192, 0, $sp
MOVM32mp 2048, 4, $sp
MOVM32mp 1024, 8, $sp
MOVM32mp 512, 12, $sp
MOVM32mp 128, 16, $sp
MOVM32mp 4, 20, $sp
MOVM32mp 2, 24, $sp
MOVM32mp 1, 28, $sp
...
--- # CollapseMOVEM_MR
#
# CHECK-LABEL: CollapseMOVEM_MR
# CHECK: movem.l %d0-%d2,%d7,%a1-%a3,%a5, (0,%sp)
name: CollapseMOVEM_MR
body: |
bb.0:
MOVM32pm 0, $sp, 1
MOVM32pm 4, $sp, 2
MOVM32pm 8, $sp, 4
MOVM32pm 12, $sp, 128
MOVM32pm 16, $sp, 512
MOVM32pm 20, $sp, 1024
MOVM32pm 24, $sp, 2048
MOVM32pm 28, $sp, 8192
...
--- # CollapseMOVEM_Mixed
#
# CHECK-LABEL: CollapseMOVEM_Mixed
# CHECK: movem.l %d0-%d1, (0,%sp)
# CHECK: movem.l (8,%sp), %d2,%d7
# CHECK: movem.l %a1-%a2, (16,%sp)
# CHECK: movem.l (24,%sp), %a3
# CHECK: movem.l %a5, (28,%sp)
name: CollapseMOVEM_Mixed
body: |
bb.0:
MOVM32pm 0, $sp, 1
MOVM32pm 4, $sp, 2
MOVM32mp 4, 8, $sp
MOVM32mp 128, 12, $sp
MOVM32pm 16, $sp, 512
MOVM32pm 20, $sp, 1024
MOVM32mp 2048, 24, $sp
MOVM32pm 28, $sp, 8192
...
--- # CollapseMOVEM_Zero
#
# CHECK-LABEL: CollapseMOVEM_Zero
# CHECK: movem.l %d0-%d4, (-8,%sp)
name: CollapseMOVEM_Zero
body: |
bb.0:
MOVM32pm -8, $sp, 1
MOVM32pm -4, $sp, 2
MOVM32pm 0, $sp, 4
MOVM32pm 4, $sp, 8
MOVM32pm 8, $sp, 16
...
#
# CHECK-LABEL: CollapseMOVEM_Zero_Mixed
# CHECK: movem.l %d3, (4,%sp)
# CHECK: movem.l %d0-%d2, (-8,%sp)
# CHECK: movem.l %d4, (8,%sp)
name: CollapseMOVEM_Zero_Mixed
body: |
bb.0:
MOVM32pm 4, $sp, 8
MOVM32pm -4, $sp, 2
MOVM32pm -8, $sp, 1
MOVM32pm 0, $sp, 4
MOVM32pm 8, $sp, 16
...
--- # CollapseMOVEM_Zero_Reversed
#
# CHECK-LABEL: CollapseMOVEM_Zero_Reversed
# CHECK: movem.l %d0-%d4, (-8,%sp)
name: CollapseMOVEM_Zero_Reversed
body: |
bb.0:
MOVM32pm 8, $sp, 16
MOVM32pm 4, $sp, 8
MOVM32pm 0, $sp, 4
MOVM32pm -4, $sp, 2
MOVM32pm -8, $sp, 1
...
#
# CHECK-LABEL: CollapseMOVEM_Zero_ReversedStoreOrder
# CHECK: movem.l %d0, (8,%sp)
# CHECK: movem.l %d1, (4,%sp)
# CHECK: movem.l %d2, (0,%sp)
# CHECK: movem.l %d3, (-4,%sp)
# CHECK: movem.l %d4, (-8,%sp)
name: CollapseMOVEM_Zero_ReversedStoreOrder
body: |
bb.0:
MOVM32pm 8, $sp, 1
MOVM32pm 4, $sp, 2
MOVM32pm 0, $sp, 4
MOVM32pm -4, $sp, 8
MOVM32pm -8, $sp, 16
...