diff options
author | Geoff Cant <[email protected]> | 2010-01-12 22:25:51 +1300 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-02-06 09:50:36 +0100 |
commit | d17dd27c7d9b98f2cfd243fadd58a477c3edd7f1 (patch) | |
tree | 3d3d85504cdfaf7e0f4450c897b88ae75fefcf0c /erts/emulator/hipe/hipe_amd64_bifs.m4 | |
parent | 022fa2dd03a1e632c401e7c08aab8a184717847b (diff) | |
download | otp-d17dd27c7d9b98f2cfd243fadd58a477c3edd7f1.tar.gz otp-d17dd27c7d9b98f2cfd243fadd58a477c3edd7f1.tar.bz2 otp-d17dd27c7d9b98f2cfd243fadd58a477c3edd7f1.zip |
Porting x86 darwin fixes to amd64 darwin hipe asm/m4 code
Compared to GNU as, Mac OS X's assembler uses different directives for
text and global sections, and omits type and size directives
entirely. We also need to mangle symbol names in order to allow
linking with C object files.
Diffstat (limited to 'erts/emulator/hipe/hipe_amd64_bifs.m4')
-rw-r--r-- | erts/emulator/hipe/hipe_amd64_bifs.m4 | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/erts/emulator/hipe/hipe_amd64_bifs.m4 b/erts/emulator/hipe/hipe_amd64_bifs.m4 index 66fd167f47..32eada24cf 100644 --- a/erts/emulator/hipe/hipe_amd64_bifs.m4 +++ b/erts/emulator/hipe/hipe_amd64_bifs.m4 @@ -46,17 +46,17 @@ define(standard_bif_interface_1, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + 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 - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG @@ -65,18 +65,18 @@ $1: jz nbif_1_simple_exception NBIF_RET(1) HANDLE_GOT_MBUF(1) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(standard_bif_interface_2, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi NBIF_ARG(%rsi,2,0) @@ -84,7 +84,7 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG @@ -93,18 +93,18 @@ $1: jz nbif_2_simple_exception NBIF_RET(2) HANDLE_GOT_MBUF(2) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(standard_bif_interface_3, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi NBIF_ARG(%rsi,3,0) @@ -113,7 +113,7 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG @@ -122,8 +122,8 @@ $1: jz nbif_3_simple_exception NBIF_RET(3) HANDLE_GOT_MBUF(3) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') /* @@ -136,16 +136,16 @@ define(fail_bif_interface_0, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi /* make the call on the C stack */ SWITCH_ERLANG_TO_C - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG @@ -154,8 +154,8 @@ $1: jz nbif_0_simple_exception NBIF_RET(0) HANDLE_GOT_MBUF(0) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') /* @@ -172,59 +172,59 @@ define(nofail_primop_interface_0, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi /* make the call on the C stack */ SWITCH_ERLANG_TO_C - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG /* return */ NBIF_RET(0) HANDLE_GOT_MBUF(0) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(nofail_primop_interface_1, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + 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 - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG /* return */ NBIF_RET(1) HANDLE_GOT_MBUF(1) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(nofail_primop_interface_2, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi NBIF_ARG(%rsi,2,0) @@ -232,25 +232,25 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG /* return */ NBIF_RET(2) HANDLE_GOT_MBUF(2) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(nofail_primop_interface_3, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi NBIF_ARG(%rsi,3,0) @@ -259,15 +259,15 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C - call $2 + call CSYM($2) TEST_GOT_MBUF SWITCH_C_TO_ERLANG /* return */ NBIF_RET(3) HANDLE_GOT_MBUF(3) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') /* @@ -285,55 +285,55 @@ define(nocons_nofail_primop_interface_0, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(0) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(nocons_nofail_primop_interface_1, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + 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_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(1) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(nocons_nofail_primop_interface_2, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi NBIF_ARG(%rsi,2,0) @@ -341,23 +341,23 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(2) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(nocons_nofail_primop_interface_3, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi NBIF_ARG(%rsi,3,0) @@ -366,23 +366,23 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(3) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(nocons_nofail_primop_interface_5, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ movq P, %rdi NBIF_ARG(%rsi,5,0) @@ -393,13 +393,13 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(5) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') /* @@ -417,74 +417,74 @@ define(noproc_primop_interface_0, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(0) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(noproc_primop_interface_1, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ NBIF_ARG(%rdi,1,0) /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(1) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(noproc_primop_interface_2, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ NBIF_ARG(%rdi,2,0) NBIF_ARG(%rsi,2,1) /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(2) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(noproc_primop_interface_3, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ NBIF_ARG(%rdi,3,0) NBIF_ARG(%rsi,3,1) @@ -492,23 +492,23 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(3) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') define(noproc_primop_interface_5, ` #ifndef HAVE_$1 #`define' HAVE_$1 - .section ".text" + TEXT .align 4 - .global $1 -$1: + GLOBAL(ASYM($1)) +ASYM($1): /* set up the parameters */ NBIF_ARG(%rdi,5,0) NBIF_ARG(%rsi,5,1) @@ -518,13 +518,13 @@ $1: /* make the call on the C stack */ SWITCH_ERLANG_TO_C_QUICK - call $2 + call CSYM($2) SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(5) - .size $1,.-$1 - .type $1,@function + SET_SIZE(ASYM($1)) + TYPE_FUNCTION(ASYM($1)) #endif') /* |