fenv.h revision 0933a70e3aa803a8762855b5b5ad591b03722075
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * innotek Portable Runtime / No-CRT - fenv.h, AMD64.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * Copyright (C) 2006-2007 innotek GmbH
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * available from http://www.virtualbox.org. This file is free software;
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * you can redistribute it and/or modify it under the terms of the GNU
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * General Public License as published by the Free Software Foundation,
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * --------------------------------------------------------------------
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * This code is based on:
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * All rights reserved.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Redistribution and use in source and binary forms, with or without
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * modification, are permitted provided that the following conditions
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * 1. Redistributions of source code must retain the above copyright
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * notice, this list of conditions and the following disclaimer.
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync * 2. Redistributions in binary form must reproduce the above copyright
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * notice, this list of conditions and the following disclaimer in the
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * documentation and/or other materials provided with the distribution.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
7d6e0aa02bf89fa403a13d5eac18a18b5a79893fvboxsync * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
6473a6585394a0255de9936152f2fd35d068b347vboxsync * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync * SUCH DAMAGE.
7995839c0b791ae2334df998d34dbccac12b3b41vboxsynctypedef struct {
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync/* Exception flags */
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_DENORMAL | FE_INEXACT | \
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync/* Rounding modes */
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync * As compared to the x87 control word, the SSE unit's control word
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync * has the rounding control bits offset by 3 and the exception mask
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync * bits offset by 7.
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync/* Default floating-point environment */
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define __fldcw(__cw) __asm __volatile("fldcw %0" : : "m" (__cw))
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define __fldenv(__env) __asm __volatile("fldenv %0" : : "m" (__env))
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define __fnstenv(__env) __asm __volatile("fnstenv %0" : "=m" (*(__env)))
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define __fnstcw(__cw) __asm __volatile("fnstcw %0" : "=m" (*(__cw)))
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define __fnstsw(__sw) __asm __volatile("fnstsw %0" : "=am" (*(__sw)))
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define __ldmxcsr(__csr) __asm __volatile("ldmxcsr %0" : : "m" (__csr))
e1cda3b0b3faa83df2fe0bf69e6938a6e7c4cb20vboxsync#define __stmxcsr(__csr) __asm __volatile("stmxcsr %0" : "=m" (*(__csr)))
7995839c0b791ae2334df998d34dbccac12b3b41vboxsync return (0);
7995839c0b791ae2334df998d34dbccac12b3b41vboxsync return (0);
7995839c0b791ae2334df998d34dbccac12b3b41vboxsyncint RT_NOCRT(fesetexceptflag)(const fexcept_t *__flagp, int __excepts);
7995839c0b791ae2334df998d34dbccac12b3b41vboxsync * We assume that the x87 and the SSE unit agree on the
7995839c0b791ae2334df998d34dbccac12b3b41vboxsync * rounding mode. Reading the control word on the x87 turns
7995839c0b791ae2334df998d34dbccac12b3b41vboxsync * out to be about 5 times faster than reading it on the SSE
7995839c0b791ae2334df998d34dbccac12b3b41vboxsync * unit on an Opteron 244.
DECLINLINE(int)
DECLINLINE(int)
DECLINLINE(int)
fegetexcept(void)
int __control;
#ifndef RT_WITHOUT_NOCRT_WRAPPERS