about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-04-17 10:50:33 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-04-17 10:50:33 +0200
commit248cd2e749dcc5931113a405e232e9a90c130089 (patch)
tree6eddccb3f60c2969ae2a839280866f91a4a6fb0a /src/emu
parent3b550eeed3ecd47546ad0c0664a458af463c57af (diff)
downloadbox64-248cd2e749dcc5931113a405e232e9a90c130089.tar.gz
box64-248cd2e749dcc5931113a405e232e9a90c130089.zip
Fixed nexttoward(f) wrapped functions, and improved long double handling
Diffstat (limited to 'src/emu')
-rwxr-xr-xsrc/emu/x87emu_private.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/emu/x87emu_private.c b/src/emu/x87emu_private.c
index 5f638bfb..cd35c116 100755
--- a/src/emu/x87emu_private.c
+++ b/src/emu/x87emu_private.c
@@ -196,6 +196,21 @@ double FromLD(void* ld)
     return ret;
 }
 
+#ifndef HAVE_LD80BITS
+long double LD2localLD(void* ld)
+{
+    // local implementation may not be try Quad precision, but double-double precision, so simple way to keep the 80bits precision in the conversion
+    double ret;
+    LD2D(ld, &ret);
+    return ret;
+}
+#else
+long double LD2localLD(void* ld)
+{
+    return *(long double*)ld;
+}
+#endif
+
 void fpu_loadenv(x64emu_t* emu, char* p, int b16)
 {
     emu->cw = *(uint16_t*)p;