+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
#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);
INLINE
static int
-isinf ( fp_number_type * x)
+isinf (const fp_number_type * x)
{
return __builtin_expect (x->class == CLASS_INFINITY, 0);
}
INLINE
static int
-iszero ( fp_number_type * x)
+iszero (const fp_number_type * x)
{
return x->class == CLASS_ZERO;
}
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? */
#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)
tmp->normal_exp++;
}
return tmp;
-
}
FLO_type
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;
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;
#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)
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;
#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)
{
{
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;