Upload Tizen:Base source
[external/gmp.git] / mpn / powerpc64 / elf.m4
1 divert(-1)
2 dnl  m4 macros for powerpc64 GNU/Linux assembly.
3
4 dnl  Copyright 2003, 2005, 2006 Free Software Foundation, Inc.
5 dnl
6 dnl  This file is part of the GNU MP Library.
7 dnl
8 dnl  The GNU MP Library is free software; you can redistribute it and/or
9 dnl  modify it under the terms of the GNU Lesser General Public License as
10 dnl  published by the Free Software Foundation; either version 3 of the
11 dnl  License, or (at your option) any later version.
12 dnl
13 dnl  The GNU MP Library is distributed in the hope that it will be useful,
14 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 dnl  Lesser General Public License for more details.
17 dnl
18 dnl  You should have received a copy of the GNU Lesser General Public License
19 dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
20
21 define(`ASM_START',`')
22
23 dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
24 dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
25 dnl
26
27 define(`PROLOGUE_cpu',
28 m4_assert_numargs(1)
29         `
30         .globl  $1
31         .globl  .$1
32         .section        ".opd","aw"
33         .align  3
34 $1:
35         .llong  .$1, .TOC.@tocbase, 0
36         .size   $1, 24
37         .type   .$1, @function
38         .section        ".text"
39         .align  4
40 .$1:')
41
42 define(`EPILOGUE_cpu',
43 m4_assert_numargs(1)
44 `       .size   .$1, .-.$1')
45
46 define(`TOC_ENTRY', `')
47
48 define(`LEA',
49 m4_assert_numargs(2)
50 `define(`TOC_ENTRY',
51 `       .section        ".toc", "aw"
52 ..$2:   .tc     $2[TC], $2')'
53         `ld     $1, ..$2@toc(2)')
54
55 define(`LEAL',
56 m4_assert_numargs(2)
57 `LEA($1,$2)')
58
59
60 define(`EXTERN',
61 m4_assert_numargs(1)
62 `dnl')
63
64 define(`EXTERN_FUNC',
65 m4_assert_numargs(1)
66 `dnl')
67
68 define(`DEF_OBJECT',
69 m4_assert_numargs_range(1,2)
70 `
71         .section        .rodata
72         ALIGN(ifelse($#,1,2,$2))
73         .type   $1, @object
74 $1:
75 ')
76
77 define(`END_OBJECT',
78 m4_assert_numargs(1)
79 `       .size   $1, .-$1')
80
81 define(`CALL',
82         `bl     GSYM_PREFIX`'$1
83         nop')
84
85 define(`ASM_END', `TOC_ENTRY')
86
87 divert