4 dnl Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
6 dnl This file is part of the GNU MP Library.
8 dnl The GNU MP Library is free software; you can redistribute it and/or modify
9 dnl it under the terms of either:
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.
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
21 dnl or both in parallel, as here.
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
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/.
33 dnl ia64 assembler comments are C++ style "//" to the end of line. gas
34 dnl also accepts "#" as a comment, if it's the first non-blank on a line.
36 dnl BSD m4 can't handle a multi-character comment like "//" (see notes in
37 dnl mpn/asm-defs.m4). For now the default "#" is left, but with care taken
38 dnl not to put any macros after "foo#" (since of course they won't expand).
46 dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
47 dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
49 dnl 32-byte alignment is used for the benefit of itanium-2, where the code
50 dnl fetcher will only take 2 bundles from a 32-byte aligned target. At
51 dnl 16mod32 it only reads 1 in the first cycle. This might not make any
52 dnl difference if the rotate buffers are full or there's other work holding
53 dnl up execution, but we use 32-bytes to give the best chance of peak
56 dnl We can use .align here despite the gas bug noted in mpn/ia64/README,
57 dnl since we're not expecting to execute across a PROLOGUE(), at least not
60 define(`PROLOGUE_cpu',
69 define(`EPILOGUE_cpu',
79 define(`DATAEND',`dnl')
81 define(`ASM_END',`dnl')
84 dnl Usage: ALIGN(bytes)
86 dnl Emit a ".align" directive. "bytes" is eval()ed, so can be an
89 dnl This version overrides the definition in mpn/asm-defs.m4. We suppress
90 dnl any .align if the gas byte-swapped-nops bug was detected by configure
91 dnl GMP_ASM_IA64_ALIGN_OK.
95 m4_assert_defined(`IA64_ALIGN_OK')
96 `ifelse(IA64_ALIGN_OK,no,,
100 dnl Usage: ASSERT([pr] [,code])
102 dnl Require that the given predicate register is true after executing the
103 dnl test code. For example,
106 dnl ` cmp.eq p6,p0 = r3, r4')
108 dnl If the predicate register argument is empty then nothing is tested, the
109 dnl code is just executed. This can be used for setups required by later
110 dnl ASSERTs. The code argument can be omitted to just test a predicate
111 dnl with no special setup code.
113 dnl For convenience, stops are inserted before and after the code emitted.
116 m4_assert_numargs_range(1,2)
117 m4_assert_defined(`WANT_ASSERT')
118 `ifelse(WANT_ASSERT,1,
125 `($1) br .LASSERTok`'ASSERT_label_counter ;;
126 cmp.ne p6,p6 = r0, r0 C illegal instruction
128 .LASSERTok`'ASSERT_label_counter:
129 define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
132 define(`ASSERT_label_counter',1)
134 define(`getfsig', `getf.sig')
135 define(`setfsig', `setf.sig')
136 define(`cmpeq', `cmp.eq')
137 define(`cmpne', `cmp.ne')
138 define(`cmpltu', `cmp.ltu')
139 define(`cmpleu', `cmp.leu')
140 define(`cmpgtu', `cmp.gtu')
141 define(`cmpgeu', `cmp.geu')
142 define(`cmple', `cmp.le')
143 define(`cmpgt', `cmp.gt')
144 define(`cmpeqor', `cmp.eq.or')
145 define(`cmpequc', `cmp.eq.unc')