Blame sysdeps/s390/fpu/fetestexceptflag.c

Packit Service 3b0880
/* Test exception in saved exception state.  S/390 version.
Packit Service 3b0880
   Copyright (C) 2016-2018 Free Software Foundation, Inc.
Packit Service f16287
   This file is part of the GNU C Library.
Packit Service f16287
Packit Service f16287
   The GNU C Library is free software; you can redistribute it and/or
Packit Service f16287
   modify it under the terms of the GNU Lesser General Public
Packit Service f16287
   License as published by the Free Software Foundation; either
Packit Service f16287
   version 2.1 of the License, or (at your option) any later version.
Packit Service f16287
Packit Service f16287
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service f16287
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service f16287
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service f16287
   Lesser General Public License for more details.
Packit Service f16287
Packit Service f16287
   You should have received a copy of the GNU Lesser General Public
Packit Service f16287
   License along with the GNU C Library; if not, see
Packit Service 3b0880
   <http://www.gnu.org/licenses/>.  */
Packit Service f16287
Packit Service 3b0880
#include <fenv.h>
Packit Service 3b0880
#include <fenv_libc.h>
Packit Service f16287
Packit Service f16287
int
Packit Service 3b0880
fetestexceptflag (const fexcept_t *flagp, int excepts)
Packit Service f16287
{
Packit Service 3b0880
  /* As *flagp is obtained by an earlier call of fegetexceptflag the
Packit Service 3b0880
     bits 0-5 of dxc-byte are either zero or correspond to the
Packit Service 3b0880
     flag-bits.  Evaluate flags and last dxc-exception-code.  */
Packit Service 3b0880
  return (((*flagp >> FPC_FLAGS_SHIFT) | (*flagp >> FPC_DXC_SHIFT))
Packit Service 3b0880
	  & excepts
Packit Service 3b0880
	  & FE_ALL_EXCEPT);
Packit Service f16287
}