aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2012-08-24 12:02:58 +0200
committerLukas Larsson <[email protected]>2012-08-24 12:02:58 +0200
commit0342137176c653c51cc3a78781888cfca8568650 (patch)
treeb3f2b462589a7d574a80e4557a8a05a222184a3e /erts/emulator/beam
parentdd12380a68f4692c1aba2e972b84de89f3df46df (diff)
parent85283dc19ceea2905ff39aa0615d1a99d7aea16c (diff)
downloadotp-0342137176c653c51cc3a78781888cfca8568650.tar.gz
otp-0342137176c653c51cc3a78781888cfca8568650.tar.bz2
otp-0342137176c653c51cc3a78781888cfca8568650.zip
Merge branch 'msp/double_middle_endian/OTP-10209' into maint
* msp/double_middle_endian/OTP-10209: Configure now assumed normal doubles Revise the autoconf tests for double middle endianness. Add test for floating-point output to float_SUITE. Unbreak floating point on middle-endian machines.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_bits.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c
index 6f7309f493..b7c82935ff 100644
--- a/erts/emulator/beam/erl_bits.c
+++ b/erts/emulator/beam/erl_bits.c
@@ -1005,8 +1005,13 @@ erts_new_bs_put_float(Process *c_p, Eterm arg, Uint num_bits, int flags)
if (is_float(arg)) {
FloatDef *fdp = (FloatDef*)(float_val(arg) + 1);
+#ifdef DOUBLE_MIDDLE_ENDIAN
+ a = fdp->fw[1];
+ b = fdp->fw[0];
+#else
a = fdp->fw[0];
b = fdp->fw[1];
+#endif
} else if (is_small(arg)) {
u.f64 = (double) signed_val(arg);
a = u.i32[0];
@@ -1015,8 +1020,13 @@ erts_new_bs_put_float(Process *c_p, Eterm arg, Uint num_bits, int flags)
if (big_to_double(arg, &u.f64) < 0) {
return 0;
}
+#ifdef DOUBLE_MIDDLE_ENDIAN
+ a = u.i32[1];
+ b = u.i32[0];
+#else
a = u.i32[0];
b = u.i32[1];
+#endif
} else {
return 0;
}