Blame sysdeps/s390/fpu/fetestexceptflag.c

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