<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello,</div>
<div>I'm currently working on a custom backend that supports 128-bit integers natively. For eample,</div>
<div>mov r1, <some 128 bit int> or add r1, <some 128 bit int> are supported.</div>
<div> </div>
<div>However, when lowering instruction with 128 bit immediate operands LLVM asserts in InstrEmitter::AddOperand when doing</div>
<div>MIB.addImm(C->getSExtValue()); as the imm does not fit into 64-bit.</div>
<div> </div>
<div>The way I'm doing it currently is:</div>
<div>-------------------------------------------------------</div>
<div>XXXInstrInfo.td:</div>
<div> </div>
<div>def i128imm : Operand<i128>;</div>
<div>def STRi128 : XXXlInst<(outs GPR128:$dst),<br/>
(ins i128imm:$imm),<br/>
"mov $dst, $imm", []>;</div>
<div>-------------------------------------------------------</div>
<div>XXXISelLowering.cpp:</div>
<div> </div>
<div>
<div>setOperationAction(ISD::Constant, MVT::i128, Custom);</div>
</div>
<div> </div>
<div>SDValue XXXTargetLowering::LowerConstant(SDValue Op, SelectionDAG &DAG) const {<br/>
SDLoc DL(Op);<br/>
ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op);<br/>
return SDValue(DAG.getMachineNode(<br/>
XXX::STRi128, DL, MVT::i128,<br/>
DAG.getTargetConstant(C->getAPIntValue(), DL, MVT::i128)),<br/>
0);</div>
<div>}</div>
<div>-------------------------------------------------------</div>
<div> </div>
<div>I'm wondering what the proper way for supporting such instructions is?</div>
<div>Thanks for your help,</div>
<div>Wolfgang</div></div></body></html>