Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 527788 | Differences between
and this patch

Collapse All | Expand All

(-)a/jamvm-1.5.4/src/os/linux/i386/init.c (-6 / +6 lines)
Lines 19-36 Link Here
19
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
 */
20
 */
21
21
22
#include <fpu_control.h>
22
#include <fenv.h>
23
23
24
/* Change floating point precision to double (64-bit) from
24
/* Change floating point precision to double (64-bit) from
25
 * the extended (80-bit) Linux default. */
25
 * the extended (80-bit) Linux default. */
26
26
27
void setDoublePrecision() {
27
void setDoublePrecision() {
28
    fpu_control_t cw;
28
    fenv_t fenv;
29
29
30
    _FPU_GETCW(cw);
30
    fegetenv(&fenv);
31
    cw &= ~_FPU_EXTENDED;
31
    fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
32
    cw |= _FPU_DOUBLE;
32
    fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
33
    _FPU_SETCW(cw);
33
    fesetenv(&fenv);
34
}
34
}
35
35
36
void initialisePlatform() {
36
void initialisePlatform() {
(-)a/jamvm-1.5.4/src/os/linux/x86_64/init.c (-10 / +6 lines)
Lines 19-27 Link Here
19
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
 */
20
 */
21
21
22
#ifdef __linux__
22
#include <fenv.h>
23
#include <fpu_control.h>
24
#endif
25
23
26
/* Change the x87 FPU precision to double (64-bit) from the extended
24
/* Change the x87 FPU precision to double (64-bit) from the extended
27
   (80-bit) Linux default.  Note, unlike on i386, my testcases pass
25
   (80-bit) Linux default.  Note, unlike on i386, my testcases pass
Lines 30-43 Link Here
30
*/
28
*/
31
29
32
void setDoublePrecision() {
30
void setDoublePrecision() {
33
#ifdef __linux__
31
    fenv_t fenv;
34
    fpu_control_t cw;
35
32
36
    _FPU_GETCW(cw);
33
    fegetenv(&fenv);
37
    cw &= ~_FPU_EXTENDED;
34
    fenv.__control_word &= ~0x300; /*_FPU_EXTENDED */
38
    cw |= _FPU_DOUBLE;
35
    fenv.__control_word |= 0x200; /*_FPU_DOUBLE */
39
    _FPU_SETCW(cw);
36
    fesetenv(&fenv);
40
#endif
41
}
37
}
42
38
43
void initialisePlatform() {
39
void initialisePlatform() {

Return to bug 527788