<div dir="ltr">Thanks you. I'm new to LLVM backend, so the help is much appreciated.<div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 24, 2015 at 2:12 AM, Matt Arsenault <span dir="ltr"><<a href="mailto:arsenm2@gmail.com" target="_blank">arsenm2@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><br>
> On Oct 23, 2015, at 3:36 AM, 李弘宇 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
<br>
> The first line has the following error message:<br>
><br>
> sop1-playground.s:1:15: error: invalid immediate: only 32-bit values are legal<br>
> s_mov_b32 s0, 0xfe5163ab<br>
<br>
</span>I’ve fixed this problem in  r251132. </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br></blockquote><div>Thanks for the reply and the quick fix of negative 32-bit immediate. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
><br>
> The second line of the assembly has the assertion fail:<br>
><br>
> llvm-mc: /mnt/dm-0/codebase/Compilers/LLVM/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:184: void (anonymous namespace)::AMDGPUOperand::setModifiers(unsigned int): Assertion `isReg()' failed.<br>
><br>
> and reports that 0.5 is "error: invalid operand for instruction"<br>
><br>
> v_mad_f32 v9, 0.5, v5, -v8<br>
<br>
</span>There is a bug with operand parsing when you have immediate operands and source modifiers. I haven’t fixed this yet, but you can work around it for now by not using the source modifier.<br></blockquote><div>I have no idea what to do the work-around. To me the modifier is set when the register has absolute or negate. I traced the code and thought that the problem occurs in the for loop to empty the modifiers for each source (in the AMDGPUAsmParser::parseOperand around line 1040). If I add an if statement like</div><div><br></div><div>if(RegOp.isInlineImm()) // because 0.5 is this case</div><div>    contiune;</div><div><br></div><div>before the statement to empty the modifier (RegOp.setModifiers(0);), </div><div><br></div><div>it obvious does not work and cause the other matching fails. Does it mean to modify other files in other places, such as the VOP3Inst in the SIInstrInfo.td, or is this nothing to do with the MatchOperandParserImpl method or the other tablegen'd files.<br></div><div><br></div><div>I'll be grateful for any idea you might give me to work around this.</div><div><br></div><div>Regards,</div><div><br></div><div><div style="color:rgb(0,0,0);font-size:12.8px">李弘宇 (Li, Hong-Yu)</div><div style="color:rgb(0,0,0);font-size:12.8px">Department of Computer Science & Information Engineering</div><div style="color:rgb(0,0,0);font-size:12.8px">National Taiwan University</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><font color="#888888">
-Matt</font></span></blockquote></div><br></div></div></div>