mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-31 09:25:42 +00:00
ARM MachO: sort out isTargetDarwin/isTargetIOS/... checks.
The ARM backend has been using most of the MachO related subtarget checks almost interchangeably, and since the only target it's had to run on has been IOS (which is all three of MachO, Darwin and IOS) it's worked out OK so far. But we'd like to support embedded targets under the "*-*-none-macho" triple, which means everything starts falling apart and inconsistent behaviours emerge. This patch should pick a reasonably sensible set of behaviours for the new triple (and any others that come along, with luck). Some choices were debatable (notably FP == r7 or r11), but we can revisit those later when deficiencies become apparent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
; RUN: llc -mtriple=thumbv7-apple-darwin-eabi < %s | FileCheck %s
|
||||
; RUN: llc -mtriple=thumbv6m-apple-darwin-eabi -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-T1
|
||||
; RUN: llc -mtriple=thumbv7-apple-none-macho < %s | FileCheck %s
|
||||
; RUN: llc -mtriple=thumbv6m-apple-none-macho -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-T1
|
||||
; RUN: llc -mtriple=thumbv7-apple-darwin-ios -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-IOS
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ declare void @bar(i8*)
|
||||
|
||||
define void @check_simple() minsize {
|
||||
; CHECK-LABEL: check_simple:
|
||||
; CHECK: push.w {r7, r8, r9, r10, r11, lr}
|
||||
; CHECK: push {r3, r4, r5, r6, r7, lr}
|
||||
; CHECK-NOT: sub sp, sp,
|
||||
; ...
|
||||
; CHECK-NOT: add sp, sp,
|
||||
; CHECK: pop.w {r0, r1, r2, r3, r11, pc}
|
||||
; CHECK: pop {r0, r1, r2, r3, r7, pc}
|
||||
|
||||
; CHECK-T1-LABEL: check_simple:
|
||||
; CHECK-T1: push {r3, r4, r5, r6, r7, lr}
|
||||
@@ -43,11 +43,11 @@ define void @check_simple() minsize {
|
||||
|
||||
define void @check_simple_too_big() minsize {
|
||||
; CHECK-LABEL: check_simple_too_big:
|
||||
; CHECK: push.w {r11, lr}
|
||||
; CHECK: push {r7, lr}
|
||||
; CHECK: sub sp,
|
||||
; ...
|
||||
; CHECK: add sp,
|
||||
; CHECK: pop.w {r11, pc}
|
||||
; CHECK: pop {r7, pc}
|
||||
%var = alloca i8, i32 64
|
||||
call void @bar(i8* %var)
|
||||
ret void
|
||||
@@ -92,16 +92,16 @@ define void @check_vfp_fold() minsize {
|
||||
; folded in except that doing so would clobber the value being returned.
|
||||
define i64 @check_no_return_clobber() minsize {
|
||||
; CHECK-LABEL: check_no_return_clobber:
|
||||
; CHECK: push.w {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr}
|
||||
; CHECK: push {r1, r2, r3, r4, r5, r6, r7, lr}
|
||||
; CHECK-NOT: sub sp,
|
||||
; ...
|
||||
; CHECK: add sp, #40
|
||||
; CHECK: pop.w {r11, pc}
|
||||
; CHECK: add sp, #24
|
||||
; CHECK: pop {r7, pc}
|
||||
|
||||
; Just to keep iOS FileCheck within previous function:
|
||||
; CHECK-IOS-LABEL: check_no_return_clobber:
|
||||
|
||||
%var = alloca i8, i32 40
|
||||
%var = alloca i8, i32 20
|
||||
call void @bar(i8* %var)
|
||||
ret i64 0
|
||||
}
|
||||
@@ -161,4 +161,4 @@ end:
|
||||
; We want the epilogue to be the only thing in a basic block so that we hit
|
||||
; the correct edge-case (first inst in block is correct one to adjust).
|
||||
ret void
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user