[PATCH 05/34] rs6000: Add available-everywhere and ancient builtins

Segher Boessenkool segher@kernel.crashing.org
Tue Aug 10 20:33:25 GMT 2021

On Tue, Aug 10, 2021 at 01:56:58PM -0500, Bill Schmidt wrote:
> On 8/10/21 1:38 PM, Segher Boessenkool wrote:
> >On Thu, Jul 29, 2021 at 08:30:52AM -0500, Bill Schmidt wrote:
> >>	* config/rs6000/rs6000-builtin-new.def: Add always, power5, and
> >>	power6 stanzas.
> >>+  unsigned long __builtin_ppc_mftb ();
> >>+    MFTB rs6000_mftb_di {32bit}
> >I'm not sure what {32bit} means...  The builtin exists on both 32-bit
> >and on 64-bit, and returns what is a "long" in both cases.  The point
> >is that it is just a single "mfspr 268" always, which is fast, and
> >importantly has fixed and low latency.
> Right.  The implementation of this thing is that we have two different 
> patterns in the machine description that get invoked depending on 
> whether the target is 32-bit or 64-bit.  The syntax in the built-ins 
> file only allows for one pattern.  So the {32bit} flag allows us to 
> perform special processing for TARGET_32BIT, in this case to override 
> the pattern.  Later in the patch series you'll find:

[ snip ]

Ah ok.

> I'm sure there's a better way of dealing with the mode dependency on 
> TARGET_32BIT, but for now this matches the old behavior as closely as 
> possible. I'm happy to take suggestions on this.

You could try to use something with Pmode, but it's not going to be
pretty in any case.  You also might have to deal with -m32 -mpowerpc64,
depending on if the original did.


More information about the Gcc-patches mailing list