<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;"><br><div><div>On Aug 1, 2014, at 1:23 PM, kewuzhang <<a href="mailto:kewu.zhang@amd.com">kewu.zhang@amd.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div><br class="Apple-interchange-newline">On Jul 31, 2014, at 7:23 PM, Tom Stellard <<a href="mailto:tom@stellard.net">tom@stellard.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Thu, Jul 31, 2014 at 06:41:06PM -0400, kewuzhang wrote:<br><blockquote type="cite">Hi All,<span class="Apple-converted-space"> </span><br><br>Is it possible to initialize(set up) register attributes when we define an instruction?<br><br>like <br><br>if a register is defined like this:<br><br>" class SC_Register<bits<8> register_num,<span class="Apple-converted-space"> </span><br> <span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>REG_FLAG SC_X,<br><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>REG_FLAG SC_Y,<br><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>REG_FLAG SC_Z,<br><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>REG_FLAG SC_W,<br> <span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>string asmstr> : Register<asmstr><br>{<br><span class="Apple-tab-span" style="white-space: pre;"> </span><br> <span class="Apple-tab-span" style="white-space: pre;"> </span>let HWEncoding{7-0} = register_num; // register_num<br><span class="Apple-tab-span" style="white-space: pre;"> </span>let HWEncoding{8} = SC_X; <br><span class="Apple-tab-span" style="white-space: pre;"> </span>let HWEncoding{9} = SC_Y; <br>…..<br>}”<br><br>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?<br><br>let Constraints = “$dst.SC_X =1, $src.SC_Y =0" in<span class="Apple-converted-space"> </span><br></blockquote><br>This isn't what Constraints are for. Constraints can be either tied<br>operands e.g. $dst = $src or @earlyclober $dst, meaning that the $dst<br>may be written before all source registers are read.<br><br>Can you explain more about what you are trying to do? It looks like you<br>might be trying to force an instruction to uses a specific component of<br>a vector register.<br><br></div></blockquote><div><br></div>Yes, that is pretty much what i want to do. If I can initialize it in the instruction definition stage( it is operation related).</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Then I can directly access it for the machine instruction emit.</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">That would be nice.</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Tks</div></blockquote>You probably want a register class for each component. Then you can restrict an operand to be a specific component’s register class</div><br></body></html>