Dyn

 view release on metacpan or  search on metacpan

dyncall/portasm/portasm-ppc64.S  view on Meta::CPAN

/*

 Package: dyncall
 Library: portasm
 File: portasm/portasm-ppc64.S
 Description: Portable Assembler Macros for ppc64
 License:

   Copyright (c) 2014-2015 Masanori Mitsugi <mitsugi@linux.vnet.ibm.com>

   Permission to use, copy, modify, and distribute this software for any
   purpose with or without fee is hereby granted, provided that the above
   copyright notice and this permission notice appear in all copies.

   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

*/


#include "../autovar/autovar_OS.h"

#if DC__ABI_PPC64_ELF_V != 2  /* v1 */
#define GLOBAL_C(X) \
.global X; \
.type X, @function; \
.section .opd, "aw"; \
.align 3;
#else                         /* v2 */
#define GLOBAL_C(X) \
.global X; \
.type X, @function;
#endif

#if DC__ABI_PPC64_ELF_V != 2  /* v1 */
#define ENTRY_C(X) \
X: \
.quad .X, .TOC.@tocbase, 0; \
.previous; \
.global .X; \
.X:
#else                         /* v2 */
#define ENTRY_C(X) \
X: \
0: \
addis r2, r12,.TOC.-0b@ha; \
addi  r2, r2,.TOC.-0b@l; \
.localentry X,.-X;
#endif

#define r0 0
#define r1 1
#define r2 2
#define r3 3
#define r4 4
#define r5 5
#define r6 6
#define r7 7
#define r8 8
#define r9 9
#define r10 10



( run in 0.998 second using v1.01-cache-2.11-cpan-140bd7fdf52 )