summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_bif_guard.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/erl_bif_guard.c')
-rw-r--r--erts/emulator/beam/erl_bif_guard.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bif_guard.c b/erts/emulator/beam/erl_bif_guard.c
index 2242570cad..b4caaf6e38 100644
--- a/erts/emulator/beam/erl_bif_guard.c
+++ b/erts/emulator/beam/erl_bif_guard.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2021. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2023. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -338,6 +338,8 @@ BIF_RETTYPE bit_size_1(BIF_ALIST_1)
Uint low_bits;
Uint bytesize;
Uint high_bits;
+
+ /* NOTE: The JIT has its own implementation of this BIF. */
if (is_binary(BIF_ARG_1)) {
bytesize = binary_size(BIF_ARG_1);
high_bits = bytesize >> ((sizeof(Uint) * 8)-3);
@@ -367,6 +369,7 @@ BIF_RETTYPE bit_size_1(BIF_ALIST_1)
BIF_RETTYPE byte_size_1(BIF_ALIST_1)
{
+ /* NOTE: The JIT has its own implementation of this BIF. */
if (is_binary(BIF_ARG_1)) {
Uint bytesize = binary_size(BIF_ARG_1);
if (binary_bitsize(BIF_ARG_1) > 0) {
@@ -462,3 +465,15 @@ BIF_RETTYPE binary_part_2(BIF_ALIST_2)
badarg:
BIF_ERROR(BIF_P,BADARG);
}
+
+BIF_RETTYPE min_2(BIF_ALIST_2)
+{
+ /* NOTE: The JIT has its own implementation of this BIF. */
+ return CMP_GT(BIF_ARG_1, BIF_ARG_2) ? BIF_ARG_2 : BIF_ARG_1;
+}
+
+BIF_RETTYPE max_2(BIF_ALIST_2)
+{
+ /* NOTE: The JIT has its own implementation of this BIF. */
+ return CMP_LT(BIF_ARG_1, BIF_ARG_2) ? BIF_ARG_2 : BIF_ARG_1;
+}