]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/sparc/sparc32/fpu/fpu_control.h
Update.
[thirdparty/glibc.git] / sysdeps / sparc / sparc32 / fpu / fpu_control.h
CommitLineData
fd26970f 1/* FPU control word bits. SPARC version.
cb0509a8 2 Copyright (C) 1997, 1998 Free Software Foundation, Inc.
fd26970f
UD
3 This file is part of the GNU C Library.
4 Contributed by Miguel de Icaza
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21#ifndef _FPU_CONTROL_H
22#define _FPU_CONTROL_H 1
23
24
25#include <features.h>
26
27/* precision control */
28#define _FPU_EXTENDED 0x00000000 /* RECOMMENDED */
29#define _FPU_DOUBLE 0x20000000
30#define _FPU_80BIT 0x30000000
31#define _FPU_SINGLE 0x10000000 /* DO NOT USE */
32
33/* rounding control / Sparc */
63551311
UD
34#define _FPU_RC_DOWN 0xc0000000
35#define _FPU_RC_UP 0x80000000
fd26970f 36#define _FPU_RC_ZERO 0x40000000
63551311 37#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */
fd26970f 38
63551311 39#define _FPU_RESERVED 0x30300000 /* Reserved bits in cw */
fd26970f
UD
40
41
42/* Now two recommended cw */
43
f41c8091 44/* Linux and IEEE default:
fd26970f
UD
45 - extended precision
46 - rounding to nearest
f41c8091
UD
47 - no exceptions. */
48#define _FPU_DEFAULT 0x0
fd26970f
UD
49#define _FPU_IEEE 0x0
50
fd26970f 51/* Type of the control word. */
63551311 52typedef unsigned int fpu_control_t;
fd26970f
UD
53
54#define _FPU_GETCW(cw) __asm__ ("st %%fsr,%0" : "=m" (*&cw))
63551311 55#define _FPU_SETCW(cw) __asm__ ("ld %0,%%fsr" : : "m" (*&cw))
fd26970f
UD
56
57/* Default control word set at startup. */
58extern fpu_control_t __fpu_control;
59
fd26970f 60#endif /* fpu_control.h */