[llvm-commits] [llvm] r76017 - in /llvm/trunk/lib/Target/SystemZ: SystemZ.h SystemZISelLowering.cpp SystemZInstrInfo.td SystemZOperands.td
Anton Korobeynikov
asl at math.spbu.ru
Thu Jul 16 07:19:54 PDT 2009
Author: asl
Date: Thu Jul 16 09:19:54 2009
New Revision: 76017
URL: http://llvm.org/viewvc/llvm-project?rev=76017&view=rev
Log:
Implement all comparisons
Modified:
llvm/trunk/lib/Target/SystemZ/SystemZ.h
llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td
llvm/trunk/lib/Target/SystemZ/SystemZOperands.td
Modified: llvm/trunk/lib/Target/SystemZ/SystemZ.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZ.h?rev=76017&r1=76016&r2=76017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZ.h (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZ.h Thu Jul 16 09:19:54 2009
@@ -26,12 +26,20 @@
// SystemZ specific condition code. These correspond to SYSTEMZ_*_COND in
// SystemZInstrInfo.td. They must be kept in synch.
enum CondCodes {
- E = 0,
- NE = 1,
- H = 2,
- L = 3,
- HE = 4,
- LE = 5
+ O = 0,
+ H = 1,
+ NLE = 2,
+ L = 3,
+ NHE = 4,
+ LH = 5,
+ NE = 6,
+ E = 7,
+ NLH = 8,
+ HE = 9,
+ NL = 10,
+ LE = 11,
+ NH = 12,
+ NO = 13
};
}
Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=76017&r1=76016&r2=76017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Thu Jul 16 09:19:54 2009
@@ -484,8 +484,6 @@
SDValue SystemZTargetLowering::EmitCmp(SDValue LHS, SDValue RHS,
ISD::CondCode CC, SDValue &SystemZCC,
SelectionDAG &DAG) {
- assert(!LHS.getValueType().isFloatingPoint() && "We don't handle FP yet");
-
// FIXME: Emit a test if RHS is zero
bool isUnsigned = false;
@@ -493,29 +491,63 @@
switch (CC) {
default: assert(0 && "Invalid integer condition!");
case ISD::SETEQ:
+ case ISD::SETOEQ:
TCC = SystemZCC::E;
break;
+ case ISD::SETUEQ:
+ TCC = SystemZCC::NLH;
+ break;
case ISD::SETNE:
+ case ISD::SETONE:
TCC = SystemZCC::NE;
break;
+ case ISD::SETUNE:
+ TCC = SystemZCC::LH;
+ break;
+ case ISD::SETO:
+ TCC = SystemZCC::O;
+ break;
+ case ISD::SETUO:
+ TCC = SystemZCC::NO;
+ break;
case ISD::SETULE:
+ if (LHS.getValueType().isFloatingPoint()) {
+ TCC = SystemZCC::NH;
+ break;
+ }
isUnsigned = true; // FALLTHROUGH
case ISD::SETLE:
+ case ISD::SETOLE:
TCC = SystemZCC::LE;
break;
case ISD::SETUGE:
+ if (LHS.getValueType().isFloatingPoint()) {
+ TCC = SystemZCC::NL;
+ break;
+ }
isUnsigned = true; // FALLTHROUGH
case ISD::SETGE:
+ case ISD::SETOGE:
TCC = SystemZCC::HE;
break;
case ISD::SETUGT:
- isUnsigned = true;
+ if (LHS.getValueType().isFloatingPoint()) {
+ TCC = SystemZCC::NLE;
+ break;
+ }
+ isUnsigned = true; // FALLTHROUGH
case ISD::SETGT:
- TCC = SystemZCC::H; // FALLTHROUGH
+ case ISD::SETOGT:
+ TCC = SystemZCC::H;
break;
case ISD::SETULT:
- isUnsigned = true;
- case ISD::SETLT: // FALLTHROUGH
+ if (LHS.getValueType().isFloatingPoint()) {
+ TCC = SystemZCC::NHE;
+ break;
+ }
+ isUnsigned = true; // FALLTHROUGH
+ case ISD::SETLT:
+ case ISD::SETOLT:
TCC = SystemZCC::L;
break;
}
Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td?rev=76017&r1=76016&r2=76017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td Thu Jul 16 09:19:54 2009
@@ -104,25 +104,48 @@
}
let Uses = [PSW] in {
- def JE : Pseudo<(outs), (ins brtarget:$dst),
- "je\t$dst",
- [(SystemZbrcond bb:$dst, SYSTEMZ_COND_E)]>;
- def JNE : Pseudo<(outs), (ins brtarget:$dst),
- "jne\t$dst",
- [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NE)]>;
+ def JO : Pseudo<(outs), (ins brtarget:$dst),
+ "jo\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_O)]>;
def JH : Pseudo<(outs), (ins brtarget:$dst),
"jh\t$dst",
[(SystemZbrcond bb:$dst, SYSTEMZ_COND_H)]>;
+ def JNLE: Pseudo<(outs), (ins brtarget:$dst),
+ "jnle\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NLE)]>;
def JL : Pseudo<(outs), (ins brtarget:$dst),
"jl\t$dst",
[(SystemZbrcond bb:$dst, SYSTEMZ_COND_L)]>;
+ def JNHE: Pseudo<(outs), (ins brtarget:$dst),
+ "jnhe\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NHE)]>;
+ def JLH : Pseudo<(outs), (ins brtarget:$dst),
+ "jlh\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_LH)]>;
+ def JNE : Pseudo<(outs), (ins brtarget:$dst),
+ "jne\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NE)]>;
+ def JE : Pseudo<(outs), (ins brtarget:$dst),
+ "je\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_E)]>;
+ def JNLH: Pseudo<(outs), (ins brtarget:$dst),
+ "jnlh\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NLH)]>;
def JHE : Pseudo<(outs), (ins brtarget:$dst),
"jhe\t$dst",
[(SystemZbrcond bb:$dst, SYSTEMZ_COND_HE)]>;
+ def JNL : Pseudo<(outs), (ins brtarget:$dst),
+ "jnl\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NL)]>;
def JLE : Pseudo<(outs), (ins brtarget:$dst),
"jle\t$dst",
[(SystemZbrcond bb:$dst, SYSTEMZ_COND_LE)]>;
-
+ def JNH : Pseudo<(outs), (ins brtarget:$dst),
+ "jnh\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NH)]>;
+ def JNO : Pseudo<(outs), (ins brtarget:$dst),
+ "jno\t$dst",
+ [(SystemZbrcond bb:$dst, SYSTEMZ_COND_NO)]>;
} // Uses = [PSW]
} // isBranch = 1
Modified: llvm/trunk/lib/Target/SystemZ/SystemZOperands.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZOperands.td?rev=76017&r1=76016&r2=76017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZOperands.td (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZOperands.td Thu Jul 16 09:19:54 2009
@@ -17,12 +17,20 @@
// SystemZ specific condition code. These correspond to CondCode in
// SystemZ.h. They must be kept in synch.
-def SYSTEMZ_COND_E : PatLeaf<(i8 0)>;
-def SYSTEMZ_COND_NE : PatLeaf<(i8 1)>;
-def SYSTEMZ_COND_H : PatLeaf<(i8 2)>;
-def SYSTEMZ_COND_L : PatLeaf<(i8 3)>;
-def SYSTEMZ_COND_HE : PatLeaf<(i8 4)>;
-def SYSTEMZ_COND_LE : PatLeaf<(i8 5)>;
+def SYSTEMZ_COND_O : PatLeaf<(i8 0)>;
+def SYSTEMZ_COND_H : PatLeaf<(i8 1)>;
+def SYSTEMZ_COND_NLE : PatLeaf<(i8 2)>;
+def SYSTEMZ_COND_L : PatLeaf<(i8 3)>;
+def SYSTEMZ_COND_NHE : PatLeaf<(i8 4)>;
+def SYSTEMZ_COND_LH : PatLeaf<(i8 5)>;
+def SYSTEMZ_COND_NE : PatLeaf<(i8 6)>;
+def SYSTEMZ_COND_E : PatLeaf<(i8 7)>;
+def SYSTEMZ_COND_NLH : PatLeaf<(i8 8)>;
+def SYSTEMZ_COND_HE : PatLeaf<(i8 9)>;
+def SYSTEMZ_COND_NL : PatLeaf<(i8 10)>;
+def SYSTEMZ_COND_LE : PatLeaf<(i8 11)>;
+def SYSTEMZ_COND_NH : PatLeaf<(i8 12)>;
+def SYSTEMZ_COND_NO : PatLeaf<(i8 13)>;
def LL16 : SDNodeXForm<imm, [{
// Transformation function: return low 16 bits.
More information about the llvm-commits
mailing list