svn commit: r262415 - projects/clang-sparc64/contrib/llvm/lib/Target/Sparc

Dimitry Andric dim at FreeBSD.org
Sun Feb 23 23:23:02 UTC 2014


Author: dim
Date: Sun Feb 23 23:23:01 2014
New Revision: 262415
URL: http://svnweb.freebsd.org/changeset/base/262415

Log:
  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.

Modified:
  projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp
  projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td

Modified: projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp
==============================================================================
--- projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp	Sun Feb 23 23:13:53 2014	(r262414)
+++ projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp	Sun Feb 23 23:23:01 2014	(r262415)
@@ -1566,6 +1566,8 @@ SparcTargetLowering::SparcTargetLowering
   // 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);

Modified: projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td
==============================================================================
--- projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td	Sun Feb 23 23:13:53 2014	(r262414)
+++ projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td	Sun Feb 23 23:23:01 2014	(r262415)
@@ -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", []>;


More information about the svn-src-projects mailing list