aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_utils.h
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-01-29 11:15:46 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-01-29 11:15:46 +0100
commitcb50354a9d3463cf07b830ecf28260adc5b361c0 (patch)
tree4794bac549046c2b1039ec0ac559b955ad3b31fc /erts/emulator/beam/erl_utils.h
parentd960d54f75c51b81a99a1c5cf40c19f2e9d55068 (diff)
parentcf5bc2e917dbcb2c2841bf07b995efe105bea4be (diff)
downloadotp-cb50354a9d3463cf07b830ecf28260adc5b361c0.tar.gz
otp-cb50354a9d3463cf07b830ecf28260adc5b361c0.tar.bz2
otp-cb50354a9d3463cf07b830ecf28260adc5b361c0.zip
Merge branch 'egil/maps/OTP-11616'
* egil/maps/OTP-11616: (112 commits) compiler: Add core compile test for maps compiler: Fix core parse for Maps compiler: Fixup #map_pair{} spec erts: Strengthen map_SUITE tests erts: Update maps_fold test to respect maps:fold/3 stdlib: Make maps:fold/3 order-independent erts: Fixup enif_make_map_put on windows erts: Update preloaded erts_internal.beam hipe: Fixup update cerl pretty printer erts: Add map construction to driver API dialyzer: Add maps tests dialyzer: Remove dead code dialyzer: Reflect map_pair core changes in dialyzer hipe: Update cerl pretty printer compiler: Update inliner tests compiler: Squash #c_map_pair_*{} to #c_map_pair{} compiler: Squash #k_map_pair_*{} to #k_map_pair{} preloaded: Fixup export cmp_term in erts_internal erts: Change 'size' argument of enif_get_map_size from int* to size_t* erts: Fix compile error for halfword emulator ...
Diffstat (limited to 'erts/emulator/beam/erl_utils.h')
-rw-r--r--erts/emulator/beam/erl_utils.h48
1 files changed, 31 insertions, 17 deletions
diff --git a/erts/emulator/beam/erl_utils.h b/erts/emulator/beam/erl_utils.h
index 292d135946..5b81d814c6 100644
--- a/erts/emulator/beam/erl_utils.h
+++ b/erts/emulator/beam/erl_utils.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2014. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -202,23 +202,37 @@ int eq(Eterm, Eterm);
#define EQ(x,y) (((x) == (y)) || (is_not_both_immed((x),(y)) && eq((x),(y))))
#if HALFWORD_HEAP
-Sint cmp_rel(Eterm, Eterm*, Eterm, Eterm*);
-#define CMP(A,B) cmp_rel(A,NULL,B,NULL)
+Sint cmp_rel_opt(Eterm, Eterm*, Eterm, Eterm*, int);
+#define cmp_rel(A,A_BASE,B,B_BASE) cmp_rel_opt(A,A_BASE,B,B_BASE,0)
+#define cmp_rel_term(A,A_BASE,B,B_BASE) cmp_rel_opt(A,A_BASE,B,B_BASE,1)
+#define CMP(A,B) cmp_rel_opt(A,NULL,B,NULL,0)
+#define CMP_TERM(A,B) cmp_rel_opt(A,NULL,B,NULL,1)
#else
-Sint cmp(Eterm, Eterm);
-#define cmp_rel(A,A_BASE,B,B_BASE) cmp(A,B)
-#define CMP(A,B) cmp(A,B)
+Sint cmp(Eterm, Eterm, int);
+#define cmp_rel(A,A_BASE,B,B_BASE) cmp(A,B,0)
+#define cmp_rel_term(A,A_BASE,B,B_BASE) cmp(A,B,1)
+#define CMP(A,B) cmp(A,B,0)
+#define CMP_TERM(A,B) cmp(A,B,1)
#endif
-#define cmp_lt(a,b) (CMP((a),(b)) < 0)
-#define cmp_le(a,b) (CMP((a),(b)) <= 0)
-#define cmp_eq(a,b) (CMP((a),(b)) == 0)
-#define cmp_ne(a,b) (CMP((a),(b)) != 0)
-#define cmp_ge(a,b) (CMP((a),(b)) >= 0)
-#define cmp_gt(a,b) (CMP((a),(b)) > 0)
-
-#define CMP_LT(a,b) ((a) != (b) && cmp_lt((a),(b)))
-#define CMP_GE(a,b) ((a) == (b) || cmp_ge((a),(b)))
-#define CMP_EQ(a,b) ((a) == (b) || cmp_eq((a),(b)))
-#define CMP_NE(a,b) ((a) != (b) && cmp_ne((a),(b)))
+
+#define cmp_lt(a,b) (CMP((a),(b)) < 0)
+#define cmp_le(a,b) (CMP((a),(b)) <= 0)
+#define cmp_eq(a,b) (CMP((a),(b)) == 0)
+#define cmp_ne(a,b) (CMP((a),(b)) != 0)
+#define cmp_ge(a,b) (CMP((a),(b)) >= 0)
+#define cmp_gt(a,b) (CMP((a),(b)) > 0)
+
+#define cmp_lt_term(a,b) (CMP_TERM((a),(b)) < 0)
+#define cmp_le_term(a,b) (CMP_TERM((a),(b)) <= 0)
+#define cmp_ge_term(a,b) (CMP_TERM((a),(b)) >= 0)
+#define cmp_gt_term(a,b) (CMP_TERM((a),(b)) > 0)
+
+#define CMP_LT(a,b) ((a) != (b) && cmp_lt((a),(b)))
+#define CMP_GE(a,b) ((a) == (b) || cmp_ge((a),(b)))
+#define CMP_EQ(a,b) ((a) == (b) || cmp_eq((a),(b)))
+#define CMP_NE(a,b) ((a) != (b) && cmp_ne((a),(b)))
+
+#define CMP_LT_TERM(a,b) ((a) != (b) && cmp_lt_term((a),(b)))
+#define CMP_GE_TERM(a,b) ((a) == (b) || cmp_ge_term((a),(b)))
#endif