Upload Tizen:Base source
[external/gmp.git] / mpn / powerpc32 / elf.m4
1 divert(-1)
2 dnl  m4 macros for powerpc32 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         .section        ".text"
31         .align  3
32         .globl  $1
33         .type   $1, @function
34 $1:')
35
36 define(`EPILOGUE_cpu',
37 m4_assert_numargs(1)
38 `       .size   $1, .-$1')
39
40 define(`LEA',
41 m4_assert_numargs(2)
42 `ifdef(`PIC',`
43         mflr    r0
44         bl      _GLOBAL_OFFSET_TABLE_@local-4
45         mflr    $1
46         mtlr    r0
47         lwz     $1, $2@got($1)
48 ',`
49         lis     $1, $2@ha
50         la      $1, $2@l($1)
51 ')')
52
53 define(`LEAL',
54 m4_assert_numargs(2)
55 `LEA($1,$2)')
56
57
58 define(`EXTERN',
59 m4_assert_numargs(1)
60 `dnl')
61
62 define(`DEF_OBJECT',
63 m4_assert_numargs_range(1,2)
64 `
65         .section        .rodata
66         ALIGN(ifelse($#,1,2,$2))
67         .type   $1, @object
68 $1:
69 ')
70
71 define(`END_OBJECT',
72 m4_assert_numargs(1)
73 `       .size   $1, .-$1')
74
75 define(`ASM_END', `dnl')
76
77 ifdef(`PIC',`
78 define(`PIC_SLOW')')
79
80 dnl  64-bit "long long" parameters are put in an even-odd pair, skipping an
81 dnl  even register if that was in turn.  I wish somebody could explain why that
82 dnl  is a good idea.
83 define(`BROKEN_LONGLONG_PARAM')
84
85 divert