b2a00c8984
libgcc/ 2007-09-27 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (dfp-filenames): Replace decimal_globals, decimal_data, binarydecimal and convert_data with bid_decimal_globals, bid_decimal_data, bid_binarydecimal and bid_convert_data, respectively. libgcc/config/libbid/ 2007-09-27 H.J. Lu <hongjiu.lu@intel.com> * bid128_fromstring.c: Removed. * bid_dpd.c: New from libbid 2007-09-26. * bid128_to_int16.c: Likewise. * bid128_to_int8.c: Likewise. * bid128_to_uint8.c: Likewise. * bid128_to_uint16.c: Likewise. * bid64_to_int16.c: Likewise. * bid64_to_int8.c: Likewise. * bid64_to_uint16.c: Likewise. * bid64_to_uint8.c: Likewise. * bid128_2_str.h: Updated from libbid 2007-09-26. * bid128_2_str_macros.h: Likewise. * bid128_2_str_tables.c: Likewise. * bid128_add.c: Likewise. * bid128.c: Likewise. * bid128_compare.c: Likewise. * bid128_div.c: Likewise. * bid128_fma.c: Likewise. * bid128_logb.c: Likewise. * bid128_minmax.c: Likewise. * bid128_mul.c: Likewise. * bid128_next.c: Likewise. * bid128_noncomp.c: Likewise. * bid128_quantize.c: Likewise. * bid128_rem.c: Likewise. * bid128_round_integral.c: Likewise. * bid128_scalb.c: Likewise. * bid128_sqrt.c: Likewise. * bid128_string.c: Likewise. * bid128_to_int32.c: Likewise. * bid128_to_int64.c: Likewise. * bid128_to_uint32.c: Likewise. * bid128_to_uint64.c: Likewise. * bid32_to_bid128.c: Likewise. * bid32_to_bid64.c: Likewise. * bid64_add.c: Likewise. * bid64_compare.c: Likewise. * bid64_div.c: Likewise. * bid64_fma.c: Likewise. * bid64_logb.c: Likewise. * bid64_minmax.c: Likewise. * bid64_mul.c: Likewise. * bid64_next.c: Likewise. * bid64_noncomp.c: Likewise. * bid64_quantize.c: Likewise. * bid64_rem.c: Likewise. * bid64_round_integral.c: Likewise. * bid64_scalb.c: Likewise. * bid64_sqrt.c: Likewise. * bid64_string.c: Likewise. * bid64_to_bid128.c: Likewise. * bid64_to_int32.c: Likewise. * bid64_to_int64.c: Likewise. * bid64_to_uint32.c: Likewise. * bid64_to_uint64.c: Likewise. * bid_b2d.h: Likewise. * bid_binarydecimal.c: Likewise. * bid_conf.h: Likewise. * bid_convert_data.c: Likewise. * bid_decimal_data.c: Likewise. * bid_decimal_globals.c: Likewise. * bid_div_macros.h: Likewise. * bid_flag_operations.c: Likewise. * bid_from_int.c: Likewise. * bid_functions.h: Likewise. * bid_gcc_intrinsics.h: Likewise. * bid_inline_add.h: Likewise. * bid_internal.h: Likewise. * bid_round.c: Likewise. * bid_sqrt_macros.h: Likewise. * _addsub_dd.c: Likewise. * _addsub_sd.c: Likewise. * _addsub_td.c: Likewise. * _dd_to_df.c: Likewise. * _dd_to_di.c: Likewise. * _dd_to_sd.c: Likewise. * _dd_to_sf.c: Likewise. * _dd_to_si.c: Likewise. * _dd_to_td.c: Likewise. * _dd_to_tf.c: Likewise. * _dd_to_udi.c: Likewise. * _dd_to_usi.c: Likewise. * _dd_to_xf.c: Likewise. * _df_to_dd.c: Likewise. * _df_to_sd.c: Likewise. * _df_to_td.c: Likewise. * _di_to_dd.c: Likewise. * _di_to_sd.c: Likewise. * _di_to_td.c: Likewise. * _div_dd.c: Likewise. * _div_sd.c: Likewise. * _div_td.c: Likewise. * _eq_dd.c: Likewise. * _eq_sd.c: Likewise. * _eq_td.c: Likewise. * _ge_dd.c: Likewise. * _ge_sd.c: Likewise. * _ge_td.c: Likewise. * _gt_dd.c: Likewise. * _gt_sd.c: Likewise. * _gt_td.c: Likewise. * _isinfd128.c: Likewise. * _isinfd32.c: Likewise. * _isinfd64.c: Likewise. * _le_dd.c: Likewise. * _le_sd.c: Likewise. * _le_td.c: Likewise. * _lt_dd.c: Likewise. * _lt_sd.c: Likewise. * _lt_td.c: Likewise. * _mul_dd.c: Likewise. * _mul_sd.c: Likewise. * _mul_td.c: Likewise. * _ne_dd.c: Likewise. * _ne_sd.c: Likewise. * _ne_td.c: Likewise. * _sd_to_dd.c: Likewise. * _sd_to_df.c: Likewise. * _sd_to_di.c: Likewise. * _sd_to_sf.c: Likewise. * _sd_to_si.c: Likewise. * _sd_to_td.c: Likewise. * _sd_to_tf.c: Likewise. * _sd_to_udi.c: Likewise. * _sd_to_usi.c: Likewise. * _sd_to_xf.c: Likewise. * _sf_to_dd.c: Likewise. * _sf_to_sd.c: Likewise. * _sf_to_td.c: Likewise. * _si_to_dd.c: Likewise. * _si_to_sd.c: Likewise. * _si_to_td.c: Likewise. * _td_to_dd.c: Likewise. * _td_to_df.c: Likewise. * _td_to_di.c: Likewise. * _td_to_sd.c: Likewise. * _td_to_sf.c: Likewise. * _td_to_si.c: Likewise. * _td_to_tf.c: Likewise. * _td_to_udi.c: Likewise. * _td_to_usi.c: Likewise. * _td_to_xf.c: Likewise. * _tf_to_dd.c: Likewise. * _tf_to_sd.c: Likewise. * _tf_to_td.c: Likewise. * _udi_to_dd.c: Likewise. * _udi_to_sd.c: Likewise. * _udi_to_td.c: Likewise. * _unord_dd.c: Likewise. * _unord_sd.c: Likewise. * _unord_td.c: Likewise. * _usi_to_dd.c: Likewise. * _usi_to_sd.c: Likewise. * _usi_to_td.c: Likewise. * _xf_to_dd.c: Likewise. * _xf_to_sd.c: Likewise. * _xf_to_td.c: Likewise. 2007-09-27 H.J. Lu <hongjiu.lu@intel.com> * b2d.h: Renamed to ... * bid_b2d.h: This. * bid128_to_string.c: Renamed to ... * bid128_string.c: This. * bid_intrinsics.h: Renamed to ... * bid_gcc_intrinsics.h: This. * bid_string.c: Renamed to ... * bid64_string.c: This. * binarydecimal.c: Renamed to ... * bid_decimal_globals.c: This. * convert_data.c: Renamed to ... * bid_convert_data.c: This. * decimal_data.c: Renamed to ... * bid_decimal_data.c: This. * decimal_globals.c: Renamed to ... * bid_decimal_globals.c: This. * div_macros.h: Renamed to ... * bid_div_macros.h: This. * inline_bid_add.h: Renamed to ... * bid_inline_add.h: This. * sqrt_macros.h: Renamed to ... * bid_sqrt_macros.h: This. From-SVN: r128841
301 lines
9.0 KiB
C
301 lines
9.0 KiB
C
/* Copyright (C) 2007 Free Software Foundation, Inc.
|
|
|
|
This file is part of GCC.
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
version.
|
|
|
|
In addition to the permissions in the GNU General Public License, the
|
|
Free Software Foundation gives you unlimited permission to link the
|
|
compiled version of this file into combinations with other programs,
|
|
and to distribute those combinations without any restriction coming
|
|
from the use of this file. (The General Public License restrictions
|
|
do apply in other respects; for example, they cover modification of
|
|
the file, and distribution when not linked into a combine
|
|
executable.)
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|
02110-1301, USA. */
|
|
|
|
#ifndef _BID_GCC_INTRINSICS_H
|
|
#define _BID_GCC_INTRINSICS_H
|
|
|
|
#ifdef IN_LIBGCC2
|
|
|
|
#include "tconfig.h"
|
|
#include "coretypes.h"
|
|
#include "tm.h"
|
|
|
|
#ifndef LIBGCC2_WORDS_BIG_ENDIAN
|
|
#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
|
|
#endif
|
|
|
|
#ifndef LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
|
|
#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN LIBGCC2_WORDS_BIG_ENDIAN
|
|
#endif
|
|
|
|
#ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
|
|
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
|
|
#endif
|
|
|
|
#ifndef LIBGCC2_HAS_XF_MODE
|
|
#define LIBGCC2_HAS_XF_MODE \
|
|
(BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80)
|
|
#endif
|
|
|
|
#ifndef LIBGCC2_HAS_TF_MODE
|
|
#define LIBGCC2_HAS_TF_MODE \
|
|
(BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128)
|
|
#endif
|
|
|
|
#ifndef BID_HAS_XF_MODE
|
|
#define BID_HAS_XF_MODE LIBGCC2_HAS_XF_MODE
|
|
#endif
|
|
|
|
#ifndef BID_HAS_TF_MODE
|
|
#define BID_HAS_TF_MODE LIBGCC2_HAS_TF_MODE
|
|
#endif
|
|
|
|
/* Some handy typedefs. */
|
|
|
|
typedef float SFtype __attribute__ ((mode (SF)));
|
|
typedef float DFtype __attribute__ ((mode (DF)));
|
|
#if LIBGCC2_HAS_XF_MODE
|
|
typedef float XFtype __attribute__ ((mode (XF)));
|
|
#endif /* LIBGCC2_HAS_XF_MODE */
|
|
#if LIBGCC2_HAS_TF_MODE
|
|
typedef float TFtype __attribute__ ((mode (TF)));
|
|
#endif /* LIBGCC2_HAS_XF_MODE */
|
|
|
|
typedef int SItype __attribute__ ((mode (SI)));
|
|
typedef int DItype __attribute__ ((mode (DI)));
|
|
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
|
typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
|
|
|
/* The type of the result of a decimal float comparison. This must
|
|
match `word_mode' in GCC for the target. */
|
|
|
|
typedef int CMPtype __attribute__ ((mode (word)));
|
|
|
|
typedef int SINT8 __attribute__ ((mode (QI)));
|
|
typedef unsigned int UINT8 __attribute__ ((mode (QI)));
|
|
typedef USItype UINT32;
|
|
typedef SItype SINT32;
|
|
typedef UDItype UINT64;
|
|
typedef DItype SINT64;
|
|
|
|
/* It has to be identical to the one defined in bid_functions.h. */
|
|
typedef __attribute__ ((aligned(16))) struct
|
|
{
|
|
UINT64 w[2];
|
|
} UINT128;
|
|
#else /* if not IN_LIBGCC2 */
|
|
|
|
#ifndef BID_HAS_XF_MODE
|
|
#define BID_HAS_XF_MODE 1
|
|
#endif
|
|
|
|
#ifndef BID_HAS_TF_MODE
|
|
#if defined __i386__
|
|
#define BID_HAS_TF_MODE 0
|
|
#else
|
|
#define BID_HAS_TF_MODE 1
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SFtype
|
|
#define SFtype float
|
|
#endif
|
|
|
|
#ifndef DFtype
|
|
#define DFtype double
|
|
#endif
|
|
|
|
#if BID_HAS_XF_MODE
|
|
#ifndef XFtype
|
|
#define XFtype long double
|
|
#endif
|
|
|
|
#endif /* IN_LIBGCC2 */
|
|
|
|
#if BID_HAS_TF_MODE
|
|
#ifndef TFtype
|
|
#define TFtype __float128
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SItype
|
|
#define SItype SINT32
|
|
#endif
|
|
|
|
#ifndef DItype
|
|
#define DItype SINT64
|
|
#endif
|
|
|
|
#ifndef USItype
|
|
#define USItype UINT32
|
|
#endif
|
|
|
|
#ifndef UDItype
|
|
#define UDItype UINT64
|
|
#endif
|
|
|
|
#ifndef CMPtype
|
|
#define CMPtype long
|
|
#endif
|
|
#endif /* IN_LIBGCC2 */
|
|
|
|
#if BID_HAS_GCC_DECIMAL_INTRINSICS
|
|
/* Prototypes for gcc instrinsics */
|
|
|
|
extern _Decimal64 __bid_adddd3 (_Decimal64, _Decimal64);
|
|
extern _Decimal64 __bid_subdd3 (_Decimal64, _Decimal64);
|
|
extern _Decimal32 __bid_addsd3 (_Decimal32, _Decimal32);
|
|
extern _Decimal32 __bid_subsd3 (_Decimal32, _Decimal32);
|
|
extern _Decimal128 __bid_addtd3 (_Decimal128, _Decimal128);
|
|
extern _Decimal128 __bid_subtd3 (_Decimal128, _Decimal128);
|
|
extern DFtype __bid_truncdddf (_Decimal64);
|
|
extern DItype __bid_fixdddi (_Decimal64);
|
|
extern _Decimal32 __bid_truncddsd2 (_Decimal64);
|
|
extern SFtype __bid_truncddsf (_Decimal64);
|
|
extern SItype __bid_fixddsi (_Decimal64);
|
|
extern _Decimal128 __bid_extendddtd2 (_Decimal64);
|
|
#if BID_HAS_TF_MODE
|
|
extern TFtype __bid_extendddtf (_Decimal64);
|
|
#endif
|
|
extern UDItype __bid_fixunsdddi (_Decimal64);
|
|
extern USItype __bid_fixunsddsi (_Decimal64);
|
|
#if BID_HAS_XF_MODE
|
|
extern XFtype __bid_extendddxf (_Decimal64);
|
|
#endif
|
|
extern _Decimal64 __bid_extenddfdd (DFtype);
|
|
extern _Decimal32 __bid_truncdfsd (DFtype);
|
|
extern _Decimal128 __bid_extenddftd (DFtype);
|
|
extern _Decimal64 __bid_floatdidd (DItype);
|
|
extern _Decimal32 __bid_floatdisd (DItype);
|
|
extern _Decimal128 __bid_floatditd (DItype);
|
|
extern _Decimal64 __bid_divdd3 (_Decimal64, _Decimal64);
|
|
extern _Decimal32 __bid_divsd3 (_Decimal32, _Decimal32);
|
|
extern _Decimal128 __bid_divtd3 (_Decimal128, _Decimal128);
|
|
extern CMPtype __bid_eqdd2 (_Decimal64, _Decimal64);
|
|
extern CMPtype __bid_eqsd2 (_Decimal32, _Decimal32);
|
|
extern CMPtype __bid_eqtd2 (_Decimal128, _Decimal128);
|
|
extern CMPtype __bid_gedd2 (_Decimal64, _Decimal64);
|
|
extern CMPtype __bid_gesd2 (_Decimal32, _Decimal32);
|
|
extern CMPtype __bid_getd2 (_Decimal128, _Decimal128);
|
|
extern CMPtype __bid_gtdd2 (_Decimal64, _Decimal64);
|
|
extern CMPtype __bid_gtsd2 (_Decimal32, _Decimal32);
|
|
extern CMPtype __bid_gttd2 (_Decimal128, _Decimal128);
|
|
extern CMPtype __bid_ledd2 (_Decimal64, _Decimal64);
|
|
extern CMPtype __bid_lesd2 (_Decimal32, _Decimal32);
|
|
extern CMPtype __bid_letd2 (_Decimal128, _Decimal128);
|
|
extern CMPtype __bid_ltdd2 (_Decimal64, _Decimal64);
|
|
extern CMPtype __bid_ltsd2 (_Decimal32, _Decimal32);
|
|
extern CMPtype __bid_lttd2 (_Decimal128, _Decimal128);
|
|
extern CMPtype __bid_nedd2 (_Decimal64, _Decimal64);
|
|
extern CMPtype __bid_nesd2 (_Decimal32, _Decimal32);
|
|
extern CMPtype __bid_netd2 (_Decimal128, _Decimal128);
|
|
extern CMPtype __bid_unorddd2 (_Decimal64, _Decimal64);
|
|
extern CMPtype __bid_unordsd2 (_Decimal32, _Decimal32);
|
|
extern CMPtype __bid_unordtd2 (_Decimal128, _Decimal128);
|
|
extern _Decimal64 __bid_muldd3 (_Decimal64, _Decimal64);
|
|
extern _Decimal32 __bid_mulsd3 (_Decimal32, _Decimal32);
|
|
extern _Decimal128 __bid_multd3 (_Decimal128, _Decimal128);
|
|
extern _Decimal64 __bid_extendsddd2 (_Decimal32);
|
|
extern DFtype __bid_extendsddf (_Decimal32);
|
|
extern DItype __bid_fixsddi (_Decimal32);
|
|
extern SFtype __bid_truncsdsf (_Decimal32);
|
|
extern SItype __bid_fixsdsi (_Decimal32);
|
|
extern _Decimal128 __bid_extendsdtd2 (_Decimal32);
|
|
#if BID_HAS_TF_MODE
|
|
extern TFtype __bid_extendsdtf (_Decimal32);
|
|
#endif
|
|
extern UDItype __bid_fixunssddi (_Decimal32);
|
|
extern USItype __bid_fixunssdsi (_Decimal32);
|
|
#if BID_HAS_XF_MODE
|
|
extern XFtype __bid_extendsdxf (_Decimal32);
|
|
#endif
|
|
extern _Decimal64 __bid_extendsfdd (SFtype);
|
|
extern _Decimal32 __bid_extendsfsd (SFtype);
|
|
extern _Decimal128 __bid_extendsftd (SFtype);
|
|
extern _Decimal64 __bid_floatsidd (SItype);
|
|
extern _Decimal32 __bid_floatsisd (SItype);
|
|
extern _Decimal128 __bid_floatsitd (SItype);
|
|
extern _Decimal64 __bid_trunctddd2 (_Decimal128);
|
|
extern DFtype __bid_trunctddf (_Decimal128);
|
|
extern DItype __bid_fixtddi (_Decimal128);
|
|
extern _Decimal32 __bid_trunctdsd2 (_Decimal128);
|
|
extern SFtype __bid_trunctdsf (_Decimal128);
|
|
extern SItype __bid_fixtdsi (_Decimal128);
|
|
#if BID_HAS_TF_MODE
|
|
extern TFtype __bid_trunctdtf (_Decimal128);
|
|
#endif
|
|
extern UDItype __bid_fixunstddi (_Decimal128);
|
|
extern USItype __bid_fixunstdsi (_Decimal128);
|
|
#if BID_HAS_XF_MODE
|
|
extern XFtype __bid_trunctdxf (_Decimal128);
|
|
#endif
|
|
#if BID_HAS_TF_MODE
|
|
extern _Decimal64 __bid_trunctfdd (TFtype);
|
|
extern _Decimal32 __bid_trunctfsd (TFtype);
|
|
extern _Decimal128 __bid_extendtftd (TFtype);
|
|
#endif
|
|
extern _Decimal64 __bid_floatunsdidd (UDItype);
|
|
extern _Decimal32 __bid_floatunsdisd (UDItype);
|
|
extern _Decimal128 __bid_floatunsditd (UDItype);
|
|
extern _Decimal64 __bid_floatunssidd (USItype);
|
|
extern _Decimal32 __bid_floatunssisd (USItype);
|
|
extern _Decimal128 __bid_floatunssitd (USItype);
|
|
#if BID_HAS_XF_MODE
|
|
extern _Decimal64 __bid_truncxfdd (XFtype);
|
|
extern _Decimal32 __bid_truncxfsd (XFtype);
|
|
extern _Decimal128 __bid_extendxftd (XFtype);
|
|
#endif
|
|
extern int isinfd32 (_Decimal32);
|
|
extern int isinfd64 (_Decimal64);
|
|
extern int isinfd128 (_Decimal128);
|
|
#endif /* BID_HAS_GCC_DECIMAL_INTRINSICS */
|
|
|
|
extern void __dfp_set_round (int);
|
|
extern int __dfp_get_round (void);
|
|
extern void __dfp_clear_except (void);
|
|
extern int __dfp_test_except (int);
|
|
extern void __dfp_raise_except (int);
|
|
|
|
#if BID_HAS_GCC_DECIMAL_INTRINSICS
|
|
/* Used by gcc intrinsics. We have to define them after UINT128
|
|
is defined. */
|
|
union decimal32 {
|
|
_Decimal32 d;
|
|
UINT32 i;
|
|
};
|
|
|
|
union decimal64 {
|
|
_Decimal64 d;
|
|
UINT64 i;
|
|
};
|
|
|
|
union decimal128 {
|
|
_Decimal128 d;
|
|
UINT128 i;
|
|
};
|
|
|
|
#if BID_HAS_TF_MODE
|
|
union float128 {
|
|
TFtype f;
|
|
UINT128 i;
|
|
};
|
|
#endif
|
|
#endif /* BID_HAS_GCC_DECIMAL_INTRINSICS */
|
|
|
|
#endif /* _BID_GCC_INTRINSICS_H */
|