mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Use a different encoding for debugtrap on PS4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04bcc11905
commit
8da9a6686a
@ -790,6 +790,8 @@ def Not16BitMode : Predicate<"!Subtarget->is16Bit()">,
|
||||
def In32BitMode : Predicate<"Subtarget->is32Bit()">,
|
||||
AssemblerPredicate<"Mode32Bit", "32-bit mode">;
|
||||
def IsWin64 : Predicate<"Subtarget->isTargetWin64()">;
|
||||
def IsPS4 : Predicate<"Subtarget->isTargetPS4()">;
|
||||
def NotPS4 : Predicate<"!Subtarget->isTargetPS4()">;
|
||||
def IsNaCl : Predicate<"Subtarget->isTargetNaCl()">;
|
||||
def NotNaCl : Predicate<"!Subtarget->isTargetNaCl()">;
|
||||
def SmallCode : Predicate<"TM.getCodeModel() == CodeModel::Small">;
|
||||
|
@ -38,9 +38,6 @@ def INT3 : I<0xcc, RawFrm, (outs), (ins), "int3",
|
||||
[(int_x86_int (i8 3))], IIC_INT3>;
|
||||
} // SchedRW
|
||||
|
||||
def : Pat<(debugtrap),
|
||||
(INT3)>;
|
||||
|
||||
// The long form of "int $3" turns into int3 as a size optimization.
|
||||
// FIXME: This doesn't work because InstAlias can't match immediate constants.
|
||||
//def : InstAlias<"int\t$3", (INT3)>;
|
||||
@ -71,6 +68,10 @@ def IRET64 : RI<0xcf, RawFrm, (outs), (ins), "iretq", [], IIC_IRET>,
|
||||
Requires<[In64BitMode]>;
|
||||
} // SchedRW
|
||||
|
||||
def : Pat<(debugtrap),
|
||||
(INT3)>, Requires<[NotPS4]>;
|
||||
def : Pat<(debugtrap),
|
||||
(INT (i8 0x41))>, Requires<[IsPS4]>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Input/Output Instructions.
|
||||
|
@ -403,6 +403,7 @@ public:
|
||||
bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
|
||||
bool isTargetDragonFly() const { return TargetTriple.isOSDragonFly(); }
|
||||
bool isTargetSolaris() const { return TargetTriple.isOSSolaris(); }
|
||||
bool isTargetPS4() const { return TargetTriple.isPS4(); }
|
||||
|
||||
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
|
||||
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
|
||||
|
@ -1,15 +1,25 @@
|
||||
; RUN: llc < %s -march=x86 -mcpu=yonah | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=i686-apple-darwin8 -mcpu=yonah | FileCheck %s -check-prefix=DARWIN
|
||||
; RUN: llc < %s -mtriple=i686-unknown-linux -mcpu=yonah | FileCheck %s -check-prefix=LINUX
|
||||
; RUN: llc < %s -mtriple=x86_64-scei-ps4 | FileCheck %s -check-prefix=PS4
|
||||
|
||||
; CHECK-LABEL: test0:
|
||||
; CHECK: ud2
|
||||
; DARWIN-LABEL: test0:
|
||||
; DARWIN: ud2
|
||||
; LINUX-LABEL: test0:
|
||||
; LINUX: ud2
|
||||
; PS4-LABEL: test0:
|
||||
; PS4: ud2
|
||||
define i32 @test0() noreturn nounwind {
|
||||
entry:
|
||||
tail call void @llvm.trap( )
|
||||
unreachable
|
||||
}
|
||||
|
||||
; CHECK-LABEL: test1:
|
||||
; CHECK: int3
|
||||
; DARWIN-LABEL: test1:
|
||||
; DARWIN: int3
|
||||
; LINUX-LABEL: test1:
|
||||
; LINUX: int3
|
||||
; PS4-LABEL: test1:
|
||||
; PS4: int $65
|
||||
define i32 @test1() noreturn nounwind {
|
||||
entry:
|
||||
tail call void @llvm.debugtrap( )
|
||||
|
Loading…
x
Reference in New Issue
Block a user