<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi All, <div><br></div><div>Is it possible to initialize(set up) register attributes when we define an instruction?</div><div><br></div><div>like </div><div><br></div><div>if a register is defined like this:</div><div><br></div><div>" class SC_Register<bits<8> register_num, </div><p style="margin: 0px; min-height: 13px;"> <span class="Apple-tab-span" style="white-space:pre"> </span> <b>REG_FLAG SC_X,</b></p><div><b><span class="Apple-tab-span" style="white-space:pre"> </span> REG_FLAG SC_Y,</b></div><div><b><span class="Apple-tab-span" style="white-space:pre"> </span> REG_FLAG SC_Z,</b></div><div><b><span class="Apple-tab-span" style="white-space: pre;"> </span> REG_FLAG SC_W,</b></div><p style="margin: 0px; min-height: 13px;"> <span class="Apple-tab-span" style="white-space:pre"> </span> string asmstr> : Register<asmstr></p><div style="margin: 0px;">{</div><div style="margin: 0px; min-height: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span></div><div style="margin: 0px;"> <span class="Apple-tab-span" style="white-space:pre"> </span>let HWEncoding{7-0} = register_num; // register_num</div><div style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre"> </span>let HWEncoding{8} = SC_X; </div><div style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre"> </span>let HWEncoding{9} = SC_Y; </div><div style="margin: 0px;">…..</div><div style="margin: 0px;">}”</div><div style="margin: 0px;"><font face="Verdana"><br></font></div><div style="margin: 0px;"><font face="Verdana">can I set up the input/ouput register flags like this? or some other way in codegen to make the register flags are set up based on the instructions?</font></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><div style="margin: 0px; font-size: 11px; font-family: Menlo;">let Constraints = “<b>$dst.SC_X =1, $src.SC_Y =0</b>" in </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> def GENri : my_instr <op, 0, (outs GPR_V4_R32:$dst), (ins GPR_V4_R32:$src),</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> !strconcat(asmstr, " $dst, ""$src"), </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> [(set v4i32:$dst, (node v4i32:$src)]>;</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"> <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">}</p><div><br></div><div><br></div><div><br></div><div>tks</div><div><br></div><div><br></div><div>kevin</div></div></body></html>