Home | History | Annotate | Line # | Download | only in powerpc64
      1 divert(-1)
      2 dnl  m4 macros for AIX 64-bit assembly.
      3 
      4 dnl  Copyright 2000-2002, 2005, 2006, 2010, 2012 Free Software Foundation, Inc.
      5 
      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 modify
      9 dnl  it under the terms of either:
     10 dnl
     11 dnl    * the GNU Lesser General Public License as published by the Free
     12 dnl      Software Foundation; either version 3 of the License, or (at your
     13 dnl      option) any later version.
     14 dnl
     15 dnl  or
     16 dnl
     17 dnl    * the GNU General Public License as published by the Free Software
     18 dnl      Foundation; either version 2 of the License, or (at your option) any
     19 dnl      later version.
     20 dnl
     21 dnl  or both in parallel, as here.
     22 dnl
     23 dnl  The GNU MP Library is distributed in the hope that it will be useful, but
     24 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     25 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     26 dnl  for more details.
     27 dnl
     28 dnl  You should have received copies of the GNU General Public License and the
     29 dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
     30 dnl  see https://www.gnu.org/licenses/.
     31 
     32 define(`AIX')
     33 
     34 define(`ASM_START',
     35 	`.machine	"any"
     36 	.toc')
     37 
     38 dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
     39 dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
     40 dnl
     41 dnl  Don't want ELF style .size in the epilogue.
     42 
     43 define(`PROLOGUE_cpu',
     44 m4_assert_numargs_range(1,2)
     45 `ifelse(`$2',toc,,
     46 `ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl
     47 	.globl	$1
     48 	.globl	.$1
     49 	.csect	[DS], 3
     50 $1:
     51 	.llong	.$1, TOC[tc0], 0
     52 	.csect	.$1[PR], 6
     53 .$1:')
     54 
     55 define(`EPILOGUE_cpu',
     56 m4_assert_numargs(1)
     57 `')
     58 
     59 define(`TOC_ENTRY', `')
     60 
     61 define(`LEA',
     62 m4_assert_numargs(2)
     63 `define(`TOC_ENTRY',
     64 `	.toc
     65 ..$2:	.tc	$2[TC], $2')'
     66 	`ld	$1, ..$2(2)')
     67 
     68 define(`LEAL',
     69 m4_assert_numargs(2)
     70 `LEA($1,$2)')
     71 
     72 
     73 define(`EXTERN',
     74 m4_assert_numargs(1)
     75 `	.globl	$1')
     76 
     77 define(`EXTERN_FUNC',
     78 m4_assert_numargs(1)
     79 `	.globl	.$1')
     80 
     81 define(`DEF_OBJECT',
     82 m4_assert_numargs_range(1,2)
     83 `	.csect	[RO], 3
     84 	ALIGN(ifelse($#,1,2,$2))
     85 $1:
     86 ')
     87 
     88 define(`END_OBJECT',
     89 m4_assert_numargs(1))
     90 
     91 define(`CALL',
     92 	`bl	.$1
     93 	nop')
     94 
     95 define(`ASM_END', `TOC_ENTRY')
     96 
     97 undefine(`EXTRA_REGISTER')
     98 
     99 divert
    100