----------------->  GNU Sather - compiler configuration file  <----------------
-- Copyright (C) 199x by International Computer Science Institute            --
-- This file is part of the GNU Sather library. It is free software; you may --
-- redistribute  and/or modify it under the terms of the GNU Library General --
-- Public  License (LGPL)  as published  by the  Free  Software  Foundation; --
-- either version 2 of the license, or (at your option) any later version.   --
-- This  library  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 Doc/LGPL for more details.       --
-- The license text is also available from:  Free Software Foundation, Inc., --
-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     --
-------------->  Please email comments to <bug-sather@gnu.org>  <--------------

#ifndef FLT_CONFIG
#define FLT_CONFIG

#ifdef PP
#undef PP
#endif

#ifdef APP
#undef APP
#endif

#ifdef FPP
#undef FPP
#endif

#ifdef VSTD
#undef VSTD
#endif

#define PP	no_pre,no_post
#define APP	arith,PP
#define FPP	fragile,PP
#define VSTD    var "@r $$;"

-- the following definitions assume that all floating point 
-- operations return NaN if used with wrong arguments (a la IEEE)
-- If this is not the case for some machines, all functions that
-- could break should get a 'fragile'
FLT_PLUS:	PP,VSTD,exec "$$=$0+$1;" "$$";
FLT_MINUS:	PP,VSTD,exec "$$=$0-$1;" "$$";
FLT_NEGATE:	PP,VSTD,exec "$$= -$0;" "$$";
FLT_TIMES:	PP,VSTD,exec "$$=$0*$1;" "$$";
FLT_DIV:	PP,VSTD,exec "$$=FLTDIV($0,$1);" "$$";
FLT_IS_EQ:	PP,VSTD,exec "$$=($0)==($1);" "$$";
FLT_IS_LT:	PP,VSTD,exec "$$=($0)<($1);" "$$";
IR_ISNORMAL:	PP,VSTD,declare "_FM_B_F(isnormal)",exec "$$=ir_isnormal($0);" "$$";
IR_ISSUBNORMAL:	PP,VSTD,declare "_FM_B_F(issubnormal)",exec "$$=ir_issubnormal($0);" "$$";
IR_ISZERO:	PP,VSTD,declare "_FM_B_F(iszero)",exec "$$=ir_iszero($0);" "$$";
IR_SIGNBIT:	PP,VSTD,declare "_FM_B_F(signbit)",exec "$$=ir_signbit($0);" "$$";
IR_ILOGB:	PP,VSTD,declare "_FM_I_F(ilogb)",exec "$$=ir_ilogb($0);" "$$";
R_COPYSIGN:	PP,VSTD,declare "_FM_F_F(copysign)",exec "$$=r_copysign($0,$1);" "$$";
R_NEXTUP:	PP,VSTD,declare "_FM_F_FF(nextafter)",exec "$$=r_nextafter($0,1.0);" "$$";
R_NEXTDOWN:	PP,VSTD,declare "_FM_F_FF(nextafter)",exec "$$=r_nextafter($0,-1.0);" "$$";
R_REMAINDER:	PP,VSTD,declare "_FM_F_F(remainder)",exec "$$=r_remainder($0,$1);" "$$";
R_FMOD:		PP,VSTD,declare "_FM_F_FF(fmod)",exec "$$=r_fmod($0,$1);" "$$";
R_SCALBN:	PP,VSTD,declare "_FM_F_FI(scalbn)",exec "$$=r_scalbn($0,$1);" "$$";
R_J0:		PP,VSTD,declare "_FM_F_F(j0)",exec "$$=r_j0($0);" "$$";
R_J1:		PP,VSTD,declare "_FM_F_F(j1)",exec "$$=r_j1($0);" "$$";
R_JN:		PP,VSTD,declare "_FM_F_IF(jn)",exec "$$=r_jn($1,$0);" "$$";
R_Y0:		PP,VSTD,declare "_FM_F_F(y0)",exec "$$=r_y0($0);" "$$";
R_Y1:		PP,VSTD,declare "_FM_F_F(y1)",exec "$$=r_y1($0);" "$$";
R_YN:		PP,VSTD,declare "_FM_F_IF(yn)",exec "$$=r_yn($1,$0);" "$$";
R_ERF:		PP,VSTD,declare "_FM_F_F(erf)",exec "$$=r_erf($0);" "$$";
R_ERFC:		PP,VSTD,declare "_FM_F_F(erfc)",exec "$$=r_erfc($0);" "$$";
R_EXP:		PP,VSTD,declare "_FM_F_F(exp)",exec "$$=r_exp($0);" "$$";
R_EXPM1:	PP,VSTD,declare "_FM_F_F(expm1)",exec "$$=r_expm1($0);" "$$";
R_EXP2:		PP,VSTD,declare "_FM_F_F(exp2)",exec "$$=r_exp2($0);" "$$";
R_EXP10:	PP,VSTD,declare "_FM_F_F(exp10)",exec "$$=r_exp10($0);" "$$";
R_LOG:		PP,VSTD,declare "_FM_F_F(log)",exec "$$=r_log($0);" "$$";
R_LOG1P:	PP,VSTD,declare "_FM_F_F(log1p)",exec "$$=r_log1p($0);" "$$";
R_LOG10:	PP,VSTD,declare "_FM_F_F(log10)",exec "$$=r_log10($0);" "$$";
R_POW:		PP,VSTD,declare "_FM_F_FF(pow)",exec "$$=r_pow($0,$1);" "$$";
R_SINH:		PP,VSTD,declare "_FM_F_F(sinh)",exec "$$=r_sinh($0);" "$$";
R_COSH:		PP,VSTD,declare "_FM_F_F(cosh)",exec "$$=r_cosh($0);" "$$";
R_TANH:		PP,VSTD,declare "_FM_F_F(tanh)",exec "$$=r_tanh($0);" "$$";
R_ASINH:	PP,VSTD,declare "_FM_F_F(asinh)",exec "$$=r_asinh($0);" "$$";
R_ACOSH:	PP,VSTD,declare "_FM_F_F(acosh)",exec "$$=r_acosh($0);" "$$";
R_ATANH:	PP,VSTD,declare "_FM_F_F(atanh)",exec "$$=r_atanh($0);" "$$";
R_HYPOT:	PP,VSTD,declare "_FM_F_FF(hypot)",exec "$$=r_hypot($0,$1);" "$$";
R_SIN:		PP,VSTD,declare "_FM_F_F(sin)",exec "$$=r_sin($0);" "$$";
R_COS:		PP,VSTD,declare "_FM_F_F(cos)",exec "$$=r_cos($0);" "$$";
SINCOS:		PP,exec "sincos($0,&$1,&$2);";
R_TAN:		PP,VSTD,declare "_FM_F_F(tan)",exec "$$=r_tan($0);" "$$";
R_ASIN:		PP,VSTD,declare "_FM_F_F(asin)",exec "$$=r_asin($0);" "$$";
R_ACOS:		PP,VSTD,declare "_FM_F_F(acos)",exec "$$=r_acos($0);" "$$";
R_ATAN:		PP,VSTD,declare "_FM_F_F(atan)",exec "$$=r_atan($0);" "$$";
R_ATAN2:	PP,VSTD,declare "_FM_F_FF(atan2)",exec "$$=r_atan2($0,$1);" "$$";
R_SINPI:	PP,VSTD,declare "_FM_F_F(sinpi)",exec "$$=r_sinpi($0);" "$$";
R_COSPI:	PP,VSTD,declare "_FM_F_F(cospi)",exec "$$=r_cospi($0);" "$$";
SINCOSPI:	PP,exec "sincospi($0,&$1,&$2);";
R_TANPI:	PP,VSTD,declare "_FM_F_F(tanpi)",exec "$$=r_tanpi($0);" "$$";
R_ASINPI:	PP,VSTD,declare "_FM_F_F(asinpi)",exec "$$=r_asinpi($0);" "$$";
R_ACOSPI:	PP,VSTD,declare "_FM_F_F(acospi)",exec "$$=r_acospi($0);" "$$";
R_ATANPI:	PP,VSTD,declare "_FM_F_F(atanpi)",exec "$$=r_atanpi($0);" "$$";
R_ATAN2PI:	PP,VSTD,declare "_FM_F_FF(atan2pi)",exec "$$=r_atan2pi($0,$1);" "$$";
R_FABS:		PP,VSTD,declare "_FM_F_F(fabs)",exec "$$=r_fabs($0);" "$$";
R_LGAMMA:	PP,VSTD,declare "_FM_F_F(lgamma)",exec "$$=r_lgamma($0);" "$$";
R_SQRT:		PP,VSTD,declare "_FM_F_F(sqrt)",exec "$$=r_sqrt($0);" "$$";
R_CBRT:		PP,VSTD,declare "_FM_F_F(cbrt)",exec "$$=r_cbrt($0);" "$$";
ATOF:		PP,VSTD,exec "$$=atof($1->arr_part);" "$$";
FLT_INT:	PP,VSTD,exec "$$=FLTINT($0);" "$$";
FLT_FLTD: 	PP,VSTD,exec "$$=(@r)$0;" "$$";
FLT_FLTX: 	PP,VSTD,exec "$$=(@r)$0;" "$$";
FLT_FLTDX:	PP,VSTD,exec "$$=(@r)$0;" "$$";
FLT_TRUNCATE:	PP,VSTD,exec "$$=FLTTRUNCATE($0);" "$$";
R_FLOOR:	PP,VSTD,declare "_FM_F_F(floor)",exec "$$=r_floor($0);" "$$";
R_CEIL:		PP,VSTD,declare "_FM_F_F(ceil)",exec "$$=r_ceil($0);" "$$";
FLT_ROUND:	PP,VSTD,exec "$$=FLTROUND($0);" "$$";
R_SIGNALING_NAN:PP,VSTD,declare "_FM_F_I(signaling_nan)",exec "$$=r_signaling_nan($1);" "$$";
R_QUIET_NAN:	PP,VSTD,declare "_FM_F_I(quiet_nan)",exec "$$=r_quiet_nan($1);" "$$";
R_INFINITY:	PP,VSTD,declare "_FM_F(infinity)",exec "$$=r_infinity();" "$$";
MIN_NORMAL:	PP,VSTD,exec "$$=FLTMINNORMAL;" "$$";
MAX_NORMAL:	PP,VSTD,exec "$$=FLTMAXNORMAL;" "$$";
MIN_SUBNORMAL:	PP,VSTD,exec "$$=FLTMINSUBNORMAL;" "$$";
MAX_SUBNORMAL:	PP,VSTD,exec "$$=FLTMAXSUBNORMAL;" "$$";
FLT_STORE_INTO: volatile,PP,VSTD,exec "$$=FLTSTORE($0,$1);" "$$";
FLT_STORE_PREC: volatile,PP,VSTD,exec "$$=FLTSTOREPREC($0,$1,$2);" "$$";
FLT_GET_REP:	PP,exec "rt_flt_get_rep($0,$1,$2,$3);";
#endif
