[BACK]Return to mul_1.asm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / m68k / mc68020

Annotation of OpenXM_contrib/gmp/mpn/m68k/mc68020/mul_1.asm, Revision 1.1.1.1

1.1       ohara       1: dnl  mc68020 mpn_mul_1 -- mpn by limb multiply
                      2: dnl
                      3: dnl        cycles/limb
                      4: dnl  68040:   19.5
                      5:
                      6: dnl  Copyright 1992, 1994, 1996, 1999, 2000, 2001 Free Software Foundation,
                      7: dnl  Inc.
                      8: dnl
                      9: dnl  This file is part of the GNU MP Library.
                     10: dnl
                     11: dnl  The GNU MP Library is free software; you can redistribute it and/or
                     12: dnl  modify it under the terms of the GNU Lesser General Public License as
                     13: dnl  published by the Free Software Foundation; either version 2.1 of the
                     14: dnl  License, or (at your option) any later version.
                     15: dnl
                     16: dnl  The GNU MP Library is distributed in the hope that it will be useful,
                     17: dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
                     18: dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                     19: dnl  Lesser General Public License for more details.
                     20: dnl
                     21: dnl  You should have received a copy of the GNU Lesser General Public
                     22: dnl  License along with the GNU MP Library; see the file COPYING.LIB.  If
                     23: dnl  not, write to the Free Software Foundation, Inc., 59 Temple Place -
                     24: dnl  Suite 330, Boston, MA 02111-1307, USA.
                     25:
                     26: include(`../config.m4')
                     27:
                     28:
                     29: C INPUT PARAMETERS
                     30: C res_ptr      (sp + 4)
                     31: C s1_ptr       (sp + 8)
                     32: C s1_size      (sp + 12)
                     33: C s2_limb      (sp + 16)
                     34:
                     35:
                     36: define(res_ptr, `a0')
                     37: define(s1_ptr,  `a1')
                     38: define(s1_size, `d2')
                     39: define(s2_limb, `d4')
                     40:
                     41:
                     42: PROLOGUE(mpn_mul_1)
                     43:
                     44: C Save used registers on the stack.
                     45:        moveml  d2-d4, M(-,sp)
                     46:
                     47: C      movel   d2, M(-,sp)
                     48: C      movel   d3, M(-,sp)
                     49: C      movel   d4, M(-,sp)
                     50:
                     51: C Copy the arguments to registers.  Better use movem?
                     52:        movel   M(sp,16), res_ptr
                     53:        movel   M(sp,20), s1_ptr
                     54:        movel   M(sp,24), s1_size
                     55:        movel   M(sp,28), s2_limb
                     56:
                     57:        eorw    #1, s1_size
                     58:        clrl    d1
                     59:        lsrl    #1, s1_size
                     60:        bcc     L(L1)
                     61:        subql   #1, s1_size
                     62:        subl    d0, d0          C (d0,cy) <= (0,0)
                     63:
                     64: L(Loop):
                     65:        movel   M(s1_ptr,+), d3
                     66:        mulul   s2_limb, d1:d3
                     67:        addxl   d0, d3
                     68:        movel   d3, M(res_ptr,+)
                     69: L(L1): movel   M(s1_ptr,+), d3
                     70:        mulul   s2_limb, d0:d3
                     71:        addxl   d1, d3
                     72:        movel   d3, M(res_ptr,+)
                     73:
                     74:        dbf     s1_size, L(Loop)
                     75:        clrl    d3
                     76:        addxl   d3, d0
                     77:        subl    #0x10000, s1_size
                     78:        bcc     L(Loop)
                     79:
                     80: C Restore used registers from stack frame.
                     81:        moveml  M(sp,+), d2-d4
                     82:
                     83: C      movel   M(sp,+),d4
                     84: C      movel   M(sp,+),d3
                     85: C      movel   M(sp,+),d2
                     86:
                     87:        rts
                     88:
                     89: EPILOGUE(mpn_mul_1)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>