aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_x86_bifs.m4
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-03-16 13:18:37 +0100
committerZandra Hird <[email protected]>2015-03-16 13:18:59 +0100
commitda0cfbabbae668bcacbf3e5fff1ebdc173e6f1e1 (patch)
treed970a02c19f9e5c31d600ea5b26ece53142f20e1 /erts/emulator/hipe/hipe_x86_bifs.m4
parent3e2070b328b7c2c5f641f3b73a52d6cb7e3b5a44 (diff)
parent0e464f7be1ae9b54d0fba748ab2dc7bd435ac118 (diff)
downloadotp-da0cfbabbae668bcacbf3e5fff1ebdc173e6f1e1.tar.gz
otp-da0cfbabbae668bcacbf3e5fff1ebdc173e6f1e1.tar.bz2
otp-da0cfbabbae668bcacbf3e5fff1ebdc173e6f1e1.zip
Merge branch 'nox/ets-update_counter-4'
* nox/ets-update_counter-4: Create new BIF ets:update_counter/4 Allow 4-ary BIFs OTP-12563
Diffstat (limited to 'erts/emulator/hipe/hipe_x86_bifs.m4')
-rw-r--r--erts/emulator/hipe/hipe_x86_bifs.m438
1 files changed, 38 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_x86_bifs.m4 b/erts/emulator/hipe/hipe_x86_bifs.m4
index a0f16efa33..b0064ee628 100644
--- a/erts/emulator/hipe/hipe_x86_bifs.m4
+++ b/erts/emulator/hipe/hipe_x86_bifs.m4
@@ -48,6 +48,7 @@ define(HANDLE_GOT_MBUF,`
* standard_bif_interface_1(nbif_name, cbif_name)
* standard_bif_interface_2(nbif_name, cbif_name)
* standard_bif_interface_3(nbif_name, cbif_name)
+ * standard_bif_interface_4(nbif_name, cbif_name)
* standard_bif_interface_0(nbif_name, cbif_name)
*
* Generate native interface for a BIF with 0-3 parameters and
@@ -158,6 +159,43 @@ ASYM($1):
TYPE_FUNCTION(ASYM($1))
#endif')
+define(standard_bif_interface_4,
+`
+#ifndef HAVE_$1
+#`define' HAVE_$1
+ TEXT
+ .align 4
+ GLOBAL(ASYM($1))
+ASYM($1):
+ /* copy native stack pointer */
+ NBIF_COPY_NSP(4)
+
+ /* switch to C stack */
+ SWITCH_ERLANG_TO_C
+
+ /* make the call on the C stack */
+ NBIF_ARG_REG(0,P)
+ NBIF_ARG(2,4,0)
+ NBIF_ARG(3,4,1)
+ NBIF_ARG(4,4,2)
+ NBIF_ARG(5,4,3)
+ lea 8(%esp), %eax
+ NBIF_ARG_REG(1,%eax) /* BIF__ARGS */
+ CALL_BIF($2)
+ TEST_GOT_MBUF
+
+ /* switch to native stack */
+ SWITCH_C_TO_ERLANG
+
+ /* throw exception if failure, otherwise return */
+ TEST_GOT_EXN
+ jz nbif_4_simple_exception
+ NBIF_RET(4)
+ HANDLE_GOT_MBUF(4)
+ SET_SIZE(ASYM($1))
+ TYPE_FUNCTION(ASYM($1))
+#endif')
+
define(standard_bif_interface_0,
`
#ifndef HAVE_$1