OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [sparc/] [fpu_control.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* FPU control word bits.  SPARC version.
2
   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
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 Lesser General Public
8
   License as published by the Free Software Foundation; either
9
   version 2.1 of the 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
   Lesser General Public License for more details.
15
 
16
   You should have received a copy of the GNU Lesser General Public
17
   License along with the GNU C Library; if not, write to the Free
18
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19
   02111-1307 USA.  */
20
 
21
#ifndef _FPU_CONTROL_H
22
#define _FPU_CONTROL_H  1
23
 
24
 
25
#include <features.h>
26
#include <bits/wordsize.h>
27
 
28
/* masking of interrupts */
29
#define _FPU_MASK_IM  0x08000000
30
#define _FPU_MASK_OM  0x04000000
31
#define _FPU_MASK_UM  0x02000000
32
#define _FPU_MASK_ZM  0x01000000
33
#define _FPU_MASK_PM  0x00800000
34
 
35
/* precision control */
36
#define _FPU_EXTENDED 0x00000000     /* RECOMMENDED */
37
#define _FPU_DOUBLE   0x20000000
38
#define _FPU_80BIT    0x30000000
39
#define _FPU_SINGLE   0x10000000     /* DO NOT USE */
40
 
41
/* rounding control / Sparc */
42
#define _FPU_RC_DOWN    0xc0000000
43
#define _FPU_RC_UP      0x80000000
44
#define _FPU_RC_ZERO    0x40000000
45
#define _FPU_RC_NEAREST 0x0        /* RECOMMENDED */
46
 
47
#define _FPU_RESERVED   0x30300000  /* Reserved bits in cw */
48
 
49
 
50
/* Now two recommended cw */
51
 
52
/* Linux and IEEE default:
53
     - extended precision
54
     - rounding to nearest
55
     - no exceptions  */
56
#define _FPU_DEFAULT  0x0
57
#define _FPU_IEEE     0x0
58
 
59
/* Type of the control word.  */
60
typedef unsigned long int fpu_control_t;
61
 
62
#if __WORDSIZE == 64
63
# define _FPU_GETCW(cw) __asm__ ("stx %%fsr,%0" : "=m" (*&cw))
64
# define _FPU_SETCW(cw) __asm__ ("ldx %0,%%fsr" : : "m" (*&cw))
65
#else
66
# define _FPU_GETCW(cw) __asm__ ("st %%fsr,%0" : "=m" (*&cw))
67
# define _FPU_SETCW(cw) __asm__ ("ld %0,%%fsr" : : "m" (*&cw))
68
#endif
69
 
70
/* Default control word set at startup.  */
71
extern fpu_control_t __fpu_control;
72
 
73
#endif  /* fpu_control.h */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.