[llvm-commits] [llvm] r164756 - in /llvm/trunk/lib/Target/Mips: MipsDSPInstrFormats.td MipsDSPInstrInfo.td
Akira Hatanaka
ahatanaka at mips.com
Wed Sep 26 21:08:42 PDT 2012
Author: ahatanak
Date: Wed Sep 26 23:08:42 2012
New Revision: 164756
URL: http://llvm.org/viewvc/llvm-project?rev=164756&view=rev
Log:
MIPS DSP: rddsp (instruction which reads DSPControl register fields to a GPR).
Modified:
llvm/trunk/lib/Target/Mips/MipsDSPInstrFormats.td
llvm/trunk/lib/Target/Mips/MipsDSPInstrInfo.td
Modified: llvm/trunk/lib/Target/Mips/MipsDSPInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsDSPInstrFormats.td?rev=164756&r1=164755&r2=164756&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsDSPInstrFormats.td (original)
+++ llvm/trunk/lib/Target/Mips/MipsDSPInstrFormats.td Wed Sep 26 23:08:42 2012
@@ -174,6 +174,18 @@
let Inst{5-0} = 0b111000;
}
+class RDDSP_FMT<bits<5> op> : DSPInst {
+ bits<5> rd;
+ bits<10> mask;
+
+ let Opcode = SPECIAL3_OPCODE.V;
+
+ let Inst{25-16} = mask;
+ let Inst{15-11} = rd;
+ let Inst{10-6} = op;
+ let Inst{5-0} = 0b111000;
+}
+
class BPOSGE32_FMT<bits<5> op> : DSPInst {
bits<16> offset;
Modified: llvm/trunk/lib/Target/Mips/MipsDSPInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsDSPInstrInfo.td?rev=164756&r1=164755&r2=164756&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsDSPInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/MipsDSPInstrInfo.td Wed Sep 26 23:08:42 2012
@@ -164,6 +164,7 @@
class SHILOV_ENC : SHILO_R2_FMT<0b11011>;
class MTHLIP_ENC : SHILO_R2_FMT<0b11111>;
+class RDDSP_ENC : RDDSP_FMT<0b10010>;
class ADDU_PH_ENC : ADDU_QB_FMT<0b01000>;
class ADDU_S_PH_ENC : ADDU_QB_FMT<0b01100>;
class SUBU_PH_ENC : ADDU_QB_FMT<0b01001>;
@@ -296,6 +297,16 @@
string AsmString = !strconcat(instr_asm, "\t$rs, $ac");
}
+class RDDSP_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
+ InstrItinClass itin> {
+ dag OutOperandList = (outs CPURegs:$rd);
+ dag InOperandList = (ins uimm16:$mask);
+ string AsmString = !strconcat(instr_asm, "\t$rd, $mask");
+ list<dag> Pattern = [(set CPURegs:$rd, (OpNode immZExt10:$mask))];
+ InstrItinClass Itinerary = itin;
+ list<Register> Uses = [DSPCtrl];
+}
+
class DPA_W_PH_PSEUDO_BASE<SDPatternOperator OpNode, InstrItinClass itin,
Instruction realinst> :
PseudoDSP<(outs), (ins CPURegs:$rs, CPURegs:$rt),
@@ -573,6 +584,8 @@
class MTHLIP_DESC : MTHLIP_DESC_BASE<"mthlip">;
+class RDDSP_DESC : RDDSP_DESC_BASE<"rddsp", int_mips_rddsp, NoItinerary>;
+
//===----------------------------------------------------------------------===//
// MIPS DSP Rev 2
// Addition/subtraction
@@ -719,6 +732,7 @@
def SHILO : SHILO_ENC, SHILO_DESC;
def SHILOV : SHILOV_ENC, SHILOV_DESC;
def MTHLIP : MTHLIP_ENC, MTHLIP_DESC;
+def RDDSP : RDDSP_ENC, RDDSP_DESC;
// MIPS DSP Rev 2
let Predicates = [HasDSPR2] in {
More information about the llvm-commits
mailing list