/*------------------------->  Sather - configfile  <-------------------------*/
/* Copyright (C) 2000 by K Hopper, University of Waikato, New Zealand        */
/* 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 VSTD
#undef VSTD
#endif

#define PP	no_pre,no_post
#define VSTD    var "@r $$;"

--   NOTE 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 be 'fragile'.

FLT_QUIET_NAN:	PP,VSTD,declare "_FM_F_I(quiet_nan)",exec "$$=r_quiet_nan($1);" "$$";
FLT_SIGNALLING_NAN:PP,VSTD,declare "_FM_F_I(signaling_nan)",exec "$$=r_signaling_nan($1);" "$$";
FLT_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_CARD:       PP,VSTD,exec "$$=FLTCARD($0);" "$$";
FLT_FIELD:      PP,VSTD,exec "$$=FLTFIELD($0);" "$$";
FLT_INT:	PP,VSTD,exec "$$=FLTINT($0);" "$$";
FLT_FLTD: 	PP,VSTD,exec "$$=(@r)$0;" "$$";

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);" "$$";
FLT_ISNORMAL:   PP,VSTD,declare "_FM_B_F(isnormal)",exec "$$=ir_isnormal($0);" "$$";
FLT_ISSUBNORMAL:PP,VSTD,declare "_FM_B_F(issubnormal)",exec "$$=ir_issubnormal($0);" "$$";
FLT_ISZERO:	PP,VSTD,declare "_FM_B_F(iszero)",exec "$$=ir_iszero($0);" "$$";

FLT_SIGNBIT:	PP,VSTD,declare "_FM_B_F(signbit)",exec "$$=ir_signbit($0);" "$$";
FLT_ILOGB:	PP,VSTD,declare "_FM_I_F(ilogb)",exec "$$=ir_ilogb($0);" "$$";
FLT_COPYSIGN:	PP,VSTD,declare "_FM_F_F(copysign)",exec "$$=r_copysign($0,$1);" "$$";
FLT_NEXTUP:	PP,VSTD,declare "_FM_F_FF(nextafter)",exec "$$=r_nextafter($0,1.0);" "$$";
FLT_NEXTDOWN:	PP,VSTD,declare "_FM_F_FF(nextafter)",exec "$$=r_nextafter($0,-1.0);" "$$";
FLT_SCALBN:	PP,VSTD,declare "_FM_F_FI(scalbn)",exec "$$=r_scalbn($0,$1);" "$$";
FLT_GET_REP:	PP,exec "rt_flt_get_rep($0,$1,$2,$3);";
FLT_TRUNCATE:	PP,VSTD,exec "$$=FLTTRUNCATE($0);" "$$";
FLT_FLOOR:	PP,VSTD,declare "_FM_F_F(floor)",exec "$$=r_floor($0);" "$$";
FLT_CEIL:	PP,VSTD,declare "_FM_F_F(ceil)",exec "$$=r_ceil($0);" "$$";
FLT_ROUND:	PP,VSTD,exec "$$=FLTROUND($0);" "$$";
FLT_REMAINDER:	PP,VSTD,declare "_FM_F_F(remainder)",exec "$$=r_remainder($0,$1);" "$$";
FLT_FMOD:	PP,VSTD,declare "_FM_F_FF(fmod)",exec "$$=r_fmod($0,$1);" "$$";
FLT_FABS:	PP,VSTD,declare "_FM_F_F(fabs)",exec "$$=r_fabs($0);" "$$";
FLT_SQRT:	PP,VSTD,declare "_FM_F_F(sqrt)",exec "$$=r_sqrt($0);" "$$";
FLT_CBRT:	PP,VSTD,declare "_FM_F_F(cbrt)",exec "$$=r_cbrt($0);" "$$";

#endif
