This is the mail archive of the
mailing list for the GCC project.
Re: fabs() intrinsic totally broken in P4, as of 2002-02-11
- From: Jan Hubicka <jh at suse dot cz>
- To: Tom Womack <tom at womack dot net>
- Cc: gcc at gcc dot gnu dot org, Jan Hubicka <jh at suse dot cz>, rth at cygnus dot com
- Date: Sun, 17 Feb 2002 17:35:23 +0100
- Subject: Re: fabs() intrinsic totally broken in P4, as of 2002-02-11
- References: <firstname.lastname@example.org>
> ANDN is not a commutative operation, so this strategy would in any case
> require lots of reloads of the magic constant; I don't quite see why the
> compiler doesn't use the complement of the magic constant and normal AND
Richard, I am just looking at this issue.
We expand the abs pattern as FP negated and of the value and negative zero,
that has the advantage that we can represent the constant as CONST_DOUBLE
Perhaps, to save some reloading for multiple fabs instructions, it would make
more sense to use commutative and on negation of negative zero to avoid
loading of the constant again and again.
The drawback is that we can't represent the constant as FP value as it would
get promptly normalized, so we can load it as SImode or DImode and then
use it as subreg for andti pattern, but this produces different SSE and
instruction and reformating penalty.
I can create the "half fp" and pattern having subreg only in one operand,
but that would run into "half reformating penalty" for the loaded constant -
it is almost always fruitfull to load the constant as 128bit memory operands
are somewhat expensive.
Do you see any way out?