On Tue, Apr 21, 2020 at 02:03:34PM -0400, Michael Meissner wrote: > On Tue, Apr 07, 2020 at 05:58:01PM -0500, Segher Boessenkool wrote: > > > + /* Enable -mprefixed by default on 64-bit 'future' systems. */ > > > + if (TARGET_FUTURE && TARGET_POWERPC64 > > > + && (rs6000_isa_flags_explicit & OPTION_MASK_PREFIXED) == 0) > > > + rs6000_isa_flags |= OPTION_MASK_PREFIXED; > > > > I don't understand why only for 64 bit? > > I have doubts whether PC-relative really works with 32-bit. I suspect that > you > may see some hidden wrap around issues if an address crosses the 32-bit > boundary.
Which is undefined behaviour *anyway*? In C, etc. The Power ISA makes it very clear how this behaves, though: 5.7.1 32-Bit Mode The computation of the 64-bit effective address is inde- pendent of whether the thread is in 32-bit mode or 64-bit mode. In 32-bit mode (MSR[SF]=0), the high-order 32 bits of the 64-bit effective address are treated as zeros for the purpose of addressing storage. This applies to both data accesses and instruction fetches. It applies independent of whether address translation is enabled or disabled. This truncation of the effective address is the only respect in which storage accesses in 32-bit mode differ from those in 64-bit mode. > Given the simulator I have access to only runs Linux 64-bit, I have > no way of testing it. I would prefer to not put in code that I can't test. Think of it as "this cannot happen", if that makes you feel better? :-) > But if the only way to get the patch in is to remove the test, I can remove > it. Segher