this repo has no description
1/*
2 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*******************************************************************************
23* *
24* File: fenv_private.h *
25* *
26* Contains: Defines for manipulating environmental settings directly. *
27* *
28*******************************************************************************/
29
30#ifndef __FENV_PRIVATE__
31#define __FENV_PRIVATE__
32
33/* Pick up the publicly visible enums formerly sited here */
34#include <fenv.h>
35
36/* Macros to get or set environment flags doubleword */
37#define FEGETENVD(x) asm volatile ("mffs %0" : "=f" (x));
38#define FESETENVD(x) asm volatile ("mtfsf 255,%0" : : "f" (x));
39
40/* exception flags */
41#define FE_SET_FX 0x80000000 /* floating-point exception summary (FX) bit */
42#define FE_CLR_FX 0x7fffffff
43#define SET_INVALID 0x01000000
44
45/* the bitwise negation (one's complement) of FE_ALL_EXCEPT */
46#define FE_NO_EXCEPT 0xc1ffffff
47
48/* the bitwise OR of all of the separate exception bits in the FPSCR */
49#define FE_ALL_FLAGS 0xfff80300
50
51/* the bitwise negation (one's complement) of the previous macro */
52#define FE_NO_FLAGS 0x0007fcff
53
54/* the bitwise OR of all of the separate invalid stickies in the FPSCR */
55#define FE_ALL_INVALID 0x01f80300
56
57/* the bitwise negation (one's complement) of the previous macro */
58#define FE_NO_INVALID 0xfe07fcff
59
60/* an AND mask to disable all floating-point exception enables in the FPSCR */
61#define FE_NO_ENABLES 0xffffff07
62
63/* rounding direction mode bits */
64#define FE_ALL_RND 0x00000003
65#define FE_NO_RND 0xfffffffc
66
67#define EXCEPT_MASK 0x1ff80000
68
69#endif /* __FENV_PRIVATE__ */