Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: avoid reloads of temp register on ppc64le, others #17110
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
referenced this issue
Oct 5, 2016
Yeah, this happens because a single AMOVD becomes two real instructions so there's not really a stage where this can be fixed in the current way of working. I guess the move needs to be decomposed earlier.
I think a similar issue affects ARM64 (and probably the other fixed-width instruction architectures).
That would be fine. Any architecture with load/store instructions using a register + small immediate to form the address is eligible for this optimization. I suspect it might need linker or at least assembler assistance, since we'll be emitting relocations along the lines of
and we'd want to usually guess right at the rough magnitude of the difference of those two globals.
changed the title from
cmd/compile: avoid reloads of temp register on ppc64le
cmd/compile: avoid reloads of temp register on ppc64le, others
Nov 2, 2016
Where this problem shows up most often is when referencing constants, which is common in many of functions in the math package. It seems that with constants, they should all be in rodata, and then the base could be the start of the rodata (named: runtime.rodata). Then the offset of the constant from the start of rodata would be known at compile time.
Likewise something similar could be done for static data.
@dr2chase I'd like to try and look at this further and try to get it working. If you have some clues or pointers that would be helpful.