From 20f40851457d5440e0c784cf65aefa54aa1421ce Mon Sep 17 00:00:00 2001 From: bellard Date: Wed, 24 Jul 2002 22:13:23 +0000 Subject: [PATCH] added FPU control word --- libtcc1.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libtcc1.c b/libtcc1.c index 00c71929..412629e2 100644 --- a/libtcc1.c +++ b/libtcc1.c @@ -436,6 +436,13 @@ long long __shldi3(long long a, int b) return a << b; } +#if defined(__i386__) +/* FPU control word for rounding to nearest mode */ +unsigned short __tcc_fpu_control = 0x137f; +/* FPU control word for round to zero mode for int convertion */ +unsigned short __tcc_int_fpu_control = 0x137f | 0x0c00; +#endif + /* XXX: suppress that and patch tcc to do it */ float __ulltof(unsigned long long a) {