aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-04-24 14:47:19 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-04-24 14:47:19 +0200
commit8dbdc21b25adc3a0ada29b26823fb9b89d603f23 (patch)
tree69f7c7aae8defe502d6f4e1b1ad1213762a562c3 /erts
parentd4497c17d088b716c8bdee5a7bf26b110c78d7c0 (diff)
parentf38aa5a70ff1244e0e3a88c4980b1e87274c0741 (diff)
downloadotp-8dbdc21b25adc3a0ada29b26823fb9b89d603f23.tar.gz
otp-8dbdc21b25adc3a0ada29b26823fb9b89d603f23.tar.bz2
otp-8dbdc21b25adc3a0ada29b26823fb9b89d603f23.zip
Merge branch 'egil/opt-float-cmp'
* egil/opt-float-cmp: erts: Brute force float comparisons as well
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index edefc5170f..8f6335d5dd 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -2938,6 +2938,11 @@ Sint erts_cmp(Eterm a, Eterm b, int exact, int eq_only)
return cmp_atoms(a, b);
} else if (is_both_small(a, b)) {
return (signed_val(a) - signed_val(b));
+ } else if (is_float_rel(a, a_base) && is_float_rel(b, b_base)) {
+ FloatDef af, bf;
+ GET_DOUBLE_REL(a, af, a_base);
+ GET_DOUBLE_REL(b, bf, b_base);
+ return float_comp(af.fd, bf.fd);
}
#if HALFWORD_HEAP
return erts_cmp_compound_rel_opt(a,a_base,b,b_base,exact,eq_only);