aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_amd64_bifs.m4
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-11-03 16:21:51 +0100
committerSverker Eriksson <[email protected]>2017-11-03 16:21:51 +0100
commit7cd0a910a3d171840991092e335e9a5b2aeee74e (patch)
tree69da7e61c36055e7c00e4f26a8679ada72ed6f83 /erts/emulator/hipe/hipe_amd64_bifs.m4
parent21b920e38078412f3d47442b27b40b3601a1c7d7 (diff)
parenta8264b52677abba29505a8bb597e2aaf6d3258d9 (diff)
downloadotp-7cd0a910a3d171840991092e335e9a5b2aeee74e.tar.gz
otp-7cd0a910a3d171840991092e335e9a5b2aeee74e.tar.bz2
otp-7cd0a910a3d171840991092e335e9a5b2aeee74e.zip
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/hipe/hipe_amd64_bifs.m4')
-rw-r--r--erts/emulator/hipe/hipe_amd64_bifs.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_amd64_bifs.m4 b/erts/emulator/hipe/hipe_amd64_bifs.m4
index b3c9a460bb..6d998c4b55 100644
--- a/erts/emulator/hipe/hipe_amd64_bifs.m4
+++ b/erts/emulator/hipe/hipe_amd64_bifs.m4
@@ -463,6 +463,43 @@ ASYM($1):
#endif')
/*
+ * nogc_bif_interface_1(nbif_name, cbif_name)
+ *
+ * Generate native interface for a bif with implicit P
+ * The bif can fail but cannot do GC.
+ */
+
+define(nogc_bif_interface_1,
+`
+#ifndef HAVE_$1
+#`define' HAVE_$1
+ TEXT
+ .align 4
+ GLOBAL(ASYM($1))
+ASYM($1):
+ /* set up the parameters */
+ movq P, %rdi
+ NBIF_ARG(%rsi,1,0)
+
+ /* make the call on the C stack */
+ SWITCH_ERLANG_TO_C
+ pushq %rsi
+ movq %rsp, %rsi /* Eterm* BIF__ARGS */
+ sub $(8), %rsp /* stack frame 16-byte alignment */
+ CALL_BIF($2)
+ add $(1*8 + 8), %rsp
+ SWITCH_C_TO_ERLANG
+
+ /* throw exception if failure, otherwise return */
+ TEST_GOT_EXN
+ jz nbif_1_simple_exception
+ NBIF_RET(1)
+ SET_SIZE(ASYM($1))
+ TYPE_FUNCTION(ASYM($1))
+#endif')
+
+
+/*
* noproc_primop_interface_0(nbif_name, cbif_name)
* noproc_primop_interface_1(nbif_name, cbif_name)
* noproc_primop_interface_2(nbif_name, cbif_name)