aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_ppc_asm.m4
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2011-04-05 16:27:36 +0200
committerHenrik Nord <[email protected]>2011-04-05 16:28:18 +0200
commit79698f6f214283e34f8e0893c90716f503a723f2 (patch)
tree495077fa13b9445e590ff1042cac53414f6d92c6 /erts/emulator/hipe/hipe_ppc_asm.m4
parent645d19ca2e96ec53b4b4834b312cfa869084d107 (diff)
parent577a6282d6b090c0727038df0bc163b3baa02534 (diff)
downloadotp-79698f6f214283e34f8e0893c90716f503a723f2.tar.gz
otp-79698f6f214283e34f8e0893c90716f503a723f2.tar.bz2
otp-79698f6f214283e34f8e0893c90716f503a723f2.zip
Merge branch 'ks/hipe-ppc64' into dev
* ks/hipe-ppc64: Enable HiPE by default when compiling for PPC64 Translate RTL to PPC code on PPC64 too Changes in ppc files for PPC64 Additions for the PPC64 backend Changes for the PPC64 backend Added loader for ppc64 New files for the 64-bit backends Cleanup tags OTP-9198
Diffstat (limited to 'erts/emulator/hipe/hipe_ppc_asm.m4')
-rw-r--r--erts/emulator/hipe/hipe_ppc_asm.m431
1 files changed, 23 insertions, 8 deletions
diff --git a/erts/emulator/hipe/hipe_ppc_asm.m4 b/erts/emulator/hipe/hipe_ppc_asm.m4
index a0f8b78679..0eb5c441e6 100644
--- a/erts/emulator/hipe/hipe_ppc_asm.m4
+++ b/erts/emulator/hipe/hipe_ppc_asm.m4
@@ -1,25 +1,24 @@
changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
- *
+ *
+ * Copyright Ericsson AB 2004-2011. 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
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
-/*
- * $Id$
- */
+
+
`#ifndef HIPE_PPC_ASM_H
#define HIPE_PPC_ASM_H'
@@ -63,15 +62,31 @@ ifelse(OPSYS,darwin,``
#define SEMI @
#define SET_SIZE(NAME) /*empty*/
#define TYPE_FUNCTION(NAME) /*empty*/
+#define OPD(NAME) /*empty*/
'',``
/* Not Darwin */''
`ifelse(ARCH,ppc64,``
/* 64-bit */
+/*
+ * The 64-bit PowerPC ABI requires us to setup Official Procedure Descriptors
+ * for functions called from C. These are exported as "func", while the entry
+ * point should is exported as ".func". A function pointer in C points to the
+ * function descriptor in the opd rather than to the function entry point.
+ */
#define JOIN(X,Y) X##Y
#define CSYM(NAME) JOIN(.,NAME)
+#define OPD(NAME) \
+ .pushsection .opd, "aw"; \
+ .align 3; \
+ .global NAME; \
+NAME: \
+ .quad CSYM(NAME), .TOC.@tocbase, 0; \
+ .type NAME, @function; \
+ .popsection
'',``
/* 32-bit */
#define CSYM(NAME) NAME
+#define OPD(NAME) /*empty*/
'')'
``#define ASYM(NAME) NAME
#define GLOBAL(NAME) .global NAME