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) ({ __label__ L1, L2; L1: (void)&&L1; \
38 asm volatile ("mffs %0" : "=f" (x)); \
39 L2: (void)&&L2; })
40
41#define FESETENVD(x) ({ __label__ L1, L2; L1: (void)&&L1; \
42 asm volatile("mtfsf 255,%0" : : "f" (x)); \
43 L2: (void)&&L2; })
44
45/* Macros to get or set environment flags doubleword in their own dispatch group */
46#define FEGETENVD_GRP(x) ({ __label__ L1, L2; L1: (void)&&L1; \
47 asm volatile ("mffs %0" : "=f" (x)); \
48 L2: (void)&&L2; __NOOP; __NOOP; __NOOP; })
49
50#define FESETENVD_GRP(x) ({ __label__ L1, L2; __NOOP; __NOOP; __NOOP; L1: (void)&&L1; \
51 asm volatile ("mtfsf 255,%0" : : "f" (x)); \
52 L2: (void)&&L2;})
53
54/* exception flags */
55#define FE_SET_FX 0x80000000 /* floating-point exception summary (FX) bit */
56#define FE_CLR_FX 0x7fffffff
57#define SET_INVALID 0x01000000
58
59/* the bitwise negation (one's complement) of FE_ALL_EXCEPT */
60#define FE_NO_EXCEPT 0xc1ffffff
61
62/* the bitwise OR of all of the separate exception bits in the FPSCR */
63#define FE_ALL_FLAGS 0xfff80300
64
65/* the bitwise negation (one's complement) of the previous macro */
66#define FE_NO_FLAGS 0x0007fcff
67
68/* the bitwise OR of all of the separate invalid stickies in the FPSCR */
69#define FE_ALL_INVALID 0x01f80300
70
71/* the bitwise negation (one's complement) of the previous macro */
72#define FE_NO_INVALID 0xfe07fcff
73
74/* an AND mask to disable all floating-point exception enables in the FPSCR */
75#define FE_NO_ENABLES 0xffffff07
76
77/* rounding direction mode bits */
78#define FE_ALL_RND 0x00000003
79#define FE_NO_RND 0xfffffffc
80
81#define EXCEPT_MASK 0x1ff80000
82
83#endif /* __FENV_PRIVATE__ */