On 7 December 2015 at 14:53, Edward Nevill edward.nevill@linaro.org wrote:
adrp, x0, dest add x0, x0, #:lo12:dest
Thanks! Thats the syntax I wanted.
The use case is I want to benchmark this as a way of generating far calls, for use within the JIT for when code cache becomes > 128m.
At the moment we generate trampolines
tramp: ldr Xn, here br Xn here .dword dest
and then do
bl dest
but if on relocation in the code cache it doen't reach then relocate this to
bl tramp
but I think it may be better to simply always generate
adrp Xn, dest add Xn, Xn, :lo12:dest blr Xn
I don't suppose the branch predictor would like that very much, though. Can't you keep the original arrangement, and use this sequence instead? Or use the new sequence unconditionally, but nop out the add instruction and change the blr for a straight bl if the target is in range?