Blame sysdeps/s390/fpu/s_llroundf.c

Packit Service 52c0ba
/* llroundf() - S390 version.
Packit Service 52c0ba
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit Service 52c0ba
Packit Service 52c0ba
   This file is part of the GNU C Library.
Packit Service 52c0ba
Packit Service 52c0ba
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 52c0ba
   modify it under the terms of the GNU Lesser General Public License as
Packit Service 52c0ba
   published by the Free Software Foundation; either version 2.1 of the
Packit Service 52c0ba
   License, or (at your option) any later version.
Packit Service 52c0ba
Packit Service 52c0ba
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 52c0ba
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 52c0ba
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 52c0ba
   Lesser General Public License for more details.
Packit Service 52c0ba
Packit Service 52c0ba
   You should have received a copy of the GNU Lesser General Public
Packit Service 52c0ba
   License along with the GNU C Library; if not, see
Packit Service 52c0ba
   <https://www.gnu.org/licenses/>.  */
Packit Service 52c0ba
Packit Service 52c0ba
#if defined __s390x__ && defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
Packit Service 52c0ba
/* We only support s390x as on s390 a long long int refers to a register pair
Packit Service 52c0ba
   of two 4byte registers instead of a 8byte register which is produced by the
Packit Service 52c0ba
   instruction.
Packit Service 52c0ba
   Note: On s390 this instruction would only be used if build with -mzarch.  */
Packit Service 52c0ba
# include <math.h>
Packit Service 52c0ba
# include <libm-alias-float.h>
Packit Service 52c0ba
Packit Service 52c0ba
long long int
Packit Service 52c0ba
__llroundf (float x)
Packit Service 52c0ba
{
Packit Service 52c0ba
  long long int y;
Packit Service 52c0ba
  /* The z196 zarch "convert to fixed" (cgebra) instruction is rounding
Packit Service 52c0ba
     x to the nearest integer with "ties away from 0" rounding mode
Packit Service 52c0ba
     (M3-field: 1) where inexact exceptions are suppressed (M4-field: 4).  */
Packit Service 52c0ba
  __asm__ ("cgebra %0,1,%1,4" : "=d" (y) : "f" (x) : "cc");
Packit Service 52c0ba
  return y;
Packit Service 52c0ba
}
Packit Service 52c0ba
libm_alias_float (__llround, llround)
Packit Service 52c0ba
Packit Service 52c0ba
#else
Packit Service 52c0ba
# include <sysdeps/ieee754/flt-32/s_llroundf.c>
Packit Service 52c0ba
#endif