<div dir="ltr"><div>Hi, </div><div><br></div><div>I'm working on a project that use llvm openrisc beckend (currently not part of the upstream). Right now I'm looking at a bug where llc generates memory instructions that has out-of-range displacement, for example</div><div><br></div><div><a href="http://l.sb">l.sb</a> 37668(r1), r2    in which 37668 is a 17 bit signed integer, but the instruction only allows 16 bit signed displacement. As a result, after running through the assembler, 37668 is encoded wrongly into -27668 because it's being sign extended. </div><div><br></div><div>Can someone point to me where should I add code to do the check, any API I can use ?</div><div><br></div><div>Thanks,</div><div>Patrick</div></div>