diff options
author | dim <dim@FreeBSD.org> | 2014-02-23 23:23:01 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-02-23 23:23:01 +0000 |
commit | 30b3f33f96ea15c79777bcbfdf19881842e93540 (patch) | |
tree | 8199032f1a6558531e087f98a7a7499808b9aff0 /contrib/llvm/lib/Target | |
parent | 5da3e6a9593531c85ee2e554708e86cf4b54f44d (diff) | |
download | FreeBSD-src-30b3f33f96ea15c79777bcbfdf19881842e93540.zip FreeBSD-src-30b3f33f96ea15c79777bcbfdf19881842e93540.tar.gz |
Pull in r201994 from upstream llvm trunk (by Benjamin Kramer):
SPARC: Implement TRAP lowering. Matches what GCC emits.
This lets clang emit "ta 5" for trap instructions on sparc64, instead of
emitting a call to abort(), making it possible to link the kernel.
Diffstat (limited to 'contrib/llvm/lib/Target')
-rw-r--r-- | contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp | 2 | ||||
-rw-r--r-- | contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp index 283bff6..9952086 100644 --- a/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp +++ b/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp @@ -1566,6 +1566,8 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM) // VAARG needs to be lowered to not do unaligned accesses for doubles. setOperationAction(ISD::VAARG , MVT::Other, Custom); + setOperationAction(ISD::TRAP , MVT::Other, Legal); + // Use the default implementation. setOperationAction(ISD::VACOPY , MVT::Other, Expand); setOperationAction(ISD::VAEND , MVT::Other, Expand); diff --git a/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td b/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td index 94d2719..ae10ca0 100644 --- a/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td +++ b/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td @@ -312,6 +312,9 @@ let hasSideEffects = 1, mayStore = 1 in { [(flushw)]>; } +let isBarrier = 1, isTerminator = 1, rd = 0b1000, rs1 = 0, simm13 = 5 in + def TA5 : F3_2<0b10, 0b111010, (outs), (ins), "ta 5", [(trap)]>; + let rd = 0 in def UNIMP : F2_1<0b000, (outs), (ins i32imm:$val), "unimp $val", []>; |