diff mbox

[RS6000] Enable long-double support for little-endian

Message ID 20130604131115.GB6878@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra June 4, 2013, 1:11 p.m. UTC
This enables long double support for little-endian.  It assumes we keep
the same ordering as big-endian, ie. the first double is the larger
magnitude or inf/nan.   Bootstrapped powerpc64-linux.  OK to apply?

	* config/rs6000/ibm-ldouble.c: Enable for little-endian.

Comments

David Edelsohn June 4, 2013, 1:57 p.m. UTC | #1
On Tue, Jun 4, 2013 at 9:11 AM, Alan Modra <amodra@gmail.com> wrote:
> This enables long double support for little-endian.  It assumes we keep
> the same ordering as big-endian, ie. the first double is the larger
> magnitude or inf/nan.   Bootstrapped powerpc64-linux.  OK to apply?
>
>         * config/rs6000/ibm-ldouble.c: Enable for little-endian.
>
> Index: libgcc/config/rs6000/ibm-ldouble.c
> ===================================================================
> --- libgcc/config/rs6000/ibm-ldouble.c  (revision 199174)
> +++ libgcc/config/rs6000/ibm-ldouble.c  (working copy)
> @@ -42,10 +42,10 @@
>     represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
>     NaN is don't-care.
>
> -   This code currently assumes big-endian.  */
> +   This code currently assumes the most significant double is in
> +   the lower numbered register or lower addressed memory.  */
>
> -#if (!defined (__LITTLE_ENDIAN__) \
> -     && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)))
> +#if defined (__MACH__) || defined (__powerpc__) || defined (_AIX)
>
>  #define fabs(x) __builtin_fabs(x)
>  #define isless(x, y) __builtin_isless (x, y)

This is okay as an interim solution.

Thanks, David
diff mbox

Patch

Index: libgcc/config/rs6000/ibm-ldouble.c
===================================================================
--- libgcc/config/rs6000/ibm-ldouble.c	(revision 199174)
+++ libgcc/config/rs6000/ibm-ldouble.c	(working copy)
@@ -42,10 +42,10 @@ 
    represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
    NaN is don't-care.
 
-   This code currently assumes big-endian.  */
+   This code currently assumes the most significant double is in
+   the lower numbered register or lower addressed memory.  */
 
-#if (!defined (__LITTLE_ENDIAN__) \
-     && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)))
+#if defined (__MACH__) || defined (__powerpc__) || defined (_AIX)
 
 #define fabs(x) __builtin_fabs(x)
 #define isless(x, y) __builtin_isless (x, y)