1 /* mc68020 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
2 the result to a second limb vector.
4 Copyright (C) 1992, 1994 Free Software Foundation, Inc.
6 This file is part of the GNU MP Library.
8 The GNU MP Library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Library General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or (at your
11 option) any later version.
13 The GNU MP Library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
16 License for more details.
18 You should have received a copy of the GNU Library General Public License
19 along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
30 #include "asm-syntax.h"
43 /* Save used registers on the stack. */
44 INSN2(movem,l ,MEM_PREDEC(sp),d2-d5)
46 /* Copy the arguments to registers. Better use movem? */
47 INSN2(move,l ,res_ptr,MEM_DISP(sp,20))
48 INSN2(move,l ,s1_ptr,MEM_DISP(sp,24))
49 INSN2(move,l ,size,MEM_DISP(sp,28))
50 INSN2(move,l ,s2_limb,MEM_DISP(sp,32))
57 INSN2(subq,l ,size,#1)
58 INSN2(sub,l ,d0,d0) /* (d0,cy) <= (0,0) */
61 INSN2(move,l ,d3,MEM_POSTINC(s1_ptr))
62 INSN2(mulu,l ,d1:d3,s2_limb)
65 INSN2(add,l ,MEM_POSTINC(res_ptr),d3)
66 LAB(L1) INSN2(move,l ,d3,MEM_POSTINC(s1_ptr))
67 INSN2(mulu,l ,d0:d3,s2_limb)
70 INSN2(add,l ,MEM_POSTINC(res_ptr),d3)
74 INSN2(sub,l ,size,#0x10000)
77 /* Restore used registers from stack frame. */
78 INSN2(movem,l ,d2-d5,MEM_POSTINC(sp))