<div dir="ltr">Hello Tim,<br><br><div>Thanks for your reply. Sorry about that I was not explain my question clearly in previous email. I am looking for a target that has both pc-relative load and store and use them for constant pool[1], function pointer[2], {global|static} variable and pointer access[3][4][5]. I am wondering how do they handle different cases in backend. Do you have any target in mind that I should look into?</div><div><br></div><div>Thanks,</div><div>Yi-Hong<br></div>------------------------------<br>[1] constant_pool.c<br><br>double ConstantPool() {<br> return 3.14159;<br>}<br>------------------------------<br>[2] func_ptr.c<br><br>extern void function( );<br>extern void (*ptrfunc) ( );<br><br>void FuncPtr() {<br> ptrfunc=function;<br> (*ptrfunc) ( );<br>}<br>------------------------------<br>[3] {global|static}dst_eq{global|static}_src.c<br><br>{extern|static} int dst;<br>{extern|static} int src;<br><br>void {global|static}_dst_eq_{global|static}_src() {<br> dst = src;<br>}<br>------------------------------<br>[4] {global|static}ptr_eq{global|static}_dst.c<br><br>{extern|static} int *ptr;<br>{extern|static} int dst;<br><br>void {global|static}_ptr_eq_{global|static}_dst() {<br> ptr = &dst;<br>}<br><br>------------------------------<br>[5] {global|static}ptr_eq{global|static}_src.c<br><br>{extern|static} int *ptr;<br>{extern|static} int src;<br><br>void {global|static}_ptr_eq_{global|static}_src() {<br> *ptr = src;<br>}<br>------------------------------<br><code></code></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 4, 2019 at 2:19 PM Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.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">Hi,<br>
<br>
On Wed, 4 Dec 2019 at 18:31, LYU YH via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Is there any exist LLVM Target (backend) that support PC relative load and store? If so, what exactly is the instruction?<br>
<br>
It's pretty common, with diverse uses too (direct/GOT/jump-table<br>
spring to mind). You'll see it in x86 (mov in<br>
<a href="https://godbolt.org/z/qZwSS5" rel="noreferrer" target="_blank">https://godbolt.org/z/qZwSS5</a>), AArch64 (ldr in<br>
<a href="https://godbolt.org/z/BThYU7" rel="noreferrer" target="_blank">https://godbolt.org/z/BThYU7</a>) and I'm sure many others.<br>
<br>
What do you really want to know about the usage and/or instruction?<br>
<br>
Cheers.<br>
<br>
Tim.<br>
</blockquote></div>