1 dnl mc68020 mpn_add_n, mpn_sub_n -- add or subtract limb vectors
3 dnl Copyright 1992, 1994, 1996, 1999, 2000, 2001, 2002, 2003, 2005 Free
4 dnl 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
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.
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.
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/.
21 include(`../config.m4')
26 ifdef(`OPERATION_add_n',`
27 define(M4_inst, addxl)
28 define(M4_function_n, mpn_add_n)
29 ',`ifdef(`OPERATION_sub_n',`
30 define(M4_inst, subxl)
31 define(M4_function_n, mpn_sub_n)
33 `m4_error(`Need OPERATION_add_n or OPERATION_sub_n
36 MULFUNC_PROLOGUE(mpn_add_n mpn_sub_n)
46 PROLOGUE(M4_function_n)
48 C Save used registers on the stack.
52 C Copy the arguments to registers. Better use movem?
61 subql #1, d2 C clears cy as side effect
68 L(L1): movel M(a0,+), d0
73 dbf d2, L(Loop) C loop until 16 lsb of %4 == -1
74 subxl d0, d0 C d0 <= -cy; save cy as 0 or -1 in d0
77 addl d0, d0 C restore cy
83 C Restore used registers from stack frame.
89 EPILOGUE(M4_function_n)