1*e4b17023SJohn Marino /* Header file for dfp-bit.c. 2*e4b17023SJohn Marino Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 3*e4b17023SJohn Marino Free Software Foundation, Inc. 4*e4b17023SJohn Marino 5*e4b17023SJohn Marino This file is part of GCC. 6*e4b17023SJohn Marino 7*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under 8*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free 9*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later 10*e4b17023SJohn Marino version. 11*e4b17023SJohn Marino 12*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or 14*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15*e4b17023SJohn Marino for more details. 16*e4b17023SJohn Marino 17*e4b17023SJohn Marino Under Section 7 of GPL version 3, you are granted additional 18*e4b17023SJohn Marino permissions described in the GCC Runtime Library Exception, version 19*e4b17023SJohn Marino 3.1, as published by the Free Software Foundation. 20*e4b17023SJohn Marino 21*e4b17023SJohn Marino You should have received a copy of the GNU General Public License and 22*e4b17023SJohn Marino a copy of the GCC Runtime Library Exception along with this program; 23*e4b17023SJohn Marino see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 24*e4b17023SJohn Marino <http://www.gnu.org/licenses/>. */ 25*e4b17023SJohn Marino 26*e4b17023SJohn Marino #ifndef _DFPBIT_H 27*e4b17023SJohn Marino #define _DFPBIT_H 28*e4b17023SJohn Marino 29*e4b17023SJohn Marino #include <float.h> 30*e4b17023SJohn Marino #include <fenv.h> 31*e4b17023SJohn Marino #include <decRound.h> 32*e4b17023SJohn Marino #include <decExcept.h> 33*e4b17023SJohn Marino #include "tconfig.h" 34*e4b17023SJohn Marino #include "coretypes.h" 35*e4b17023SJohn Marino #include "tm.h" 36*e4b17023SJohn Marino #include "libgcc_tm.h" 37*e4b17023SJohn Marino 38*e4b17023SJohn Marino #ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE 39*e4b17023SJohn Marino #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE 40*e4b17023SJohn Marino #endif 41*e4b17023SJohn Marino 42*e4b17023SJohn Marino /* We need to know the size of long double that the C library supports. 43*e4b17023SJohn Marino Don't use LIBGCC2_HAS_XF_MODE or LIBGCC2_HAS_TF_MODE here because 44*e4b17023SJohn Marino some targets set both of those. */ 45*e4b17023SJohn Marino 46*e4b17023SJohn Marino #define LONG_DOUBLE_HAS_XF_MODE \ 47*e4b17023SJohn Marino (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80) 48*e4b17023SJohn Marino 49*e4b17023SJohn Marino #define LONG_DOUBLE_HAS_TF_MODE \ 50*e4b17023SJohn Marino (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128) 51*e4b17023SJohn Marino 52*e4b17023SJohn Marino /* Depending on WIDTH, define a number of macros: 53*e4b17023SJohn Marino 54*e4b17023SJohn Marino DFP_C_TYPE: type of the arguments to the libgcc functions; 55*e4b17023SJohn Marino (eg _Decimal32) 56*e4b17023SJohn Marino 57*e4b17023SJohn Marino IEEE_TYPE: the corresponding (encoded) IEEE754 type; 58*e4b17023SJohn Marino (eg decimal32) 59*e4b17023SJohn Marino 60*e4b17023SJohn Marino TO_INTERNAL: the name of the decNumber function to convert an 61*e4b17023SJohn Marino encoded value into the decNumber internal representation; 62*e4b17023SJohn Marino 63*e4b17023SJohn Marino TO_ENCODED: the name of the decNumber function to convert an 64*e4b17023SJohn Marino internally represented decNumber into the encoded 65*e4b17023SJohn Marino representation. 66*e4b17023SJohn Marino 67*e4b17023SJohn Marino FROM_STRING: the name of the decNumber function to read an 68*e4b17023SJohn Marino encoded value from a string. 69*e4b17023SJohn Marino 70*e4b17023SJohn Marino TO_STRING: the name of the decNumber function to write an 71*e4b17023SJohn Marino encoded value to a string. */ 72*e4b17023SJohn Marino 73*e4b17023SJohn Marino #if WIDTH == 32 74*e4b17023SJohn Marino #define DFP_C_TYPE _Decimal32 75*e4b17023SJohn Marino #define IEEE_TYPE decimal32 76*e4b17023SJohn Marino #define HOST_TO_IEEE __host_to_ieee_32 77*e4b17023SJohn Marino #define IEEE_TO_HOST __ieee_to_host_32 78*e4b17023SJohn Marino #define TO_INTERNAL __decimal32ToNumber 79*e4b17023SJohn Marino #define TO_ENCODED __decimal32FromNumber 80*e4b17023SJohn Marino #define FROM_STRING __decimal32FromString 81*e4b17023SJohn Marino #define TO_STRING __decimal32ToString 82*e4b17023SJohn Marino #elif WIDTH == 64 83*e4b17023SJohn Marino #define DFP_C_TYPE _Decimal64 84*e4b17023SJohn Marino #define IEEE_TYPE decimal64 85*e4b17023SJohn Marino #define HOST_TO_IEEE __host_to_ieee_64 86*e4b17023SJohn Marino #define IEEE_TO_HOST __ieee_to_host_64 87*e4b17023SJohn Marino #define TO_INTERNAL __decimal64ToNumber 88*e4b17023SJohn Marino #define TO_ENCODED __decimal64FromNumber 89*e4b17023SJohn Marino #define FROM_STRING __decimal64FromString 90*e4b17023SJohn Marino #define TO_STRING __decimal64ToString 91*e4b17023SJohn Marino #elif WIDTH == 128 92*e4b17023SJohn Marino #define DFP_C_TYPE _Decimal128 93*e4b17023SJohn Marino #define IEEE_TYPE decimal128 94*e4b17023SJohn Marino #define HOST_TO_IEEE __host_to_ieee_128 95*e4b17023SJohn Marino #define IEEE_TO_HOST __ieee_to_host_128 96*e4b17023SJohn Marino #define TO_INTERNAL __decimal128ToNumber 97*e4b17023SJohn Marino #define TO_ENCODED __decimal128FromNumber 98*e4b17023SJohn Marino #define FROM_STRING __decimal128FromString 99*e4b17023SJohn Marino #define TO_STRING __decimal128ToString 100*e4b17023SJohn Marino #else 101*e4b17023SJohn Marino #error invalid decimal float word width 102*e4b17023SJohn Marino #endif 103*e4b17023SJohn Marino 104*e4b17023SJohn Marino /* We define __DEC_EVAL_METHOD__ to 2, saying that we evaluate all 105*e4b17023SJohn Marino operations and constants to the range and precision of the _Decimal128 106*e4b17023SJohn Marino type. Make it so. */ 107*e4b17023SJohn Marino #if WIDTH == 32 108*e4b17023SJohn Marino #define CONTEXT_INIT DEC_INIT_DECIMAL32 109*e4b17023SJohn Marino #elif WIDTH == 64 110*e4b17023SJohn Marino #define CONTEXT_INIT DEC_INIT_DECIMAL64 111*e4b17023SJohn Marino #elif WIDTH == 128 112*e4b17023SJohn Marino #define CONTEXT_INIT DEC_INIT_DECIMAL128 113*e4b17023SJohn Marino #endif 114*e4b17023SJohn Marino 115*e4b17023SJohn Marino #ifndef DFP_INIT_ROUNDMODE 116*e4b17023SJohn Marino #define DFP_INIT_ROUNDMODE(A) A = DEC_ROUND_HALF_EVEN 117*e4b17023SJohn Marino #endif 118*e4b17023SJohn Marino 119*e4b17023SJohn Marino #ifdef DFP_EXCEPTIONS_ENABLED 120*e4b17023SJohn Marino /* Return IEEE exception flags based on decNumber status flags. */ 121*e4b17023SJohn Marino #define DFP_IEEE_FLAGS(DEC_FLAGS) __extension__ \ 122*e4b17023SJohn Marino ({int _fe_flags = 0; \ 123*e4b17023SJohn Marino if ((dec_flags & DEC_IEEE_854_Division_by_zero) != 0) \ 124*e4b17023SJohn Marino _fe_flags |= FE_DIVBYZERO; \ 125*e4b17023SJohn Marino if ((dec_flags & DEC_IEEE_854_Inexact) != 0) \ 126*e4b17023SJohn Marino _fe_flags |= FE_INEXACT; \ 127*e4b17023SJohn Marino if ((dec_flags & DEC_IEEE_854_Invalid_operation) != 0) \ 128*e4b17023SJohn Marino _fe_flags |= FE_INVALID; \ 129*e4b17023SJohn Marino if ((dec_flags & DEC_IEEE_854_Overflow) != 0) \ 130*e4b17023SJohn Marino _fe_flags |= FE_OVERFLOW; \ 131*e4b17023SJohn Marino if ((dec_flags & DEC_IEEE_854_Underflow) != 0) \ 132*e4b17023SJohn Marino _fe_flags |= FE_UNDERFLOW; \ 133*e4b17023SJohn Marino _fe_flags; }) 134*e4b17023SJohn Marino #else 135*e4b17023SJohn Marino #define DFP_EXCEPTIONS_ENABLED 0 136*e4b17023SJohn Marino #define DFP_IEEE_FLAGS(A) 0 137*e4b17023SJohn Marino #define DFP_HANDLE_EXCEPTIONS(A) do {} while (0) 138*e4b17023SJohn Marino #endif 139*e4b17023SJohn Marino 140*e4b17023SJohn Marino /* Conversions between different decimal float types use WIDTH_TO to 141*e4b17023SJohn Marino determine additional macros to define. */ 142*e4b17023SJohn Marino 143*e4b17023SJohn Marino #if defined (L_dd_to_sd) || defined (L_td_to_sd) 144*e4b17023SJohn Marino #define WIDTH_TO 32 145*e4b17023SJohn Marino #elif defined (L_sd_to_dd) || defined (L_td_to_dd) 146*e4b17023SJohn Marino #define WIDTH_TO 64 147*e4b17023SJohn Marino #elif defined (L_sd_to_td) || defined (L_dd_to_td) 148*e4b17023SJohn Marino #define WIDTH_TO 128 149*e4b17023SJohn Marino #endif 150*e4b17023SJohn Marino 151*e4b17023SJohn Marino /* If WIDTH_TO is defined, define additional macros: 152*e4b17023SJohn Marino 153*e4b17023SJohn Marino DFP_C_TYPE_TO: type of the result of dfp to dfp conversion. 154*e4b17023SJohn Marino 155*e4b17023SJohn Marino IEEE_TYPE_TO: the corresponding (encoded) IEEE754 type. 156*e4b17023SJohn Marino 157*e4b17023SJohn Marino TO_ENCODED_TO: the name of the decNumber function to convert an 158*e4b17023SJohn Marino internally represented decNumber into the encoded representation 159*e4b17023SJohn Marino for the destination. */ 160*e4b17023SJohn Marino 161*e4b17023SJohn Marino #if WIDTH_TO == 32 162*e4b17023SJohn Marino #define DFP_C_TYPE_TO _Decimal32 163*e4b17023SJohn Marino #define IEEE_TYPE_TO decimal32 164*e4b17023SJohn Marino #define TO_ENCODED_TO __decimal32FromNumber 165*e4b17023SJohn Marino #define IEEE_TO_HOST_TO __ieee_to_host_32 166*e4b17023SJohn Marino #elif WIDTH_TO == 64 167*e4b17023SJohn Marino #define DFP_C_TYPE_TO _Decimal64 168*e4b17023SJohn Marino #define IEEE_TYPE_TO decimal64 169*e4b17023SJohn Marino #define TO_ENCODED_TO __decimal64FromNumber 170*e4b17023SJohn Marino #define IEEE_TO_HOST_TO __ieee_to_host_64 171*e4b17023SJohn Marino #elif WIDTH_TO == 128 172*e4b17023SJohn Marino #define DFP_C_TYPE_TO _Decimal128 173*e4b17023SJohn Marino #define IEEE_TYPE_TO decimal128 174*e4b17023SJohn Marino #define TO_ENCODED_TO __decimal128FromNumber 175*e4b17023SJohn Marino #define IEEE_TO_HOST_TO __ieee_to_host_128 176*e4b17023SJohn Marino #endif 177*e4b17023SJohn Marino 178*e4b17023SJohn Marino /* Conversions between decimal float types and integral types use INT_KIND 179*e4b17023SJohn Marino to determine the data type and C functions to use. */ 180*e4b17023SJohn Marino 181*e4b17023SJohn Marino #if defined (L_sd_to_si) || defined (L_dd_to_si) || defined (L_td_to_si) \ 182*e4b17023SJohn Marino || defined (L_si_to_sd) || defined (L_si_to_dd) || defined (L_si_to_td) 183*e4b17023SJohn Marino #define INT_KIND 1 184*e4b17023SJohn Marino #elif defined (L_sd_to_di) || defined (L_dd_to_di) || defined (L_td_to_di) \ 185*e4b17023SJohn Marino || defined (L_di_to_sd) || defined (L_di_to_dd) || defined (L_di_to_td) 186*e4b17023SJohn Marino #define INT_KIND 2 187*e4b17023SJohn Marino #elif defined (L_sd_to_usi) || defined (L_dd_to_usi) || defined (L_td_to_usi) \ 188*e4b17023SJohn Marino || defined (L_usi_to_sd) || defined (L_usi_to_dd) || defined (L_usi_to_td) 189*e4b17023SJohn Marino #define INT_KIND 3 190*e4b17023SJohn Marino #elif defined (L_sd_to_udi) || defined (L_dd_to_udi) || defined (L_td_to_udi) \ 191*e4b17023SJohn Marino || defined (L_udi_to_sd) || defined (L_udi_to_dd) || defined (L_udi_to_td) 192*e4b17023SJohn Marino #define INT_KIND 4 193*e4b17023SJohn Marino #endif 194*e4b17023SJohn Marino 195*e4b17023SJohn Marino /* If INT_KIND is defined, define additional macros: 196*e4b17023SJohn Marino 197*e4b17023SJohn Marino INT_TYPE: The integer data type. 198*e4b17023SJohn Marino 199*e4b17023SJohn Marino INT_FMT: The format string for writing the integer to a string. 200*e4b17023SJohn Marino 201*e4b17023SJohn Marino CAST_FOR_FMT: Cast variable of INT_KIND to C type for sprintf. 202*e4b17023SJohn Marino This works for ILP32 and LP64, won't for other type size systems. 203*e4b17023SJohn Marino 204*e4b17023SJohn Marino STR_TO_INT: The function to read the integer from a string. */ 205*e4b17023SJohn Marino 206*e4b17023SJohn Marino #if INT_KIND == 1 207*e4b17023SJohn Marino #define INT_TYPE SItype 208*e4b17023SJohn Marino #define INT_FMT "%d" 209*e4b17023SJohn Marino #define CAST_FOR_FMT(A) (int)A 210*e4b17023SJohn Marino #define STR_TO_INT strtol 211*e4b17023SJohn Marino #elif INT_KIND == 2 212*e4b17023SJohn Marino #define INT_TYPE DItype 213*e4b17023SJohn Marino #define INT_FMT "%lld" 214*e4b17023SJohn Marino #define CAST_FOR_FMT(A) (long long)A 215*e4b17023SJohn Marino #define STR_TO_INT strtoll 216*e4b17023SJohn Marino #elif INT_KIND == 3 217*e4b17023SJohn Marino #define INT_TYPE USItype 218*e4b17023SJohn Marino #define INT_FMT "%u" 219*e4b17023SJohn Marino #define CAST_FOR_FMT(A) (unsigned int)A 220*e4b17023SJohn Marino #define STR_TO_INT strtoul 221*e4b17023SJohn Marino #elif INT_KIND == 4 222*e4b17023SJohn Marino #define INT_TYPE UDItype 223*e4b17023SJohn Marino #define INT_FMT "%llu" 224*e4b17023SJohn Marino #define CAST_FOR_FMT(A) (unsigned long long)A 225*e4b17023SJohn Marino #define STR_TO_INT strtoull 226*e4b17023SJohn Marino #endif 227*e4b17023SJohn Marino 228*e4b17023SJohn Marino /* Conversions between decimal float types and binary float types use 229*e4b17023SJohn Marino BFP_KIND to determine the data type and C functions to use. */ 230*e4b17023SJohn Marino 231*e4b17023SJohn Marino #if defined (L_sd_to_sf) || defined (L_dd_to_sf) || defined (L_td_to_sf) \ 232*e4b17023SJohn Marino || defined (L_sf_to_sd) || defined (L_sf_to_dd) || defined (L_sf_to_td) 233*e4b17023SJohn Marino #define BFP_KIND 1 234*e4b17023SJohn Marino #elif defined (L_sd_to_df) || defined (L_dd_to_df ) || defined (L_td_to_df) \ 235*e4b17023SJohn Marino || defined (L_df_to_sd) || defined (L_df_to_dd) || defined (L_df_to_td) 236*e4b17023SJohn Marino #define BFP_KIND 2 237*e4b17023SJohn Marino #elif defined (L_sd_to_xf) || defined (L_dd_to_xf ) || defined (L_td_to_xf) \ 238*e4b17023SJohn Marino || defined (L_xf_to_sd) || defined (L_xf_to_dd) || defined (L_xf_to_td) 239*e4b17023SJohn Marino #define BFP_KIND 3 240*e4b17023SJohn Marino #elif defined (L_sd_to_tf) || defined (L_dd_to_tf) || defined (L_td_to_tf) \ 241*e4b17023SJohn Marino || defined (L_tf_to_sd) || defined (L_tf_to_dd) || defined (L_tf_to_td) 242*e4b17023SJohn Marino #define BFP_KIND 4 243*e4b17023SJohn Marino #endif 244*e4b17023SJohn Marino 245*e4b17023SJohn Marino /* If BFP_KIND is defined, define additional macros: 246*e4b17023SJohn Marino 247*e4b17023SJohn Marino BFP_TYPE: The binary floating point data type. 248*e4b17023SJohn Marino 249*e4b17023SJohn Marino BFP_FMT: The format string for writing the value to a string. 250*e4b17023SJohn Marino The number of decimal digits printed is 251*e4b17023SJohn Marino ceil (nbits / log2 (10.) + 1) 252*e4b17023SJohn Marino as described in David Matula's CACM 19(3) 716-723 June 1968 paper. 253*e4b17023SJohn Marino 254*e4b17023SJohn Marino BFP_VIA_TYPE: Type to which to cast a variable of BPF_TYPE for a 255*e4b17023SJohn Marino call to sprintf. 256*e4b17023SJohn Marino 257*e4b17023SJohn Marino STR_TO_BFP: The function to read the value from a string. */ 258*e4b17023SJohn Marino 259*e4b17023SJohn Marino #if BFP_KIND == 1 260*e4b17023SJohn Marino #define BFP_TYPE SFtype 261*e4b17023SJohn Marino #define BFP_FMT "%.9e" 262*e4b17023SJohn Marino #define BFP_VIA_TYPE double 263*e4b17023SJohn Marino #define STR_TO_BFP strtof 264*e4b17023SJohn Marino 265*e4b17023SJohn Marino #elif BFP_KIND == 2 266*e4b17023SJohn Marino #define BFP_TYPE DFtype 267*e4b17023SJohn Marino #define BFP_FMT "%.17e" 268*e4b17023SJohn Marino #define BFP_VIA_TYPE double 269*e4b17023SJohn Marino #define STR_TO_BFP strtod 270*e4b17023SJohn Marino 271*e4b17023SJohn Marino #elif BFP_KIND == 3 272*e4b17023SJohn Marino #if LONG_DOUBLE_HAS_XF_MODE 273*e4b17023SJohn Marino #define BFP_TYPE XFtype 274*e4b17023SJohn Marino #define BFP_FMT "%.21Le" 275*e4b17023SJohn Marino #define BFP_VIA_TYPE long double 276*e4b17023SJohn Marino #define STR_TO_BFP strtold 277*e4b17023SJohn Marino #endif /* LONG_DOUBLE_HAS_XF_MODE */ 278*e4b17023SJohn Marino 279*e4b17023SJohn Marino #elif BFP_KIND == 4 280*e4b17023SJohn Marino #if LONG_DOUBLE_HAS_TF_MODE 281*e4b17023SJohn Marino #define BFP_TYPE TFtype 282*e4b17023SJohn Marino #if LDBL_MANT_DIG == 106 283*e4b17023SJohn Marino #define BFP_FMT "%.33Le" 284*e4b17023SJohn Marino #elif LDBL_MANT_DIG == 113 285*e4b17023SJohn Marino #define BFP_FMT "%.36Le" 286*e4b17023SJohn Marino #else 287*e4b17023SJohn Marino #error "unknown long double size, cannot define BFP_FMT" 288*e4b17023SJohn Marino #endif /* LDBL_MANT_DIG */ 289*e4b17023SJohn Marino #define STR_TO_BFP strtold 290*e4b17023SJohn Marino #define BFP_VIA_TYPE long double 291*e4b17023SJohn Marino #endif /* LONG_DOUBLE_HAS_TF_MODE */ 292*e4b17023SJohn Marino 293*e4b17023SJohn Marino #endif /* BFP_KIND */ 294*e4b17023SJohn Marino 295*e4b17023SJohn Marino #if WIDTH == 128 || WIDTH_TO == 128 296*e4b17023SJohn Marino #include "decimal128.h" 297*e4b17023SJohn Marino #include "decQuad.h" 298*e4b17023SJohn Marino #endif 299*e4b17023SJohn Marino #if WIDTH == 64 || WIDTH_TO == 64 300*e4b17023SJohn Marino #include "decimal64.h" 301*e4b17023SJohn Marino #include "decDouble.h" 302*e4b17023SJohn Marino #endif 303*e4b17023SJohn Marino #if WIDTH == 32 || WIDTH_TO == 32 304*e4b17023SJohn Marino #include "decimal32.h" 305*e4b17023SJohn Marino #include "decSingle.h" 306*e4b17023SJohn Marino #endif 307*e4b17023SJohn Marino #include "decNumber.h" 308*e4b17023SJohn Marino 309*e4b17023SJohn Marino /* Names of arithmetic functions. */ 310*e4b17023SJohn Marino 311*e4b17023SJohn Marino #if ENABLE_DECIMAL_BID_FORMAT 312*e4b17023SJohn Marino #define DPD_BID_NAME(DPD,BID) BID 313*e4b17023SJohn Marino #else 314*e4b17023SJohn Marino #define DPD_BID_NAME(DPD,BID) DPD 315*e4b17023SJohn Marino #endif 316*e4b17023SJohn Marino 317*e4b17023SJohn Marino #if WIDTH == 32 318*e4b17023SJohn Marino #define DFP_ADD DPD_BID_NAME(__dpd_addsd3,__bid_addsd3) 319*e4b17023SJohn Marino #define DFP_SUB DPD_BID_NAME(__dpd_subsd3,__bid_subsd3) 320*e4b17023SJohn Marino #define DFP_MULTIPLY DPD_BID_NAME(__dpd_mulsd3,__bid_mulsd3) 321*e4b17023SJohn Marino #define DFP_DIVIDE DPD_BID_NAME(__dpd_divsd3,__bid_divsd3) 322*e4b17023SJohn Marino #define DFP_EQ DPD_BID_NAME(__dpd_eqsd2,__bid_eqsd2) 323*e4b17023SJohn Marino #define DFP_NE DPD_BID_NAME(__dpd_nesd2,__bid_nesd2) 324*e4b17023SJohn Marino #define DFP_LT DPD_BID_NAME(__dpd_ltsd2,__bid_ltsd2) 325*e4b17023SJohn Marino #define DFP_GT DPD_BID_NAME(__dpd_gtsd2,__bid_gtsd2) 326*e4b17023SJohn Marino #define DFP_LE DPD_BID_NAME(__dpd_lesd2,__bid_lesd2) 327*e4b17023SJohn Marino #define DFP_GE DPD_BID_NAME(__dpd_gesd2,__bid_gesd2) 328*e4b17023SJohn Marino #define DFP_UNORD DPD_BID_NAME(__dpd_unordsd2,__bid_unordsd2) 329*e4b17023SJohn Marino #elif WIDTH == 64 330*e4b17023SJohn Marino #define DFP_ADD DPD_BID_NAME(__dpd_adddd3,__bid_adddd3) 331*e4b17023SJohn Marino #define DFP_SUB DPD_BID_NAME(__dpd_subdd3,__bid_subdd3) 332*e4b17023SJohn Marino #define DFP_MULTIPLY DPD_BID_NAME(__dpd_muldd3,__bid_muldd3) 333*e4b17023SJohn Marino #define DFP_DIVIDE DPD_BID_NAME(__dpd_divdd3,__bid_divdd3) 334*e4b17023SJohn Marino #define DFP_EQ DPD_BID_NAME(__dpd_eqdd2,__bid_eqdd2) 335*e4b17023SJohn Marino #define DFP_NE DPD_BID_NAME(__dpd_nedd2,__bid_nedd2) 336*e4b17023SJohn Marino #define DFP_LT DPD_BID_NAME(__dpd_ltdd2,__bid_ltdd2) 337*e4b17023SJohn Marino #define DFP_GT DPD_BID_NAME(__dpd_gtdd2,__bid_gtdd2) 338*e4b17023SJohn Marino #define DFP_LE DPD_BID_NAME(__dpd_ledd2,__bid_ledd2) 339*e4b17023SJohn Marino #define DFP_GE DPD_BID_NAME(__dpd_gedd2,__bid_gedd2) 340*e4b17023SJohn Marino #define DFP_UNORD DPD_BID_NAME(__dpd_unorddd2,__bid_unorddd2) 341*e4b17023SJohn Marino #elif WIDTH == 128 342*e4b17023SJohn Marino #define DFP_ADD DPD_BID_NAME(__dpd_addtd3,__bid_addtd3) 343*e4b17023SJohn Marino #define DFP_SUB DPD_BID_NAME(__dpd_subtd3,__bid_subtd3) 344*e4b17023SJohn Marino #define DFP_MULTIPLY DPD_BID_NAME(__dpd_multd3,__bid_multd3) 345*e4b17023SJohn Marino #define DFP_DIVIDE DPD_BID_NAME(__dpd_divtd3,__bid_divtd3) 346*e4b17023SJohn Marino #define DFP_EQ DPD_BID_NAME(__dpd_eqtd2,__bid_eqtd2) 347*e4b17023SJohn Marino #define DFP_NE DPD_BID_NAME(__dpd_netd2,__bid_netd2) 348*e4b17023SJohn Marino #define DFP_LT DPD_BID_NAME(__dpd_lttd2,__bid_lttd2) 349*e4b17023SJohn Marino #define DFP_GT DPD_BID_NAME(__dpd_gttd2,__bid_gttd2) 350*e4b17023SJohn Marino #define DFP_LE DPD_BID_NAME(__dpd_letd2,__bid_letd2) 351*e4b17023SJohn Marino #define DFP_GE DPD_BID_NAME(__dpd_getd2,__bid_getd2) 352*e4b17023SJohn Marino #define DFP_UNORD DPD_BID_NAME(__dpd_unordtd2,__bid_unordtd2) 353*e4b17023SJohn Marino #endif 354*e4b17023SJohn Marino 355*e4b17023SJohn Marino /* Names of decNumber functions for DPD arithmetic. */ 356*e4b17023SJohn Marino 357*e4b17023SJohn Marino #if WIDTH == 32 358*e4b17023SJohn Marino #define decFloat decDouble 359*e4b17023SJohn Marino #define DFP_BINARY_OP d32_binary_op 360*e4b17023SJohn Marino #define DFP_COMPARE_OP d32_compare_op 361*e4b17023SJohn Marino #define DEC_FLOAT_ADD decDoubleAdd 362*e4b17023SJohn Marino #define DEC_FLOAT_SUBTRACT decDoubleSubtract 363*e4b17023SJohn Marino #define DEC_FLOAT_MULTIPLY decDoubleMultiply 364*e4b17023SJohn Marino #define DEC_FLOAT_DIVIDE decDoubleDivide 365*e4b17023SJohn Marino #define DEC_FLOAT_COMPARE decDoubleCompare 366*e4b17023SJohn Marino #define DEC_FLOAT_IS_ZERO decDoubleIsZero 367*e4b17023SJohn Marino #define DEC_FLOAT_IS_NAN decDoubleIsNaN 368*e4b17023SJohn Marino #define DEC_FLOAT_IS_SIGNED decDoubleIsSigned 369*e4b17023SJohn Marino #elif WIDTH == 64 370*e4b17023SJohn Marino #define DFP_BINARY_OP dnn_binary_op 371*e4b17023SJohn Marino #define DFP_COMPARE_OP dnn_compare_op 372*e4b17023SJohn Marino #define decFloat decDouble 373*e4b17023SJohn Marino #define DEC_FLOAT_ADD decDoubleAdd 374*e4b17023SJohn Marino #define DEC_FLOAT_SUBTRACT decDoubleSubtract 375*e4b17023SJohn Marino #define DEC_FLOAT_MULTIPLY decDoubleMultiply 376*e4b17023SJohn Marino #define DEC_FLOAT_DIVIDE decDoubleDivide 377*e4b17023SJohn Marino #define DEC_FLOAT_COMPARE decDoubleCompare 378*e4b17023SJohn Marino #define DEC_FLOAT_IS_ZERO decDoubleIsZero 379*e4b17023SJohn Marino #define DEC_FLOAT_IS_NAN decDoubleIsNaN 380*e4b17023SJohn Marino #define DEC_FLOAT_IS_SIGNED decDoubleIsSigned 381*e4b17023SJohn Marino #elif WIDTH == 128 382*e4b17023SJohn Marino #define DFP_BINARY_OP dnn_binary_op 383*e4b17023SJohn Marino #define DFP_COMPARE_OP dnn_compare_op 384*e4b17023SJohn Marino #define decFloat decQuad 385*e4b17023SJohn Marino #define DEC_FLOAT_ADD decQuadAdd 386*e4b17023SJohn Marino #define DEC_FLOAT_SUBTRACT decQuadSubtract 387*e4b17023SJohn Marino #define DEC_FLOAT_MULTIPLY decQuadMultiply 388*e4b17023SJohn Marino #define DEC_FLOAT_DIVIDE decQuadDivide 389*e4b17023SJohn Marino #define DEC_FLOAT_COMPARE decQuadCompare 390*e4b17023SJohn Marino #define DEC_FLOAT_IS_ZERO decQuadIsZero 391*e4b17023SJohn Marino #define DEC_FLOAT_IS_NAN decQuadIsNaN 392*e4b17023SJohn Marino #define DEC_FLOAT_IS_SIGNED decQuadIsSigned 393*e4b17023SJohn Marino #endif 394*e4b17023SJohn Marino 395*e4b17023SJohn Marino /* Names of functions to convert between different decimal float types. */ 396*e4b17023SJohn Marino 397*e4b17023SJohn Marino #if WIDTH == 32 398*e4b17023SJohn Marino #if WIDTH_TO == 64 399*e4b17023SJohn Marino #define DFP_TO_DFP DPD_BID_NAME(__dpd_extendsddd2,__bid_extendsddd2) 400*e4b17023SJohn Marino #elif WIDTH_TO == 128 401*e4b17023SJohn Marino #define DFP_TO_DFP DPD_BID_NAME(__dpd_extendsdtd2,__bid_extendsdtd2) 402*e4b17023SJohn Marino #endif 403*e4b17023SJohn Marino #elif WIDTH == 64 404*e4b17023SJohn Marino #if WIDTH_TO == 32 405*e4b17023SJohn Marino #define DFP_TO_DFP DPD_BID_NAME(__dpd_truncddsd2,__bid_truncddsd2) 406*e4b17023SJohn Marino #elif WIDTH_TO == 128 407*e4b17023SJohn Marino #define DFP_TO_DFP DPD_BID_NAME(__dpd_extendddtd2,__bid_extendddtd2) 408*e4b17023SJohn Marino #endif 409*e4b17023SJohn Marino #elif WIDTH == 128 410*e4b17023SJohn Marino #if WIDTH_TO == 32 411*e4b17023SJohn Marino #define DFP_TO_DFP DPD_BID_NAME(__dpd_trunctdsd2,__bid_trunctdsd2) 412*e4b17023SJohn Marino #elif WIDTH_TO == 64 413*e4b17023SJohn Marino #define DFP_TO_DFP DPD_BID_NAME(__dpd_trunctddd2,__bid_trunctddd2) 414*e4b17023SJohn Marino #endif 415*e4b17023SJohn Marino #endif 416*e4b17023SJohn Marino 417*e4b17023SJohn Marino /* Names of functions to convert between decimal float and integers. */ 418*e4b17023SJohn Marino 419*e4b17023SJohn Marino #if WIDTH == 32 420*e4b17023SJohn Marino #if INT_KIND == 1 421*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatsisd,__bid_floatsisd) 422*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixsdsi,__bid_fixsdsi) 423*e4b17023SJohn Marino #define DEC_FLOAT_FROM_INT decDoubleFromInt32 424*e4b17023SJohn Marino #define DEC_FLOAT_TO_INT decDoubleToInt32 425*e4b17023SJohn Marino #elif INT_KIND == 2 426*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatdisd,__bid_floatdisd) 427*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixsddi,__bid_fixsddi) 428*e4b17023SJohn Marino #elif INT_KIND == 3 429*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatunssisd,__bid_floatunssisd) 430*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixunssdsi,__bid_fixunssdsi) 431*e4b17023SJohn Marino #define DEC_FLOAT_FROM_INT decDoubleFromUInt32 432*e4b17023SJohn Marino #define DEC_FLOAT_TO_INT decDoubleToUInt32 433*e4b17023SJohn Marino #elif INT_KIND == 4 434*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatunsdisd,__bid_floatunsdisd) 435*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixunssddi,__bid_fixunssddi) 436*e4b17023SJohn Marino #endif 437*e4b17023SJohn Marino #elif WIDTH == 64 438*e4b17023SJohn Marino #define decFloat decDouble 439*e4b17023SJohn Marino #if INT_KIND == 1 440*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatsidd,__bid_floatsidd) 441*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixddsi,__bid_fixddsi) 442*e4b17023SJohn Marino #define DEC_FLOAT_FROM_INT decDoubleFromInt32 443*e4b17023SJohn Marino #define DEC_FLOAT_TO_INT decDoubleToInt32 444*e4b17023SJohn Marino #elif INT_KIND == 2 445*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatdidd,__bid_floatdidd) 446*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixdddi,__bid_fixdddi) 447*e4b17023SJohn Marino #elif INT_KIND == 3 448*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatunssidd,__bid_floatunssidd) 449*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixunsddsi,__bid_fixunsddsi) 450*e4b17023SJohn Marino #define DEC_FLOAT_FROM_INT decDoubleFromUInt32 451*e4b17023SJohn Marino #define DEC_FLOAT_TO_INT decDoubleToUInt32 452*e4b17023SJohn Marino #elif INT_KIND == 4 453*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatunsdidd,__bid_floatunsdidd) 454*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixunsdddi,__bid_fixunsdddi) 455*e4b17023SJohn Marino #endif 456*e4b17023SJohn Marino #elif WIDTH == 128 457*e4b17023SJohn Marino #define decFloat decQuad 458*e4b17023SJohn Marino #if INT_KIND == 1 459*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatsitd,__bid_floatsitd) 460*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixtdsi,__bid_fixtdsi) 461*e4b17023SJohn Marino #define DEC_FLOAT_FROM_INT decQuadFromInt32 462*e4b17023SJohn Marino #define DEC_FLOAT_TO_INT decQuadToInt32 463*e4b17023SJohn Marino #elif INT_KIND == 2 464*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatditd,__bid_floatditd) 465*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixtddi,__bid_fixtddi) 466*e4b17023SJohn Marino #elif INT_KIND == 3 467*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatunssitd,__bid_floatunssitd) 468*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixunstdsi,__bid_fixunstdsi) 469*e4b17023SJohn Marino #define DEC_FLOAT_FROM_INT decQuadFromUInt32 470*e4b17023SJohn Marino #define DEC_FLOAT_TO_INT decQuadToUInt32 471*e4b17023SJohn Marino #elif INT_KIND == 4 472*e4b17023SJohn Marino #define INT_TO_DFP DPD_BID_NAME(__dpd_floatunsditd,__bid_floatunsditd) 473*e4b17023SJohn Marino #define DFP_TO_INT DPD_BID_NAME(__dpd_fixunstddi,__bid_fixunstddi) 474*e4b17023SJohn Marino #endif 475*e4b17023SJohn Marino #endif 476*e4b17023SJohn Marino 477*e4b17023SJohn Marino /* Names of functions to convert between decimal float and binary float. */ 478*e4b17023SJohn Marino 479*e4b17023SJohn Marino #if WIDTH == 32 480*e4b17023SJohn Marino #if BFP_KIND == 1 481*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_extendsfsd,__bid_extendsfsd) 482*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_truncsdsf,__bid_truncsdsf) 483*e4b17023SJohn Marino #elif BFP_KIND == 2 484*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_truncdfsd,__bid_truncdfsd) 485*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_extendsddf,__bid_extendsddf) 486*e4b17023SJohn Marino #elif BFP_KIND == 3 487*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_truncxfsd,__bid_truncxfsd) 488*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_extendsdxf,__bid_extendsdxf) 489*e4b17023SJohn Marino #elif BFP_KIND == 4 490*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_trunctfsd,__bid_trunctfsd) 491*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_extendsdtf,__bid_extendsdtf) 492*e4b17023SJohn Marino #endif /* BFP_KIND */ 493*e4b17023SJohn Marino 494*e4b17023SJohn Marino #elif WIDTH == 64 495*e4b17023SJohn Marino #if BFP_KIND == 1 496*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_extendsfdd,__bid_extendsfdd) 497*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_truncddsf,__bid_truncddsf) 498*e4b17023SJohn Marino #elif BFP_KIND == 2 499*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_extenddfdd,__bid_extenddfdd) 500*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_truncdddf,__bid_truncdddf) 501*e4b17023SJohn Marino #elif BFP_KIND == 3 502*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_truncxfdd,__bid_truncxfdd) 503*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_extendddxf,__bid_extendddxf) 504*e4b17023SJohn Marino #elif BFP_KIND == 4 505*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_trunctfdd,__bid_trunctfdd) 506*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_extendddtf,__bid_extendddtf) 507*e4b17023SJohn Marino #endif /* BFP_KIND */ 508*e4b17023SJohn Marino 509*e4b17023SJohn Marino #elif WIDTH == 128 510*e4b17023SJohn Marino #if BFP_KIND == 1 511*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_extendsftd,__bid_extendsftd) 512*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_trunctdsf,__bid_trunctdsf) 513*e4b17023SJohn Marino #elif BFP_KIND == 2 514*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_extenddftd,__bid_extenddftd) 515*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_trunctddf,__bid_trunctddf) 516*e4b17023SJohn Marino #elif BFP_KIND == 3 517*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_extendxftd,__bid_extendxftd) 518*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_trunctdxf,__bid_trunctdxf) 519*e4b17023SJohn Marino #elif BFP_KIND == 4 520*e4b17023SJohn Marino #define BFP_TO_DFP DPD_BID_NAME(__dpd_extendtftd,__bid_extendtftd) 521*e4b17023SJohn Marino #define DFP_TO_BFP DPD_BID_NAME(__dpd_trunctdtf,__bid_trunctdtf) 522*e4b17023SJohn Marino #endif /* BFP_KIND */ 523*e4b17023SJohn Marino 524*e4b17023SJohn Marino #endif /* WIDTH */ 525*e4b17023SJohn Marino 526*e4b17023SJohn Marino /* Some handy typedefs. */ 527*e4b17023SJohn Marino 528*e4b17023SJohn Marino typedef float SFtype __attribute__ ((mode (SF))); 529*e4b17023SJohn Marino typedef float DFtype __attribute__ ((mode (DF))); 530*e4b17023SJohn Marino #if LONG_DOUBLE_HAS_XF_MODE 531*e4b17023SJohn Marino typedef float XFtype __attribute__ ((mode (XF))); 532*e4b17023SJohn Marino #endif /* LONG_DOUBLE_HAS_XF_MODE */ 533*e4b17023SJohn Marino #if LONG_DOUBLE_HAS_TF_MODE 534*e4b17023SJohn Marino typedef float TFtype __attribute__ ((mode (TF))); 535*e4b17023SJohn Marino #endif /* LONG_DOUBLE_HAS_TF_MODE */ 536*e4b17023SJohn Marino 537*e4b17023SJohn Marino typedef int SItype __attribute__ ((mode (SI))); 538*e4b17023SJohn Marino typedef int DItype __attribute__ ((mode (DI))); 539*e4b17023SJohn Marino typedef unsigned int USItype __attribute__ ((mode (SI))); 540*e4b17023SJohn Marino typedef unsigned int UDItype __attribute__ ((mode (DI))); 541*e4b17023SJohn Marino 542*e4b17023SJohn Marino /* The type of the result of a decimal float comparison. This must 543*e4b17023SJohn Marino match `__libgcc_cmp_return__' in GCC for the target. */ 544*e4b17023SJohn Marino 545*e4b17023SJohn Marino typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); 546*e4b17023SJohn Marino 547*e4b17023SJohn Marino /* Prototypes. */ 548*e4b17023SJohn Marino 549*e4b17023SJohn Marino #if defined (L_mul_sd) || defined (L_mul_dd) || defined (L_mul_td) 550*e4b17023SJohn Marino extern DFP_C_TYPE DFP_MULTIPLY (DFP_C_TYPE, DFP_C_TYPE); 551*e4b17023SJohn Marino #endif 552*e4b17023SJohn Marino 553*e4b17023SJohn Marino #if defined (L_div_sd) || defined (L_div_dd) || defined (L_div_td) 554*e4b17023SJohn Marino extern DFP_C_TYPE DFP_DIVIDE (DFP_C_TYPE, DFP_C_TYPE); 555*e4b17023SJohn Marino #endif 556*e4b17023SJohn Marino 557*e4b17023SJohn Marino #if defined (L_addsub_sd) || defined (L_addsub_dd) || defined (L_addsub_td) 558*e4b17023SJohn Marino extern DFP_C_TYPE DFP_ADD (DFP_C_TYPE, DFP_C_TYPE); 559*e4b17023SJohn Marino extern DFP_C_TYPE DFP_SUB (DFP_C_TYPE, DFP_C_TYPE); 560*e4b17023SJohn Marino #endif 561*e4b17023SJohn Marino 562*e4b17023SJohn Marino #if defined (L_eq_sd) || defined (L_eq_dd) || defined (L_eq_td) 563*e4b17023SJohn Marino extern CMPtype DFP_EQ (DFP_C_TYPE, DFP_C_TYPE); 564*e4b17023SJohn Marino #endif 565*e4b17023SJohn Marino 566*e4b17023SJohn Marino #if defined (L_ne_sd) || defined (L_ne_dd) || defined (L_ne_td) 567*e4b17023SJohn Marino extern CMPtype DFP_NE (DFP_C_TYPE, DFP_C_TYPE); 568*e4b17023SJohn Marino #endif 569*e4b17023SJohn Marino 570*e4b17023SJohn Marino #if defined (L_lt_sd) || defined (L_lt_dd) || defined (L_lt_td) 571*e4b17023SJohn Marino extern CMPtype DFP_LT (DFP_C_TYPE, DFP_C_TYPE); 572*e4b17023SJohn Marino #endif 573*e4b17023SJohn Marino 574*e4b17023SJohn Marino #if defined (L_gt_sd) || defined (L_gt_dd) || defined (L_gt_td) 575*e4b17023SJohn Marino extern CMPtype DFP_GT (DFP_C_TYPE, DFP_C_TYPE); 576*e4b17023SJohn Marino #endif 577*e4b17023SJohn Marino 578*e4b17023SJohn Marino #if defined (L_le_sd) || defined (L_le_dd) || defined (L_le_td) 579*e4b17023SJohn Marino extern CMPtype DFP_LE (DFP_C_TYPE, DFP_C_TYPE); 580*e4b17023SJohn Marino #endif 581*e4b17023SJohn Marino 582*e4b17023SJohn Marino #if defined (L_ge_sd) || defined (L_ge_dd) || defined (L_ge_td) 583*e4b17023SJohn Marino extern CMPtype DFP_GE (DFP_C_TYPE, DFP_C_TYPE); 584*e4b17023SJohn Marino #endif 585*e4b17023SJohn Marino 586*e4b17023SJohn Marino #if defined (L_unord_sd) || defined (L_unord_dd) || defined (L_unord_td) 587*e4b17023SJohn Marino extern CMPtype DFP_UNORD (DFP_C_TYPE, DFP_C_TYPE); 588*e4b17023SJohn Marino #endif 589*e4b17023SJohn Marino 590*e4b17023SJohn Marino #if defined (L_sd_to_dd) || defined (L_sd_to_td) || defined (L_dd_to_sd) \ 591*e4b17023SJohn Marino || defined (L_dd_to_td) || defined (L_td_to_sd) || defined (L_td_to_dd) 592*e4b17023SJohn Marino extern DFP_C_TYPE_TO DFP_TO_DFP (DFP_C_TYPE); 593*e4b17023SJohn Marino #endif 594*e4b17023SJohn Marino 595*e4b17023SJohn Marino #if defined (L_sd_to_si) || defined (L_dd_to_si) || defined (L_td_to_si) \ 596*e4b17023SJohn Marino || defined (L_sd_to_di) || defined (L_dd_to_di) || defined (L_td_to_di) \ 597*e4b17023SJohn Marino || defined (L_sd_to_usi) || defined (L_dd_to_usi) || defined (L_td_to_usi) \ 598*e4b17023SJohn Marino || defined (L_sd_to_udi) || defined (L_dd_to_udi) || defined (L_td_to_udi) 599*e4b17023SJohn Marino extern INT_TYPE DFP_TO_INT (DFP_C_TYPE); 600*e4b17023SJohn Marino #endif 601*e4b17023SJohn Marino 602*e4b17023SJohn Marino #if defined (L_si_to_sd) || defined (L_si_to_dd) || defined (L_si_to_td) \ 603*e4b17023SJohn Marino || defined (L_di_to_sd) || defined (L_di_to_dd) || defined (L_di_to_td) \ 604*e4b17023SJohn Marino || defined (L_usi_to_sd) || defined (L_usi_to_dd) || defined (L_usi_to_td) \ 605*e4b17023SJohn Marino || defined (L_udi_to_sd) || defined (L_udi_to_dd) || defined (L_udi_to_td) 606*e4b17023SJohn Marino extern DFP_C_TYPE INT_TO_DFP (INT_TYPE); 607*e4b17023SJohn Marino #endif 608*e4b17023SJohn Marino 609*e4b17023SJohn Marino #if defined (L_sd_to_sf) || defined (L_dd_to_sf) || defined (L_td_to_sf) \ 610*e4b17023SJohn Marino || defined (L_sd_to_df) || defined (L_dd_to_df) || defined (L_td_to_df) \ 611*e4b17023SJohn Marino || ((defined (L_sd_to_xf) || defined (L_dd_to_xf) || defined (L_td_to_xf)) \ 612*e4b17023SJohn Marino && LONG_DOUBLE_HAS_XF_MODE) \ 613*e4b17023SJohn Marino || ((defined (L_sd_to_tf) || defined (L_dd_to_tf) || defined (L_td_to_tf)) \ 614*e4b17023SJohn Marino && LONG_DOUBLE_HAS_TF_MODE) 615*e4b17023SJohn Marino extern BFP_TYPE DFP_TO_BFP (DFP_C_TYPE); 616*e4b17023SJohn Marino #endif 617*e4b17023SJohn Marino 618*e4b17023SJohn Marino #if defined (L_sf_to_sd) || defined (L_sf_to_dd) || defined (L_sf_to_td) \ 619*e4b17023SJohn Marino || defined (L_df_to_sd) || defined (L_df_to_dd) || defined (L_df_to_td) \ 620*e4b17023SJohn Marino || ((defined (L_xf_to_sd) || defined (L_xf_to_dd) || defined (L_xf_to_td)) \ 621*e4b17023SJohn Marino && LONG_DOUBLE_HAS_XF_MODE) \ 622*e4b17023SJohn Marino || ((defined (L_tf_to_sd) || defined (L_tf_to_dd) || defined (L_tf_to_td)) \ 623*e4b17023SJohn Marino && LONG_DOUBLE_HAS_TF_MODE) 624*e4b17023SJohn Marino extern DFP_C_TYPE BFP_TO_DFP (BFP_TYPE); 625*e4b17023SJohn Marino #endif 626*e4b17023SJohn Marino 627*e4b17023SJohn Marino #endif /* _DFPBIT_H */ 628