fp-bit.h (pack_d): Constify argument.
* 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. From-SVN: r142999
This commit is contained in:
parent
b295aee2b1
commit
7a7d8fab4c
3 changed files with 30 additions and 20 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 *);
|
||||
|
|
Loading…
Add table
Reference in a new issue