mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Proper support for a bastardized darwin-eabi hybird ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151083 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e16da6c020
commit
07043279f6
@ -599,10 +599,8 @@ void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
|||||||
OutStreamer.EmitAssemblerFlag(MCAF_SyntaxUnified);
|
OutStreamer.EmitAssemblerFlag(MCAF_SyntaxUnified);
|
||||||
|
|
||||||
// Emit ARM Build Attributes
|
// Emit ARM Build Attributes
|
||||||
if (Subtarget->isTargetELF()) {
|
if (Subtarget->isTargetELF())
|
||||||
|
|
||||||
emitAttributes();
|
emitAttributes();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
|
|||||||
setLibcallName(RTLIB::SRL_I128, 0);
|
setLibcallName(RTLIB::SRL_I128, 0);
|
||||||
setLibcallName(RTLIB::SRA_I128, 0);
|
setLibcallName(RTLIB::SRA_I128, 0);
|
||||||
|
|
||||||
if (Subtarget->isAAPCS_ABI()) {
|
if (Subtarget->isAAPCS_ABI() && !Subtarget->isTargetDarwin()) {
|
||||||
// Double-precision floating-point arithmetic helper functions
|
// Double-precision floating-point arithmetic helper functions
|
||||||
// RTABI chapter 4.1.2, Table 2
|
// RTABI chapter 4.1.2, Table 2
|
||||||
setLibcallName(RTLIB::ADD_F64, "__aeabi_dadd");
|
setLibcallName(RTLIB::ADD_F64, "__aeabi_dadd");
|
||||||
|
@ -145,8 +145,8 @@ EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl,
|
|||||||
SDValue Src, SDValue Size,
|
SDValue Src, SDValue Size,
|
||||||
unsigned Align, bool isVolatile,
|
unsigned Align, bool isVolatile,
|
||||||
MachinePointerInfo DstPtrInfo) const {
|
MachinePointerInfo DstPtrInfo) const {
|
||||||
// Use default for non AAPCS subtargets
|
// Use default for non AAPCS (or Darwin) subtargets
|
||||||
if (!Subtarget->isAAPCS_ABI())
|
if (!Subtarget->isAAPCS_ABI() || Subtarget->isTargetDarwin())
|
||||||
return SDValue();
|
return SDValue();
|
||||||
|
|
||||||
const ARMTargetLowering &TLI =
|
const ARMTargetLowering &TLI =
|
||||||
|
@ -105,6 +105,8 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
|
|||||||
computeIssueWidth();
|
computeIssueWidth();
|
||||||
|
|
||||||
if (TT.find("eabi") != std::string::npos)
|
if (TT.find("eabi") != std::string::npos)
|
||||||
|
// FIXME: We might want to separate AAPCS and EABI. Some systems, e.g.
|
||||||
|
// Darwin-EABI conforms to AACPS but not the rest of EABI.
|
||||||
TargetABI = ARM_ABI_AAPCS;
|
TargetABI = ARM_ABI_AAPCS;
|
||||||
|
|
||||||
if (isAAPCS_ABI())
|
if (isAAPCS_ABI())
|
||||||
@ -115,8 +117,7 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
|
|||||||
else {
|
else {
|
||||||
IsR9Reserved = ReserveR9 | !HasV6Ops;
|
IsR9Reserved = ReserveR9 | !HasV6Ops;
|
||||||
UseMovt = DarwinUseMOVT && hasV6T2Ops();
|
UseMovt = DarwinUseMOVT && hasV6T2Ops();
|
||||||
const Triple &T = getTargetTriple();
|
SupportsTailCall = !getTargetTriple().isOSVersionLT(5, 0);
|
||||||
SupportsTailCall = !T.isOSVersionLT(5, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isThumb() || hasThumb2())
|
if (!isThumb() || hasThumb2())
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
; RUN: llc < %s -mtriple=armv7-apple-ios -o - | FileCheck %s
|
; RUN: llc < %s -mtriple=armv7-apple-ios -o - | FileCheck %s
|
||||||
|
; RUN: llc < %s -mtriple=thumbv7m-darwin-eabi -o - | FileCheck %s --check-prefix=DARWIN
|
||||||
; RUN: llc < %s -mtriple=arm-none-eabi -o - | FileCheck --check-prefix=EABI %s
|
; RUN: llc < %s -mtriple=arm-none-eabi -o - | FileCheck --check-prefix=EABI %s
|
||||||
|
|
||||||
@from = common global [500 x i32] zeroinitializer, align 4
|
@from = common global [500 x i32] zeroinitializer, align 4
|
||||||
@ -18,6 +19,8 @@ entry:
|
|||||||
; EABI memset swaps arguments
|
; EABI memset swaps arguments
|
||||||
; CHECK: mov r1, #0
|
; CHECK: mov r1, #0
|
||||||
; CHECK: memset
|
; CHECK: memset
|
||||||
|
; DARWIN: movs r1, #0
|
||||||
|
; DARWIN: memset
|
||||||
; EABI: mov r2, #0
|
; EABI: mov r2, #0
|
||||||
; EABI: __aeabi_memset
|
; EABI: __aeabi_memset
|
||||||
call void @llvm.memset.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8 0, i32 500, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8 0, i32 500, i32 0, i1 false)
|
||||||
|
Loading…
Reference in New Issue
Block a user