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;

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.

Remove the parentheses around the operands. This should be (set i64:$dst), (add i16:$rs1, i16:$rs2)