~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gmp/mpn/x86_64/mul_1.asm

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2007-04-09 11:51:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070409115151-ql8cr0kalzx1jmla
Tags: 0.9i-20070324-2
Upload to unstable. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl  AMD64 mpn_mul_1 -- Multiply a limb vector with a limb and store the result
 
2
dnl  in a second limb vector.
 
3
 
 
4
dnl  Copyright 2004 Free Software Foundation, Inc.
 
5
 
 
6
dnl  This file is part of the GNU MP Library.
 
7
 
 
8
dnl  The GNU MP Library is free software; you can redistribute it and/or modify
 
9
dnl  it under the terms of the GNU Lesser General Public License as published
 
10
dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
 
11
dnl  your option) any later version.
 
12
 
 
13
dnl  The GNU MP Library is distributed in the hope that it will be useful, but
 
14
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
15
dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 
16
dnl  License for more details.
 
17
 
 
18
dnl  You should have received a copy of the GNU Lesser General Public License
 
19
dnl  along with the GNU MP Library; see the file COPYING.LIB.  If not, write
 
20
dnl  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
21
dnl  Boston, MA 02110-1301, USA.
 
22
 
 
23
include(`../config.m4')
 
24
 
 
25
 
 
26
C         cycles/limb
 
27
C Hammer:     3.0
 
28
 
 
29
 
 
30
C INPUT PARAMETERS
 
31
C rp    rdi
 
32
C up    rsi
 
33
C n     rdx
 
34
C vl    rcx
 
35
 
 
36
        TEXT
 
37
        ALIGN(16)
 
38
        .byte   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 
39
ASM_START()
 
40
PROLOGUE(mpn_mul_1)
 
41
        movq    %rdx, %r11
 
42
        leaq    (%rsi,%rdx,8), %rsi
 
43
        leaq    (%rdi,%rdx,8), %rdi
 
44
        negq    %r11
 
45
        xorl    %r8d, %r8d
 
46
 
 
47
.Loop:  movq    (%rsi,%r11,8), %rax
 
48
        mulq    %rcx
 
49
        addq    %r8, %rax
 
50
        movl    $0, %r8d
 
51
        adcq    %rdx, %r8
 
52
        movq    %rax, (%rdi,%r11,8)
 
53
        incq    %r11
 
54
        jne     .Loop
 
55
 
 
56
        movq    %r8, %rax
 
57
        ret
 
58
EPILOGUE()