Blame sysdeps/sparc/fpu/fpu_control.h

Packit 6c4009
/* FPU control word bits.  SPARC version.
Packit 6c4009
   Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by Miguel de Icaza
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _FPU_CONTROL_H
Packit 6c4009
#define _FPU_CONTROL_H	1
Packit 6c4009
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <bits/wordsize.h>
Packit 6c4009
Packit 6c4009
/* masking of interrupts */
Packit 6c4009
#define _FPU_MASK_IM  0x08000000
Packit 6c4009
#define _FPU_MASK_OM  0x04000000
Packit 6c4009
#define _FPU_MASK_UM  0x02000000
Packit 6c4009
#define _FPU_MASK_ZM  0x01000000
Packit 6c4009
#define _FPU_MASK_PM  0x00800000
Packit 6c4009
Packit 6c4009
/* precision control */
Packit 6c4009
#define _FPU_EXTENDED 0x00000000     /* RECOMMENDED */
Packit 6c4009
#define _FPU_DOUBLE   0x20000000
Packit 6c4009
#define _FPU_80BIT    0x30000000
Packit 6c4009
#define _FPU_SINGLE   0x10000000     /* DO NOT USE */
Packit 6c4009
Packit 6c4009
/* rounding control / Sparc */
Packit 6c4009
#define _FPU_RC_DOWN    0xc0000000
Packit 6c4009
#define _FPU_RC_UP      0x80000000
Packit 6c4009
#define _FPU_RC_ZERO    0x40000000
Packit 6c4009
#define _FPU_RC_NEAREST 0x0        /* RECOMMENDED */
Packit 6c4009
Packit 6c4009
#define _FPU_RESERVED   0x30300000  /* Reserved bits in cw */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Now two recommended cw */
Packit 6c4009
Packit 6c4009
/* Linux and IEEE default:
Packit 6c4009
     - extended precision
Packit 6c4009
     - rounding to nearest
Packit 6c4009
     - no exceptions  */
Packit 6c4009
#define _FPU_DEFAULT  0x0
Packit 6c4009
#define _FPU_IEEE     0x0
Packit 6c4009
Packit 6c4009
/* Type of the control word.  */
Packit 6c4009
typedef unsigned long int fpu_control_t;
Packit 6c4009
Packit 6c4009
#if __WORDSIZE == 64
Packit 6c4009
# define _FPU_GETCW(cw) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (*&cw))
Packit 6c4009
# define _FPU_SETCW(cw) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (*&cw))
Packit 6c4009
#else
Packit 6c4009
# define _FPU_GETCW(cw) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (*&cw))
Packit 6c4009
# define _FPU_SETCW(cw) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (*&cw))
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Default control word set at startup.  */
Packit 6c4009
extern fpu_control_t __fpu_control;
Packit 6c4009
Packit 6c4009
#endif	/* fpu_control.h */