[BACK]Return to mul_1.asm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / x86 / pentium4 / sse2

Annotation of OpenXM_contrib/gmp/mpn/x86/pentium4/sse2/mul_1.asm, Revision 1.1

1.1     ! ohara       1: dnl  Intel Pentium-4 mpn_mul_1 -- Multiply a limb vector with a limb and store
        !             2: dnl  the result in a second limb vector.
        !             3:
        !             4: dnl  Copyright 2001, 2002 Free Software Foundation, Inc.
        !             5: dnl
        !             6: dnl  This file is part of the GNU MP Library.
        !             7: dnl
        !             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 2.1 of the
        !            11: dnl  License, or (at your option) any later version.
        !            12: dnl
        !            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.
        !            17: dnl
        !            18: dnl  You should have received a copy of the GNU Lesser General Public
        !            19: dnl  License along with the GNU MP Library; see the file COPYING.LIB.  If
        !            20: dnl  not, write to the Free Software Foundation, Inc., 59 Temple Place -
        !            21: dnl  Suite 330, Boston, MA 02111-1307, USA.
        !            22:
        !            23: include(`../config.m4')
        !            24:
        !            25:
        !            26: C P4: 4 cycles/limb
        !            27:
        !            28:
        !            29: C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
        !            30: C                      mp_limb_t multiplier);
        !            31: C mp_limb_t mpn_mul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
        !            32: C                       mp_limb_t multiplier, mp_limb_t carry);
        !            33: C
        !            34: C Only the carry limb propagation is on the dependent chain, hence 4 c/l.
        !            35:
        !            36: defframe(PARAM_CARRY,     20)
        !            37: defframe(PARAM_MULTIPLIER,16)
        !            38: defframe(PARAM_SIZE,      12)
        !            39: defframe(PARAM_SRC,       8)
        !            40: defframe(PARAM_DST,       4)
        !            41:
        !            42:        TEXT
        !            43:        ALIGN(16)
        !            44: PROLOGUE(mpn_mul_1c)
        !            45: deflit(`FRAME',0)
        !            46:        movd    PARAM_CARRY, %mm0
        !            47:        jmp     L(start_1c)
        !            48: EPILOGUE()
        !            49:
        !            50: PROLOGUE(mpn_mul_1)
        !            51: deflit(`FRAME',0)
        !            52:        pxor    %mm0, %mm0
        !            53: L(start_1c):
        !            54:        movl    PARAM_SRC, %eax
        !            55:        movd    PARAM_MULTIPLIER, %mm7
        !            56:        movl    PARAM_DST, %edx
        !            57:        movl    PARAM_SIZE, %ecx
        !            58:
        !            59: L(top):
        !            60:        C eax   src, incrementing
        !            61:        C ebx
        !            62:        C ecx   counter, size iterations
        !            63:        C edx   dst, incrementing
        !            64:        C
        !            65:        C mm0   carry limb
        !            66:        C mm7   multiplier
        !            67:
        !            68:        movd    (%eax), %mm1
        !            69:        addl    $4, %eax
        !            70:        pmuludq %mm7, %mm1
        !            71:
        !            72:        paddq   %mm1, %mm0
        !            73:        movd    %mm0, (%edx)
        !            74:        addl    $4, %edx
        !            75:
        !            76:        psrlq   $32, %mm0
        !            77:
        !            78:        subl    $1, %ecx
        !            79:        jnz     L(top)
        !            80:
        !            81:
        !            82:        movd    %mm0, %eax
        !            83:        emms
        !            84:        ret
        !            85:
        !            86: EPILOGUE()

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