mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-10 06:54:54 +00:00
ARM FastISel is currently only enabled for iOS non-Thumb1, and I'm working on enabling it for other targets. As a first step I've fixed some of the tests. Changes to ARM FastISel tests: - Different triples don't generate the same relocations (especially movw/movt versus constant pool loads). Use a regex to allow either. - Mangling is different. Use a regex to allow either. - The reserved registers are sometimes different, so registers get allocated in a different order. Capture the names only where this occurs. - Add -verify-machineinstrs to some tests where it works. It doesn't work everywhere it should yet. - Add -fast-isel-abort to many tests that didn't have it before. - Split out the VarArg test from fast-isel-call.ll into its own test. This simplifies test setup because of --check-prefix. Patch by JF Bastien git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181801 91177308-0d34-0410-b5e6-96231b3b80d8
100 lines
2.3 KiB
LLVM
100 lines
2.3 KiB
LLVM
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
|
|
; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
|
|
|
|
define i32 @t1(i1 %c) nounwind readnone {
|
|
entry:
|
|
; ARM: t1
|
|
; ARM: movw r{{[1-9]}}, #10
|
|
; ARM: cmp r0, #0
|
|
; ARM: moveq r{{[1-9]}}, #20
|
|
; ARM: mov r0, r{{[1-9]}}
|
|
; THUMB: t1
|
|
; THUMB: movs r{{[1-9]}}, #10
|
|
; THUMB: movt r{{[1-9]}}, #0
|
|
; THUMB: cmp r0, #0
|
|
; THUMB: it eq
|
|
; THUMB: moveq r{{[1-9]}}, #20
|
|
; THUMB: mov r0, r{{[1-9]}}
|
|
%0 = select i1 %c, i32 10, i32 20
|
|
ret i32 %0
|
|
}
|
|
|
|
define i32 @t2(i1 %c, i32 %a) nounwind readnone {
|
|
entry:
|
|
; ARM: t2
|
|
; ARM: cmp r0, #0
|
|
; ARM: moveq r{{[1-9]}}, #20
|
|
; ARM: mov r0, r{{[1-9]}}
|
|
; THUMB: t2
|
|
; THUMB: cmp r0, #0
|
|
; THUMB: it eq
|
|
; THUMB: moveq r{{[1-9]}}, #20
|
|
; THUMB: mov r0, r{{[1-9]}}
|
|
%0 = select i1 %c, i32 %a, i32 20
|
|
ret i32 %0
|
|
}
|
|
|
|
define i32 @t3(i1 %c, i32 %a, i32 %b) nounwind readnone {
|
|
entry:
|
|
; ARM: t3
|
|
; ARM: cmp r0, #0
|
|
; ARM: movne r{{[1-9]}}, r{{[1-9]}}
|
|
; ARM: mov r0, r{{[1-9]}}
|
|
; THUMB: t3
|
|
; THUMB: cmp r0, #0
|
|
; THUMB: it ne
|
|
; THUMB: movne r{{[1-9]}}, r{{[1-9]}}
|
|
; THUMB: mov r0, r{{[1-9]}}
|
|
%0 = select i1 %c, i32 %a, i32 %b
|
|
ret i32 %0
|
|
}
|
|
|
|
define i32 @t4(i1 %c) nounwind readnone {
|
|
entry:
|
|
; ARM: t4
|
|
; ARM: mvn r{{[1-9]}}, #9
|
|
; ARM: cmp r0, #0
|
|
; ARM: mvneq r{{[1-9]}}, #0
|
|
; ARM: mov r0, r{{[1-9]}}
|
|
; THUMB: t4
|
|
; THUMB: movw r{{[1-9]}}, #65526
|
|
; THUMB: movt r{{[1-9]}}, #65535
|
|
; THUMB: cmp r0, #0
|
|
; THUMB: it eq
|
|
; THUMB: mvneq r{{[1-9]}}, #0
|
|
; THUMB: mov r0, r{{[1-9]}}
|
|
%0 = select i1 %c, i32 -10, i32 -1
|
|
ret i32 %0
|
|
}
|
|
|
|
define i32 @t5(i1 %c, i32 %a) nounwind readnone {
|
|
entry:
|
|
; ARM: t5
|
|
; ARM: cmp r0, #0
|
|
; ARM: mvneq r{{[1-9]}}, #1
|
|
; ARM: mov r0, r{{[1-9]}}
|
|
; THUMB: t5
|
|
; THUMB: cmp r0, #0
|
|
; THUMB: it eq
|
|
; THUMB: mvneq r{{[1-9]}}, #1
|
|
; THUMB: mov r0, r{{[1-9]}}
|
|
%0 = select i1 %c, i32 %a, i32 -2
|
|
ret i32 %0
|
|
}
|
|
|
|
; Check one large negative immediates.
|
|
define i32 @t6(i1 %c, i32 %a) nounwind readnone {
|
|
entry:
|
|
; ARM: t6
|
|
; ARM: cmp r0, #0
|
|
; ARM: mvneq r{{[1-9]}}, #978944
|
|
; ARM: mov r0, r{{[1-9]}}
|
|
; THUMB: t6
|
|
; THUMB: cmp r0, #0
|
|
; THUMB: it eq
|
|
; THUMB: mvneq r{{[1-9]}}, #978944
|
|
; THUMB: mov r0, r{{[1-9]}}
|
|
%0 = select i1 %c, i32 %a, i32 -978945
|
|
ret i32 %0
|
|
}
|