This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add __abssf2 and __absdf2 to libgcc
- From: Roger Sayle <roger at www dot eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 4 Dec 2002 10:34:23 -0700 (MST)
- Subject: Re: [PATCH] Add __abssf2 and __absdf2 to libgcc
Hi Richard,
> On Tue, Dec 03, 2002 at 10:29:24PM -0700, Roger Sayle wrote:
> > This patch adds the functions __abssf2, __absdf2, __absxf2 and
> > __abstf2 to the libgcc API, and provides generic implmentations
> > in GCC's software floating point library.
>
> Can you think of any reason why we shouldn't implement these
> inline for all targets?
I must admit that would be a much better solution. Performing
inline ANDs to implement __abs?f2 and XORs to implement __neg?f2.
> I mean, how hard is "reg &= 0x7fffffff"?
But this is the bit that still worries me. I think this is
made far harder by the variety of GCC's targets. Consider
targets with hardware floating point but without an abs?f2
pattern. In these cases, incoming "reg" in expand_abs may
not support bit-wise and and/or xor operations. It looks
like the code in store_bit_field doesn't like str_rtx having
MODE_FLOAT:
>> /* Else we've got some float mode source being extracted into
>> a different float mode destination -- this combination of
>> subregs results in Severe Tire Damage. */
>> abort ();
I'm not even sure how we encode reinterpretation: i.e. changing an
[sd]f mode pseudo into a [sd]i mode bit-pattern and back again
without conversion/interpretation. We often may not have an integer
mode of the same size as (or big enough to hold) a floating point
mode. We could always force to memory but on some machines
this may be slower than the zero comparison, conditional
jump and negation, and on others where FLOAT_MODE values really
are stored in general register's we'd lose much of the efficiency.
I'll see what I can come up with, but any more pointers you can
provide would be very much appreciated.
Roger
--