From fb27b3f6ef2fe946ef98a74bbfb83eac9819df1c Mon Sep 17 00:00:00 2001 From: Janis Johnson Date: Tue, 11 Sep 2007 00:25:18 +0000 Subject: dfp-bit.c (dfp_unary_func): Delete. * config/dfp-bit.c (dfp_unary_func): Delete. (dfp_unary_op): Delete. (dfp_binary_op): Use decFloat functions instead of decNumber functions for binary operations. (d32_binary_op): Convert 32-bit operands to 64 bits for evaluation. (dnn_binary_op): Call dfp_binary_op with decFloat rather than DFP_C_TYPE. (dfp_compare_op): Use decFloat functions insteadof decNumber functions for comparisons. (d32_compare_op): Convert 32-bit operands to 64 bits for evaluation. (dnn_binary_op): Call dfp_compare_op with decFloat rather than DFP_C_TYPE. (DFP_ADD, DFP_SUB, DFP_MULTIPLE, DFP_DIVIDE): Use macros for call to dxx_binary_op and decFloat function. (DFP_EQ, DFP_NE, DFP_LT, DFP_GT, DFP_LE, DFP_GE): Use macros for calls to dxx_binary_op and decFloat function. * config/dfp-bit.h: Include decFloat header files. (decFloat, DFP_BINARY_OP, DFP_COMPARE_OP, DEC_FLOAT_ADD, DEC_FLOAT_SUBTRACT, DEC_FLOAT_MULTIPLY, DEC_FLOAT_DIVIDE, DEC_FLOAT_COMPARE, DEC_FLOAT_IS_ZERO, DEC_FLOAT_IS_NAN, DEC_FLOAT_IS_SIGNED: Define for each of 3 operand widths. From-SVN: r128358 --- gcc/config/dfp-bit.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'gcc/config/dfp-bit.h') diff --git a/gcc/config/dfp-bit.h b/gcc/config/dfp-bit.h index dfbf4f4..7c47387 100644 --- a/gcc/config/dfp-bit.h +++ b/gcc/config/dfp-bit.h @@ -277,12 +277,15 @@ extern float strtof (const char *, char **); #if WIDTH == 128 || WIDTH_TO == 128 #include "decimal128.h" +#include "decQuad.h" #endif #if WIDTH == 64 || WIDTH_TO == 64 #include "decimal64.h" +#include "decDouble.h" #endif #if WIDTH == 32 || WIDTH_TO == 32 #include "decimal32.h" +#include "decSingle.h" #endif #include "decNumber.h" @@ -332,6 +335,46 @@ extern float strtof (const char *, char **); #define DFP_UNORD DPD_BID_NAME(__dpd_unordtd2,__bid_unordtd2) #endif +/* Names of decNumber functions for DPD arithmetic. */ + +#if WIDTH == 32 +#define decFloat decDouble +#define DFP_BINARY_OP d32_binary_op +#define DFP_COMPARE_OP d32_compare_op +#define DEC_FLOAT_ADD decDoubleAdd +#define DEC_FLOAT_SUBTRACT decDoubleSubtract +#define DEC_FLOAT_MULTIPLY decDoubleMultiply +#define DEC_FLOAT_DIVIDE decDoubleDivide +#define DEC_FLOAT_COMPARE decDoubleCompare +#define DEC_FLOAT_IS_ZERO decDoubleIsZero +#define DEC_FLOAT_IS_NAN decDoubleIsNaN +#define DEC_FLOAT_IS_SIGNED decDoubleIsSigned +#elif WIDTH == 64 +#define DFP_BINARY_OP dnn_binary_op +#define DFP_COMPARE_OP dnn_compare_op +#define decFloat decDouble +#define DEC_FLOAT_ADD decDoubleAdd +#define DEC_FLOAT_SUBTRACT decDoubleSubtract +#define DEC_FLOAT_MULTIPLY decDoubleMultiply +#define DEC_FLOAT_DIVIDE decDoubleDivide +#define DEC_FLOAT_COMPARE decDoubleCompare +#define DEC_FLOAT_IS_ZERO decDoubleIsZero +#define DEC_FLOAT_IS_NAN decDoubleIsNaN +#define DEC_FLOAT_IS_SIGNED decDoubleIsSigned +#elif WIDTH == 128 +#define DFP_BINARY_OP dnn_binary_op +#define DFP_COMPARE_OP dnn_compare_op +#define decFloat decQuad +#define DEC_FLOAT_ADD decQuadAdd +#define DEC_FLOAT_SUBTRACT decQuadSubtract +#define DEC_FLOAT_MULTIPLY decQuadMultiply +#define DEC_FLOAT_DIVIDE decQuadDivide +#define DEC_FLOAT_COMPARE decQuadCompare +#define DEC_FLOAT_IS_ZERO decQuadIsZero +#define DEC_FLOAT_IS_NAN decQuadIsNaN +#define DEC_FLOAT_IS_SIGNED decQuadIsSigned +#endif + /* Names of functions to convert between different decimal float types. */ #if WIDTH == 32 -- cgit v1.1