Exemple #1
0
static bool
fold_const_call_sss (real_value *result, combined_fn fn,
		     const real_value *arg0, const real_value *arg1,
		     const real_format *format)
{
  switch (fn)
    {
    CASE_CFN_DREM:
    CASE_CFN_REMAINDER:
      return do_mpfr_arg2 (result, mpfr_remainder, arg0, arg1, format);

    CASE_CFN_ATAN2:
      return do_mpfr_arg2 (result, mpfr_atan2, arg0, arg1, format);

    CASE_CFN_FDIM:
      return do_mpfr_arg2 (result, mpfr_dim, arg0, arg1, format);

    CASE_CFN_HYPOT:
      return do_mpfr_arg2 (result, mpfr_hypot, arg0, arg1, format);

    CASE_CFN_COPYSIGN:
    CASE_CFN_COPYSIGN_FN:
      *result = *arg0;
      real_copysign (result, arg1);
      return true;

    CASE_CFN_FMIN:
    CASE_CFN_FMIN_FN:
      return do_mpfr_arg2 (result, mpfr_min, arg0, arg1, format);

    CASE_CFN_FMAX:
    CASE_CFN_FMAX_FN:
      return do_mpfr_arg2 (result, mpfr_max, arg0, arg1, format);

    CASE_CFN_POW:
      return fold_const_pow (result, arg0, arg1, format);

    default:
      return false;
    }
}
Exemple #2
0
static bool
fold_const_call_sss (real_value *result, built_in_function fn,
		     const real_value *arg0, const real_value *arg1,
		     const real_format *format)
{
  switch (fn)
    {
    CASE_FLT_FN (BUILT_IN_DREM):
    CASE_FLT_FN (BUILT_IN_REMAINDER):
      return do_mpfr_arg2 (result, mpfr_remainder, arg0, arg1, format);

    CASE_FLT_FN (BUILT_IN_ATAN2):
      return do_mpfr_arg2 (result, mpfr_atan2, arg0, arg1, format);

    CASE_FLT_FN (BUILT_IN_FDIM):
      return do_mpfr_arg2 (result, mpfr_dim, arg0, arg1, format);

    CASE_FLT_FN (BUILT_IN_HYPOT):
      return do_mpfr_arg2 (result, mpfr_hypot, arg0, arg1, format);

    CASE_FLT_FN (BUILT_IN_COPYSIGN):
      *result = *arg0;
      real_copysign (result, arg1);
      return true;

    CASE_FLT_FN (BUILT_IN_FMIN):
      return do_mpfr_arg2 (result, mpfr_min, arg0, arg1, format);

    CASE_FLT_FN (BUILT_IN_FMAX):
      return do_mpfr_arg2 (result, mpfr_max, arg0, arg1, format);

    CASE_FLT_FN (BUILT_IN_POW):
      return fold_const_pow (result, arg0, arg1, format);

    default:
      return false;
    }
}