This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libgfortran] PR 16137: libgfortran on non-C99 targets


On Fri, Aug 06, 2004 at 10:30:25PM +0100, Paul Brook wrote:
> > Would this be acceptable on all platforms, or would it be better to
> > #ifdef the "volatile" for just IA-32?
> 
> Ok with a comment saying why it's marked volatile. I've done something
> similar elsewhere.

A better solution is

static inline float
force_round_float (float x)
{
  if (!__builtin_constant_p (x) && FLT_EVAL_METHOD != 0)
    asm ("" : "=m"(x) : "m"(x));
  return x;
}

used as needed.  Volatile on "delta" doesn't actually address the
situation at the correct point, I don't think.

We also don't pay the penalty on well-behaved targets.



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]