Peter Lawrence via llvm-dev
2015-Sep-26 01:29 UTC
[llvm-dev] simple "InstrInfo.td" question
having trouble getting my "InstrInfo.td" file to build... if I follow the example in MSP430, where they use RegisterClass in their [...] patterns def DataRegs : RegisterClass<"Xmc", [i16], 16, (add R0, R1, R2, R3, R4, R5, R6, R7)>; def ADD : FMT_R <0x4000, (outs datareg:$dst), (ins datareg:$rs1, datareg:$rs2), "add $dst,$rs1,$rs2", [(set (DataRegs:$dst), (add (DataRegs:$rs1), (DataRegs:$rs2)))]>; then I get this error [ 40%] Building XmcGenInstrInfo.inc... ADD: Included from llvm-3.6.2.src/lib/Target/Xmc/Xmc.td:49: llvm-3.6.2.src/lib/Target/Xmc/XmcInstrInfo.td:163:1: error: In ADD: Unrecognized node 'DataRegs'! if I follow the example in Mips, where they use RegisterOperand in their [...] patterns def datareg : RegisterOperand<DataRegs>; def ADD : FMT_R <0x4000, (outs datareg:$dst), (ins datareg:$rs1, datareg:$rs2), "add $dst,$rs1,$rs2", [(set (datareg:$dst), (add (datareg:$rs1), (datareg:$rs2)))]>; then I get this error [ 40%] Building XmcGenInstrInfo.inc... ADD: Included from llvm-3.6.2.src/lib/Target/Xmc/Xmc.td:49: llvm-3.6.2.src/lib/Target/Xmc/XmcInstrInfo.td:163:1: error: In ADD: Unrecognized node 'datareg'! if I follow the example of Sparc, where they use ValueType in their [...] patterns: # def i16 : ValueType<16 , 3>; # see include "llvm/CodeGen/ValueTypes.td" def ADD : FMT_R <0x4000, (outs datareg:$dst), (ins datareg:$rs1, datareg:$rs2), "add $dst,$rs1,$rs2", [(set (i16:$dst), (add (i16:$rs1), (i16:$rs2)))]>; then I get this error [ 40%] Building XmcGenInstrInfo.inc... ADD: Included from llvm-3.6.2.src/lib/Target/Xmc/Xmc.td:49: llvm-3.6.2.src/lib/Target/Xmc/XmcInstrInfo.td:163:1: error: In ADD: Type cast only takes one operand! what am I missing ??? TIA, Peter Lawrence. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150926/f8242c24/attachment-0001.html>
Matt Arsenault via llvm-dev
2015-Sep-26 03:57 UTC
[llvm-dev] simple "InstrInfo.td" question
> On Sep 25, 2015, at 6:29 PM, Peter Lawrence via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > > if I follow the example of Sparc, where they use ValueType in their [...] patterns: > > # def i16 : ValueType<16 , 3>; # see include “llvm/CodeGen/ValueTypes.td” > def ADD : FMT_R <0x4000, (outs datareg:$dst), (ins datareg:$rs1, datareg:$rs2), > "add $dst,$rs1,$rs2", > [(set (i16:$dst), (add (i16:$rs1), (i16:$rs2)))]>; > > then I get this error > [ 40%] Building XmcGenInstrInfo.inc... > ADD: Included from llvm-3.6.2.src/lib/Target/Xmc/Xmc.td:49: > llvm-3.6.2.src/lib/Target/Xmc/XmcInstrInfo.td:163:1: error: In ADD: Type cast only takes one operand!Remove the parentheses around the operands. This should be (set i64:$dst), (add i16:$rs1, i16:$rs2) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150925/cb5db07e/attachment.html>