summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-01 22:12:50 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-01 22:12:50 +0000
commit5c8520a4fbdb4c71c5fd64d6d9f1fc0db3d268c5 (patch)
tree427e2a9fd502b5c07bc77d559fdc611f0360e168
parentd241bf0d8c67ab7ab3c1963303d9515dbe944c11 (diff)
downloadgcc-5c8520a4fbdb4c71c5fd64d6d9f1fc0db3d268c5.tar.gz
* config/fp-bit.h (pack_d): Constify argument.
* config/fp-bit.c (makenan): Constify return type. Remove casts. (isnan): Constify argument. (isinf): Likewise. (iszero): Likewise. (pack_d): Likewise. (_fpadd_parts): Constify return type. (_fpmul_parts): Likewise. (_fpdiv_parts): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142999 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/fp-bit.c34
-rw-r--r--gcc/config/fp-bit.h4
3 files changed, 30 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 949c8e105e6..8cb8a92304a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2009-01-02 Ben Elliston <bje@au.ibm.com>
+
+ * config/fp-bit.h (pack_d): Constify argument.
+ * config/fp-bit.c (makenan): Constify return type. Remove casts.
+ (isnan): Constify argument.
+ (isinf): Likewise.
+ (iszero): Likewise.
+ (pack_d): Likewise.
+ (_fpadd_parts): Constify return type.
+ (_fpmul_parts): Likewise.
+ (_fpdiv_parts): Likewise.
+
2009-01-01 Jakub Jelinek <jakub@redhat.com>
PR c/36489
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 1da69b2cb76..fd56be77a64 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -139,22 +139,21 @@ extern const fp_number_type __thenan_df;
#endif
INLINE
-static fp_number_type *
+static const fp_number_type *
makenan (void)
{
- /* Discard the const qualifier... */
#ifdef TFLOAT
- return (fp_number_type *) (& __thenan_tf);
+ return & __thenan_tf;
#elif defined FLOAT
- return (fp_number_type *) (& __thenan_sf);
+ return & __thenan_sf;
#else
- return (fp_number_type *) (& __thenan_df);
+ return & __thenan_df;
#endif
}
INLINE
static int
-isnan ( fp_number_type * x)
+isnan (const fp_number_type *x)
{
return __builtin_expect (x->class == CLASS_SNAN || x->class == CLASS_QNAN,
0);
@@ -162,7 +161,7 @@ isnan ( fp_number_type * x)
INLINE
static int
-isinf ( fp_number_type * x)
+isinf (const fp_number_type * x)
{
return __builtin_expect (x->class == CLASS_INFINITY, 0);
}
@@ -171,7 +170,7 @@ isinf ( fp_number_type * x)
INLINE
static int
-iszero ( fp_number_type * x)
+iszero (const fp_number_type * x)
{
return x->class == CLASS_ZERO;
}
@@ -199,11 +198,11 @@ clzusi (USItype n)
return __clzsi2 (n);
}
-extern FLO_type pack_d ( fp_number_type * );
+extern FLO_type pack_d (const fp_number_type * );
#if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf)
FLO_type
-pack_d ( fp_number_type * src)
+pack_d (const fp_number_type *src)
{
FLO_union_type dst;
fractype fraction = src->fraction.ll; /* wasn't unsigned before? */
@@ -596,7 +595,7 @@ unpack_d (FLO_union_type * src, fp_number_type * dst)
#endif /* L_unpack_df || L_unpack_sf */
#if defined(L_addsub_sf) || defined(L_addsub_df) || defined(L_addsub_tf)
-static fp_number_type *
+static const fp_number_type *
_fpadd_parts (fp_number_type * a,
fp_number_type * b,
fp_number_type * tmp)
@@ -734,7 +733,6 @@ _fpadd_parts (fp_number_type * a,
tmp->normal_exp++;
}
return tmp;
-
}
FLO_type
@@ -743,7 +741,7 @@ add (FLO_type arg_a, FLO_type arg_b)
fp_number_type a;
fp_number_type b;
fp_number_type tmp;
- fp_number_type *res;
+ const fp_number_type *res;
FLO_union_type au, bu;
au.value = arg_a;
@@ -763,7 +761,7 @@ sub (FLO_type arg_a, FLO_type arg_b)
fp_number_type a;
fp_number_type b;
fp_number_type tmp;
- fp_number_type *res;
+ const fp_number_type *res;
FLO_union_type au, bu;
au.value = arg_a;
@@ -781,7 +779,7 @@ sub (FLO_type arg_a, FLO_type arg_b)
#endif /* L_addsub_sf || L_addsub_df */
#if defined(L_mul_sf) || defined(L_mul_df) || defined(L_mul_tf)
-static inline __attribute__ ((__always_inline__)) fp_number_type *
+static inline __attribute__ ((__always_inline__)) const fp_number_type *
_fpmul_parts ( fp_number_type * a,
fp_number_type * b,
fp_number_type * tmp)
@@ -949,7 +947,7 @@ multiply (FLO_type arg_a, FLO_type arg_b)
fp_number_type a;
fp_number_type b;
fp_number_type tmp;
- fp_number_type *res;
+ const fp_number_type *res;
FLO_union_type au, bu;
au.value = arg_a;
@@ -965,7 +963,7 @@ multiply (FLO_type arg_a, FLO_type arg_b)
#endif /* L_mul_sf || L_mul_df || L_mul_tf */
#if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf)
-static inline __attribute__ ((__always_inline__)) fp_number_type *
+static inline __attribute__ ((__always_inline__)) const fp_number_type *
_fpdiv_parts (fp_number_type * a,
fp_number_type * b)
{
@@ -1067,7 +1065,7 @@ divide (FLO_type arg_a, FLO_type arg_b)
{
fp_number_type a;
fp_number_type b;
- fp_number_type *res;
+ const fp_number_type *res;
FLO_union_type au, bu;
au.value = arg_a;
diff --git a/gcc/config/fp-bit.h b/gcc/config/fp-bit.h
index 5f9082cd301..289ed049497 100644
--- a/gcc/config/fp-bit.h
+++ b/gcc/config/fp-bit.h
@@ -415,10 +415,10 @@ typedef union
}
FLO_union_type;
-/* Prototypes */
+/* Prototypes. */
#if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf)
-extern FLO_type pack_d (fp_number_type *);
+extern FLO_type pack_d (const fp_number_type *);
#endif
extern void unpack_d (FLO_union_type *, fp_number_type *);