This is the mail archive of the gcc@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: fabs() intrinsic totally broken in P4, as of 2002-02-11


> 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
> instructions.

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
value.

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?
> 
> Tom


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