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: [PATCH] middle end, s390: optimization for builtin isnan


Ian Lance Taylor <iant@google.com> wrote on 07.08.2007 03:26:28:

> Wolfgang Gellerich<gellerich@de.ibm.com> writes:
>
> > This patch introduces a new target hook allowing to optimize the
> > implementation of builtin function isnan on platforms like s390 where
> > arithmetic operations set the condition code when the result was NaN.
It
> > bootstraps on Intel and s390 and does not introduce new test case
failures.
>
> It seems to me that we should handle this by treating isnan as a unary
> operator which may be implemented in the MD file.  E.g., implement
> isnansf1 and isnandf1, with optabs.  I don't see why a target hook is
> the right thing here.

Hi Ian, many for your comments! However, what would we gain from
implementing isnan as operator, and what do you consider as major
disadvantages of using the new target hook? The reason why I chose the
implementation I sent is that the current implementation was hard-wired at
a rather early stage. I thought that there might be a reason for this, it
may enable further optimizations in some cases or on some platforms. Also,
the target hook approach has the advantage that is allows s390 (and other
platforms) to add their optimizations while not causing any changes for
platforms that are happy with the current implementation.

Best regards, Wolfgang


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