Blame sysdeps/s390/fpu/math-barriers.h

Packit Bot f3118b
/* Control when floating-point expressions are evaluated.  s390 version.
Packit Bot f3118b
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit Bot f3118b
   This file is part of the GNU C Library.
Packit Bot f3118b
Packit Bot f3118b
   The GNU C Library is free software; you can redistribute it and/or
Packit Bot f3118b
   modify it under the terms of the GNU Lesser General Public
Packit Bot f3118b
   License as published by the Free Software Foundation; either
Packit Bot f3118b
   version 2.1 of the License, or (at your option) any later version.
Packit Bot f3118b
Packit Bot f3118b
   The GNU C Library is distributed in the hope that it will be useful,
Packit Bot f3118b
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot f3118b
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Bot f3118b
   Lesser General Public License for more details.
Packit Bot f3118b
Packit Bot f3118b
   You should have received a copy of the GNU Lesser General Public
Packit Bot f3118b
   License along with the GNU C Library; if not, see
Packit Bot f3118b
   <https://www.gnu.org/licenses/>.  */
Packit Bot f3118b
Packit Bot f3118b
#ifndef S390_MATH_BARRIERS_H
Packit Bot f3118b
#define S390_MATH_BARRIERS_H 1
Packit Bot f3118b
Packit Bot f3118b
#ifdef HAVE_S390_VX_GCC_SUPPORT
Packit Bot f3118b
# define ASM_CONSTRAINT_VR "v"
Packit Bot f3118b
#else
Packit Bot f3118b
# define ASM_CONSTRAINT_VR
Packit Bot f3118b
#endif
Packit Bot f3118b
Packit Bot f3118b
#define math_opt_barrier(x)						\
Packit Bot f3118b
  ({ __typeof (x) __x = (x);						\
Packit Bot f3118b
    if (__builtin_types_compatible_p (__typeof (x), _Float128))		\
Packit Bot f3118b
      __asm__ ("# math_opt_barrier_f128 %0" : "+fm" (__x));		\
Packit Bot f3118b
    else								\
Packit Bot f3118b
      __asm__ ("# math_opt_barrier %0"					\
Packit Bot f3118b
	       : "+f" ASM_CONSTRAINT_VR "m" (__x));			\
Packit Bot f3118b
    __x; })
Packit Bot f3118b
#define math_force_eval(x)						\
Packit Bot f3118b
  ({ __typeof (x) __x = (x);						\
Packit Bot f3118b
    if (__builtin_types_compatible_p (__typeof (x), _Float128))		\
Packit Bot f3118b
      __asm__ __volatile__ ("# math_force_eval_f128 %0"			\
Packit Bot f3118b
			    : : "fm" (__x));				\
Packit Bot f3118b
    else								\
Packit Bot f3118b
      __asm__ __volatile__ ("# math_force_eval %0"			\
Packit Bot f3118b
			    : : "f" ASM_CONSTRAINT_VR "m" (__x));	\
Packit Bot f3118b
  })
Packit Bot f3118b
Packit Bot f3118b
#endif