about summary refs log tree commit diff
path: root/src/fenv/fesetexceptflag.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-06-12 15:58:15 -0400
committerRich Felker <dalias@aerifal.cx>2011-06-12 15:58:15 -0400
commitb09b78905b09016becda8df81a43e11bebd88208 (patch)
tree1242583c88f60a96f92f321b43d17c4bb358afb5 /src/fenv/fesetexceptflag.c
parent2afebbbcd16e8bfc5e008a40b2faf3bd8cf14e88 (diff)
downloadmusl-b09b78905b09016becda8df81a43e11bebd88208.tar.gz
musl-b09b78905b09016becda8df81a43e11bebd88208.tar.xz
musl-b09b78905b09016becda8df81a43e11bebd88208.zip
floating point environment, untested
at present the i386 code does not support sse floating point, which is
not part of the standard i386 abi. while it may be desirable to
support it later, doing so will reduce performance and require some
tricks to probe if sse support is present.

this first commit is i386-only, but it should be trivial to port the
asm to x86_64.
Diffstat (limited to 'src/fenv/fesetexceptflag.c')
-rw-r--r--src/fenv/fesetexceptflag.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fenv/fesetexceptflag.c b/src/fenv/fesetexceptflag.c
new file mode 100644
index 00000000..af5f102d
--- /dev/null
+++ b/src/fenv/fesetexceptflag.c
@@ -0,0 +1,8 @@
+#include <fenv.h>
+
+int fesetexceptflag(const fexcept_t *fp, int mask)
+{
+	feclearexcept(~*fp & mask);
+	feraiseexcept(*fp & mask);
+	return 0;
+}