Hi!

On Mon, Oct 11, 2021 at 12:31:07PM -0500, Paul A. Clarke wrote:
> On Mon, Oct 11, 2021 at 11:28:39AM -0500, Segher Boessenkool wrote:
> > > Very similar methods are used in glibc today. Are those broken?
> > 
> > Maybe.
> 
> Ouch.

So show the code?

> > If you get a real (i.e. not inline) function call there, that
> > can save you often.
> 
> Calling a real function in order to execute a single instruction is
> sub-optimal. ;-)

Calling a real function (that does not even need a stack frame, just a
blr) is not terribly expensive, either.

> > > Would creating a __builtin_mffsce be another solution?
> > 
> > Yes.  And not a bad idea in the first place.
> 
> The previous "Nope" and this "Yes" seem in contradiction. If there is no
> difference between "asm" and builtin, how does using a builtin solve the
> problem?

You will have to make the builtin solve it.  What a builtin can do is
virtually unlimited.  What an asm can do is not: it just outputs some
assembler language, and does in/out/clobber constraints.  You can do a
*lot* with that, but it is much more limited than everything you can do
in the compiler!  :-)

The fact remains that there is no way in RTL (or Gimple for that matter)
to express things like rounding mode changes.  You will need to
artificially make some barriers.


Segher

Reply via email to