This is the mail archive of the
mailing list for the GCC project.
Re: [RFC Patch]: Implement remainder() as built-in function [PR fortran/24518]
- From: Roger Sayle <roger at eyesopen dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: FX Coudert <fxcoudert at gmail dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 23 Oct 2006 19:15:15 -0600 (MDT)
- Subject: Re: [RFC Patch]: Implement remainder() as built-in function [PR fortran/24518]
On Mon, 23 Oct 2006, Uros Bizjak wrote:
> 1) missing __builtin_remainder() optab description (solved by attached patch)
The documentation I have have here ("man remainder" on linux) states
that semantically the C99 "remainder" function and the BSD "drem"
function are equivalent, and one is a synonym for the other. Hence,
we shouldn't need two optabs and two sets of x86 expanders to handle
these functions. Could you tweak your patch so these builtins share
a single optab/expander internally?
All the other bits look reasonable. But it might be nice if we changed
the errno handling to check whether y is zero ourselves before performing
the operation, rather than test for NaN afterwards. This should be
faster, and may even be able to be optimized away during the RTL
We should also think a little about Richard's suggestion of perhaps
being more aggresive about ignoring errno when the language standards
state that this isn't a strict requirement. However, that should
probably be a independent patch (perhaps with its own enhancement
PR?), maybe even a new command line option, -fstrict-errno-math?.
Thanks in advance,