<div dir="ltr">Thank you guys for the input.<div>Being able to specify arbitrary range (relative or absolute) makes perfect sense to me. As for the format I would propose to simply use the same as <a href="https://llvm.org/docs/LangRef.html#absolute-symbol-metadata" target="_blank">absolute_symbol</a>.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 3, 2021 at 1:45 AM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Wed, Sep 1, 2021 at 5:49 PM Philip Reames via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<p>All of the above is a really involved way of saving that I think
you need to change your spelling on the attribute a bit. I think
we need to be able to support fairly arbitrary restrictions on the
relative range, and then leave it up to the code generator which
option it actually picks. As a strawman, how about the following
syntax:</p>
<p>call void @foo() target-address-relative-bound<a href="tel:(214)%20748-3648" value="+12147483648" target="_blank">(-2147483648</a>,
<a href="tel:(214)%20748-3647" value="+12147483647" target="_blank">2147483647</a>)</p>
<p>OR</p>
<p>declare void @foo() address-absolute-bound(X, X + 100MB)</p>
<p></p></div></blockquote><div>I agree, this makes sense to me. My bikeshedding suggestion is to store the offsets in log2 form. Something like "target-pc-rel"(32) , "target-pc-rel"(12), "target-pc-abs"(32). This should generalize from X86 to ARM/AArch64 and other ISAs with shorter displacements. Later you could imagine throwing in other relocation variants like "tocrel", "gotrel", or anything you need for your particular architecture.</div></div></div>
</blockquote></div>