1 1.1 mrg divert(-1) 2 1.1 mrg dnl m4 macros for powerpc32 GNU/Linux assembly. 3 1.1 mrg 4 1.1 mrg dnl Copyright 2003, 2005, 2006 Free Software Foundation, Inc. 5 1.4 mrg 6 1.4 mrg dnl This file is part of the GNU MP Library. 7 1.4 mrg dnl 8 1.4 mrg dnl The GNU MP Library is free software; you can redistribute it and/or modify 9 1.4 mrg dnl it under the terms of either: 10 1.4 mrg dnl 11 1.4 mrg dnl * the GNU Lesser General Public License as published by the Free 12 1.4 mrg dnl Software Foundation; either version 3 of the License, or (at your 13 1.4 mrg dnl option) any later version. 14 1.4 mrg dnl 15 1.4 mrg dnl or 16 1.1 mrg dnl 17 1.4 mrg dnl * the GNU General Public License as published by the Free Software 18 1.4 mrg dnl Foundation; either version 2 of the License, or (at your option) any 19 1.4 mrg dnl later version. 20 1.4 mrg dnl 21 1.4 mrg dnl or both in parallel, as here. 22 1.1 mrg dnl 23 1.4 mrg dnl The GNU MP Library is distributed in the hope that it will be useful, but 24 1.4 mrg dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 25 1.4 mrg dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 26 1.4 mrg dnl for more details. 27 1.1 mrg dnl 28 1.4 mrg dnl You should have received copies of the GNU General Public License and the 29 1.4 mrg dnl GNU Lesser General Public License along with the GNU MP Library. If not, 30 1.4 mrg dnl see https://www.gnu.org/licenses/. 31 1.1 mrg 32 1.1 mrg define(`ASM_START',`') 33 1.1 mrg 34 1.4 mrg dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc]) 35 1.1 mrg dnl EPILOGUE_cpu(GSYM_PREFIX`'foo) 36 1.1 mrg dnl 37 1.1 mrg 38 1.1 mrg define(`PROLOGUE_cpu', 39 1.4 mrg m4_assert_numargs_range(1,2) 40 1.4 mrg `ifelse(`$2',toc,, 41 1.4 mrg `ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl 42 1.1 mrg .section ".text" 43 1.1 mrg .align 3 44 1.1 mrg .globl $1 45 1.1 mrg .type $1, @function 46 1.1 mrg $1:') 47 1.1 mrg 48 1.1 mrg define(`EPILOGUE_cpu', 49 1.1 mrg m4_assert_numargs(1) 50 1.1 mrg ` .size $1, .-$1') 51 1.1 mrg 52 1.1 mrg define(`LEA', 53 1.1 mrg m4_assert_numargs(2) 54 1.1 mrg `ifdef(`PIC',` 55 1.1 mrg mflr r0 56 1.4 mrg bcl 20, 31, 1f 57 1.2 matt 1: mflr $1 58 1.4 mrg addis $1, $1, (_GLOBAL_OFFSET_TABLE_-1b)@ha 59 1.4 mrg addi $1, $1, (_GLOBAL_OFFSET_TABLE_-1b)@l 60 1.1 mrg mtlr r0 61 1.1 mrg lwz $1, $2@got($1) 62 1.1 mrg ',` 63 1.1 mrg lis $1, $2@ha 64 1.1 mrg la $1, $2@l($1) 65 1.1 mrg ')') 66 1.1 mrg 67 1.4 mrg 68 1.1 mrg define(`LEAL', 69 1.1 mrg m4_assert_numargs(2) 70 1.1 mrg `LEA($1,$2)') 71 1.1 mrg 72 1.1 mrg 73 1.1 mrg define(`EXTERN', 74 1.1 mrg m4_assert_numargs(1) 75 1.1 mrg `dnl') 76 1.1 mrg 77 1.1 mrg define(`DEF_OBJECT', 78 1.1 mrg m4_assert_numargs_range(1,2) 79 1.1 mrg ` 80 1.1 mrg .section .rodata 81 1.1 mrg ALIGN(ifelse($#,1,2,$2)) 82 1.1 mrg .type $1, @object 83 1.1 mrg $1: 84 1.1 mrg ') 85 1.1 mrg 86 1.1 mrg define(`END_OBJECT', 87 1.1 mrg m4_assert_numargs(1) 88 1.1 mrg ` .size $1, .-$1') 89 1.1 mrg 90 1.1 mrg define(`ASM_END', `dnl') 91 1.1 mrg 92 1.1 mrg ifdef(`PIC',` 93 1.1 mrg define(`PIC_SLOW')') 94 1.1 mrg 95 1.1 mrg dnl 64-bit "long long" parameters are put in an even-odd pair, skipping an 96 1.1 mrg dnl even register if that was in turn. I wish somebody could explain why that 97 1.1 mrg dnl is a good idea. 98 1.1 mrg define(`BROKEN_LONGLONG_PARAM') 99 1.1 mrg 100 1.1 mrg divert 101