From 38abcb500fbb868514d83152cc178ecf2d7ba6e4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 17 Dec 2005 23:52:08 +0000 Subject: [PATCH] Eliminate CMPri, which is a synonym for SUBCCri git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24805 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcInstrInfo.td | 9 ++------- lib/Target/Sparc/SparcV8ISelSimple.cpp | 2 +- lib/Target/SparcV8/SparcV8ISelSimple.cpp | 2 +- lib/Target/SparcV8/SparcV8InstrInfo.td | 9 ++------- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/lib/Target/Sparc/SparcInstrInfo.td b/lib/Target/Sparc/SparcInstrInfo.td index 04fb7fe4f59..0971695edc4 100644 --- a/lib/Target/Sparc/SparcInstrInfo.td +++ b/lib/Target/Sparc/SparcInstrInfo.td @@ -94,13 +94,6 @@ let isReturn = 1, isTerminator = 1, hasDelaySlot = 1 in { def RETL: F3_2<2, 0b111000, (ops), "retl", [(ret)]>; } -// CMP is a special case of SUBCC where destination is ignored, by setting it to -// %g0 (hardwired zero). -// FIXME: should keep track of the fact that it defs the integer condition codes -let rd = 0 in - def CMPri: F3_2<2, 0b010100, - (ops IntRegs:$b, i32imm:$c), - "cmp $b, $c", []>; // Section B.1 - Load Integer Instructions, p. 90 def LDSBrr : F3_1<3, 0b001001, @@ -520,6 +513,8 @@ def FABSS : F3_3<2, 0b110100, 0b000001001, (ops FPRegs:$dst, FPRegs:$src), "fabss $src, $dst", [(set FPRegs:$dst, (fabs FPRegs:$src))]>; +// FIXME: ADD FNEGD/FABSD pseudo instructions. + // Floating-point Square Root Instructions, p.145 def FSQRTS : F3_3<2, 0b110100, 0b000101001, diff --git a/lib/Target/Sparc/SparcV8ISelSimple.cpp b/lib/Target/Sparc/SparcV8ISelSimple.cpp index 2e3530c3cf2..c7d364d2fc7 100644 --- a/lib/Target/Sparc/SparcV8ISelSimple.cpp +++ b/lib/Target/Sparc/SparcV8ISelSimple.cpp @@ -1062,7 +1062,7 @@ void V8ISel::visitBranchInst(BranchInst &I) { // CondReg=(); // If (CondReg==0) goto notTakenSuccMBB; unsigned CondReg = getReg (I.getCondition ()); - BuildMI (BB, V8::CMPri, 2).addSImm (0).addReg (CondReg); + BuildMI (BB, V8::SUBCCri, 2, V8::G0).addReg(CondReg).addSImm(0); BuildMI (BB, V8::BE, 1).addMBB (notTakenSuccMBB); BuildMI (BB, V8::BA, 1).addMBB (takenSuccMBB); return; diff --git a/lib/Target/SparcV8/SparcV8ISelSimple.cpp b/lib/Target/SparcV8/SparcV8ISelSimple.cpp index 2e3530c3cf2..c7d364d2fc7 100644 --- a/lib/Target/SparcV8/SparcV8ISelSimple.cpp +++ b/lib/Target/SparcV8/SparcV8ISelSimple.cpp @@ -1062,7 +1062,7 @@ void V8ISel::visitBranchInst(BranchInst &I) { // CondReg=(); // If (CondReg==0) goto notTakenSuccMBB; unsigned CondReg = getReg (I.getCondition ()); - BuildMI (BB, V8::CMPri, 2).addSImm (0).addReg (CondReg); + BuildMI (BB, V8::SUBCCri, 2, V8::G0).addReg(CondReg).addSImm(0); BuildMI (BB, V8::BE, 1).addMBB (notTakenSuccMBB); BuildMI (BB, V8::BA, 1).addMBB (takenSuccMBB); return; diff --git a/lib/Target/SparcV8/SparcV8InstrInfo.td b/lib/Target/SparcV8/SparcV8InstrInfo.td index 04fb7fe4f59..0971695edc4 100644 --- a/lib/Target/SparcV8/SparcV8InstrInfo.td +++ b/lib/Target/SparcV8/SparcV8InstrInfo.td @@ -94,13 +94,6 @@ let isReturn = 1, isTerminator = 1, hasDelaySlot = 1 in { def RETL: F3_2<2, 0b111000, (ops), "retl", [(ret)]>; } -// CMP is a special case of SUBCC where destination is ignored, by setting it to -// %g0 (hardwired zero). -// FIXME: should keep track of the fact that it defs the integer condition codes -let rd = 0 in - def CMPri: F3_2<2, 0b010100, - (ops IntRegs:$b, i32imm:$c), - "cmp $b, $c", []>; // Section B.1 - Load Integer Instructions, p. 90 def LDSBrr : F3_1<3, 0b001001, @@ -520,6 +513,8 @@ def FABSS : F3_3<2, 0b110100, 0b000001001, (ops FPRegs:$dst, FPRegs:$src), "fabss $src, $dst", [(set FPRegs:$dst, (fabs FPRegs:$src))]>; +// FIXME: ADD FNEGD/FABSD pseudo instructions. + // Floating-point Square Root Instructions, p.145 def FSQRTS : F3_3<2, 0b110100, 0b000101001,