This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PowerPC floating point little-endian [12 of 15]
- From: Andreas Jaeger <aj at suse dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 10 Jul 2013 08:03:52 +0200
- Subject: Re: PowerPC floating point little-endian [12 of 15]
- References: <20130710012435 dot GN2602 at bubble dot grove dot modra dot org> <20130710013051 dot GY2602 at bubble dot grove dot modra dot org>
On 07/10/2013 03:30 AM, Alan Modra wrote:
> Fixes for little-endian in 32-bit assembly.
>
> 2013-07-10 Alan Modra <amodra@gmail.com>
>
> * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Load little-endian
> words of double from correct stack offsets.
> * sysdeps/powerpc/powerpc32/fpu/s_copysignl.S: Likewise.
> * sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Likewise.
> * sysdeps/powerpc/powerpc32/fpu/s_lround.S: Likewise.
> * sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Likewise.
> * sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Likewise.
> * sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Likewise.
> * sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Likewise.
> * sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
> * sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise.
> * sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Likewise.
> * sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Likewise.
> * sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Likewise.
> * sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise.
> * sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
>
> diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
> index 840891f..2dc1d24 100644
> --- a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
> +++ b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
> @@ -29,7 +29,11 @@ ENTRY(__copysign)
> stwu r1,-16(r1)
> cfi_adjust_cfa_offset (16)
> stfd fp2,8(r1)
> +#ifdef __LITTLE_ENDIAN__
> + lwz r3,12(r1)
> +#else
> lwz r3,8(r1)
> +#endif
Since it's in all cases 8 vs. 12, I wonder whether using a macro would
be served better.
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126