--- tme/ic/ieee754/ieee754-ops-auto.c 2018/04/24 16:42:02 1.1.1.2 +++ tme/ic/ieee754/ieee754-ops-auto.c 2018/04/24 16:44:00 1.1.1.3 @@ -1,6 +1,6 @@ /* automatically generated by ieee754-ops-auto.sh, do not edit! */ #include -_TME_RCSID("$Id: ieee754-ops-auto.c,v 1.1.1.2 2018/04/24 16:42:02 root Exp $"); +_TME_RCSID("$Id: ieee754-ops-auto.c,v 1.1.1.3 2018/04/24 16:44:00 root Exp $"); #include "softfloat-tme.h" #include @@ -585,6 +585,41 @@ _tme_ieee754_strict_single_to_int32(stru } } +#if defined(TME_HAVE_INT64_T) + +/* this does a strict compliance single-precision to-int64: */ +static void +_tme_ieee754_strict_single_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst) +{ + tme_uint32_t src0_buffer; + int exceptions; + + /* enter softfloat operation: */ + tme_mutex_lock(&tme_ieee754_global_mutex); + tme_ieee754_global_ctl = ieee754_ctl; + tme_ieee754_global_exceptions = 0; + ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat; + + /* assume that this operation raises no exceptions: */ + exceptions = 0; + + /* the operation: */ + *dst = float32_to_int64((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer)))); + + /* leave softfloat operation: */ + tme_ieee754_global_ctl = NULL; + exceptions |= tme_ieee754_global_exceptions; + tme_mutex_unlock(&tme_ieee754_global_mutex); + ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL; + + /* signal any exceptions: */ + if (exceptions != 0) { + (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions); + } +} + +#endif /* defined(TME_HAVE_INT64_T) */ + /* this does a strict compliance double-precision add: */ static void _tme_ieee754_strict_double_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst) @@ -1167,6 +1202,41 @@ _tme_ieee754_strict_double_to_int32(stru #if defined(TME_HAVE_INT64_T) +/* this does a strict compliance double-precision to-int64: */ +static void +_tme_ieee754_strict_double_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst) +{ + union tme_value64 src0_buffer; + int exceptions; + + /* enter softfloat operation: */ + tme_mutex_lock(&tme_ieee754_global_mutex); + tme_ieee754_global_ctl = ieee754_ctl; + tme_ieee754_global_exceptions = 0; + ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat; + + /* assume that this operation raises no exceptions: */ + exceptions = 0; + + /* the operation: */ + *dst = float64_to_int64((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer)))); + + /* leave softfloat operation: */ + tme_ieee754_global_ctl = NULL; + exceptions |= tme_ieee754_global_exceptions; + tme_mutex_unlock(&tme_ieee754_global_mutex); + ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL; + + /* signal any exceptions: */ + if (exceptions != 0) { + (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions); + } +} + +#endif /* defined(TME_HAVE_INT64_T) */ + +#if defined(TME_HAVE_INT64_T) + /* this does a strict compliance extended80-precision add: */ static void _tme_ieee754_strict_extended80_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst) @@ -1799,6 +1869,41 @@ _tme_ieee754_strict_extended80_to_int32( #if defined(TME_HAVE_INT64_T) +/* this does a strict compliance extended80-precision to-int64: */ +static void +_tme_ieee754_strict_extended80_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst) +{ + struct tme_float_ieee754_extended80 src0_buffer; + int exceptions; + + /* enter softfloat operation: */ + tme_mutex_lock(&tme_ieee754_global_mutex); + tme_ieee754_global_ctl = ieee754_ctl; + tme_ieee754_global_exceptions = 0; + ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat; + + /* assume that this operation raises no exceptions: */ + exceptions = 0; + + /* the operation: */ + *dst = floatx80_to_int64((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer)))); + + /* leave softfloat operation: */ + tme_ieee754_global_ctl = NULL; + exceptions |= tme_ieee754_global_exceptions; + tme_mutex_unlock(&tme_ieee754_global_mutex); + ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL; + + /* signal any exceptions: */ + if (exceptions != 0) { + (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions); + } +} + +#endif /* defined(TME_HAVE_INT64_T) */ + +#if defined(TME_HAVE_INT64_T) + /* this does a strict compliance quad-precision add: */ static void _tme_ieee754_strict_quad_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst) @@ -2429,6 +2534,41 @@ _tme_ieee754_strict_quad_to_int32(struct } } +#if defined(TME_HAVE_INT64_T) + +/* this does a strict compliance quad-precision to-int64: */ +static void +_tme_ieee754_strict_quad_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst) +{ + struct tme_float_ieee754_quad src0_buffer; + int exceptions; + + /* enter softfloat operation: */ + tme_mutex_lock(&tme_ieee754_global_mutex); + tme_ieee754_global_ctl = ieee754_ctl; + tme_ieee754_global_exceptions = 0; + ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat; + + /* assume that this operation raises no exceptions: */ + exceptions = 0; + + /* the operation: */ + *dst = float128_to_int64((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer)))); + + /* leave softfloat operation: */ + tme_ieee754_global_ctl = NULL; + exceptions |= tme_ieee754_global_exceptions; + tme_mutex_unlock(&tme_ieee754_global_mutex); + ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL; + + /* signal any exceptions: */ + if (exceptions != 0) { + (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions); + } +} + +#endif /* defined(TME_HAVE_INT64_T) */ + /* the strict compliance operations: */ _tme_const struct tme_ieee754_ops tme_ieee754_ops_strict = { @@ -2545,7 +2685,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_single_to_int32, /* this does a strict compliance single-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_single_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a strict compliance double-precision add: */ _tme_ieee754_strict_double_add, @@ -2657,7 +2801,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_double_to_int32, /* this does a strict compliance double-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_double_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a strict compliance extended80-precision add: */ #if (defined(TME_HAVE_INT64_T)) @@ -2821,7 +2969,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_extended80_to_int32, /* this does a strict compliance extended80-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_extended80_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a strict compliance quad-precision add: */ #if (defined(TME_HAVE_INT64_T)) @@ -2985,7 +3137,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_quad_to_int32, /* this does a strict compliance quad-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_quad_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ }; #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) @@ -5088,7 +5244,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_single_to_int32, /* this does a partial compliance single-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_single_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a partial compliance double-precision add: */ #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) @@ -5252,7 +5412,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_double_to_int32, /* this does a partial compliance double-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_double_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a partial compliance extended80-precision add: */ #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) @@ -5468,7 +5632,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_extended80_to_int32, /* this does a partial compliance extended80-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_extended80_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a partial compliance quad-precision add: */ #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) @@ -5684,7 +5852,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_quad_to_int32, /* this does a partial compliance quad-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_quad_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ }; /* this does a unknown compliance single-precision add: */ @@ -6903,7 +7075,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_single_to_int32, /* this does a unknown compliance single-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_single_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a unknown compliance double-precision add: */ _tme_ieee754_unknown_double_add, @@ -7015,7 +7191,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_double_to_int32, /* this does a unknown compliance double-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_double_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a unknown compliance extended80-precision add: */ _tme_ieee754_unknown_extended80_add, @@ -7151,7 +7331,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_extended80_to_int32, /* this does a unknown compliance extended80-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_extended80_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ /* this does a unknown compliance quad-precision add: */ _tme_ieee754_unknown_quad_add, @@ -7287,7 +7471,11 @@ _tme_const struct tme_ieee754_ops tme_ie _tme_ieee754_strict_quad_to_int32, /* this does a unknown compliance quad-precision to_int64: */ +#if (defined(TME_HAVE_INT64_T)) + _tme_ieee754_strict_quad_to_int64, +#else /* !(defined(TME_HAVE_INT64_T)) */ NULL, +#endif /* !(defined(TME_HAVE_INT64_T)) */ }; /* this looks up an operations structure: */