[Bug target/98519] rs6000: @pcrel unsupported on this instruction error in pveclib
meissner at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 2 04:17:37 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98519
--- Comment #21 from Michael Meissner <meissner at gcc dot gnu.org> ---
I have patches that fix the problem in the hook.
My original idea of not allowing prefixed insns in the hook doesn't work
because when the hook is called, it only sees pseudo registers.
So what my patch does instead is to change the constraints. It makes 3 new
constraints:
em -- Like m, but do not allow prefixed memory
eo -- Like o, but do not allow prefixed memory
ep -- Only accept prefixed memory
Now, 'ep' isn't needed, but I added it to give people a way to write asm using
prefixed instructions. If 'eo' and 'em' are ok, but we don't want to add 'ep',
that is fine, it is simple to remove.
The hook then goes through the constraints, and changes 'm' to 'em', and 'o' to
'eo'. That way old memory asm's won't see prefixed addresses. If the register
allocator sees a prefixed address, it takes the address using 'pla' and
substitutes a base register.
In know in general, the preference is not to add new constraints, but I feel by
adding the constraints, it makes it to be a simpler problem that writing a new
RTL pass or adding new target hooks.
More information about the Gcc-bugs
mailing list