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

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

1.1       maekawa     1: /* mc68020 __mpn_mul_1 -- Multiply a limb vector with a limb and store
                      2:    the result in a second limb vector.
                      3:
                      4: Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
                      5:
                      6: This file is part of the GNU MP Library.
                      7:
                      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.
                     12:
                     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.
                     17:
                     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., 59 Temple Place - Suite 330, Boston,
                     21: MA 02111-1307, USA. */
                     22:
                     23: /*
                     24:   INPUT PARAMETERS
                     25:   res_ptr      (sp + 4)
                     26:   s1_ptr       (sp + 8)
                     27:   s1_size      (sp + 12)
                     28:   s2_limb      (sp + 16)
                     29: */
                     30:
                     31: #include "sysdep.h"
                     32: #include "asm-syntax.h"
                     33:
                     34:        TEXT
                     35:        ALIGN
                     36:        GLOBL   C_SYMBOL_NAME(__mpn_mul_1)
                     37:
                     38: C_SYMBOL_NAME(__mpn_mul_1:)
                     39: PROLOG(__mpn_mul_1)
                     40:
                     41: #define res_ptr a0
                     42: #define s1_ptr a1
                     43: #define s1_size d2
                     44: #define s2_limb d4
                     45:
                     46: /* Save used registers on the stack.  */
                     47:        moveml  R(d2)-R(d4),MEM_PREDEC(sp)
                     48: #if 0
                     49:        movel   R(d2),MEM_PREDEC(sp)
                     50:        movel   R(d3),MEM_PREDEC(sp)
                     51:        movel   R(d4),MEM_PREDEC(sp)
                     52: #endif
                     53:
                     54: /* Copy the arguments to registers.  Better use movem?  */
                     55:        movel   MEM_DISP(sp,16),R(res_ptr)
                     56:        movel   MEM_DISP(sp,20),R(s1_ptr)
                     57:        movel   MEM_DISP(sp,24),R(s1_size)
                     58:        movel   MEM_DISP(sp,28),R(s2_limb)
                     59:
                     60:        eorw    #1,R(s1_size)
                     61:        clrl    R(d1)
                     62:        lsrl    #1,R(s1_size)
                     63:        bcc     L(L1)
                     64:        subql   #1,R(s1_size)
                     65:        subl    R(d0),R(d0)     /* (d0,cy) <= (0,0) */
                     66:
                     67: L(Loop:)
                     68:        movel   MEM_POSTINC(s1_ptr),R(d3)
                     69:        mulul   R(s2_limb),R(d1):R(d3)
                     70:        addxl   R(d0),R(d3)
                     71:        movel   R(d3),MEM_POSTINC(res_ptr)
                     72: L(L1:) movel   MEM_POSTINC(s1_ptr),R(d3)
                     73:        mulul   R(s2_limb),R(d0):R(d3)
                     74:        addxl   R(d1),R(d3)
                     75:        movel   R(d3),MEM_POSTINC(res_ptr)
                     76:
                     77:        dbf     R(s1_size),L(Loop)
                     78:        clrl    R(d3)
                     79:        addxl   R(d3),R(d0)
                     80:        subl    #0x10000,R(s1_size)
                     81:        bcc     L(Loop)
                     82:
                     83: /* Restore used registers from stack frame.  */
                     84:        moveml  MEM_POSTINC(sp),R(d2)-R(d4)
                     85: #if 0
                     86:        movel   MEM_POSTINC(sp),R(d4)
                     87:        movel   MEM_POSTINC(sp),R(d3)
                     88:        movel   MEM_POSTINC(sp),R(d2)
                     89: #endif
                     90:        rts
                     91: EPILOG(__mpn_mul_1)

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