github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpn/vax/mul_1.asm (about)

     1  dnl  VAX 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 1992, 1994, 1996, 2000, 2012 Free Software Foundation, Inc.
     5  
     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 modify
     9  dnl  it under the terms of either:
    10  dnl
    11  dnl    * the GNU Lesser General Public License as published by the Free
    12  dnl      Software Foundation; either version 3 of the License, or (at your
    13  dnl      option) any later version.
    14  dnl
    15  dnl  or
    16  dnl
    17  dnl    * the GNU General Public License as published by the Free Software
    18  dnl      Foundation; either version 2 of the License, or (at your option) any
    19  dnl      later version.
    20  dnl
    21  dnl  or both in parallel, as here.
    22  dnl
    23  dnl  The GNU MP Library is distributed in the hope that it will be useful, but
    24  dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    25  dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    26  dnl  for more details.
    27  dnl
    28  dnl  You should have received copies of the GNU General Public License and the
    29  dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
    30  dnl  see https://www.gnu.org/licenses/.
    31  
    32  include(`../config.m4')
    33  
    34  ASM_START()
    35  PROLOGUE(mpn_mul_1)
    36  	.word	0xfc0
    37  	movl	12(ap), r4
    38  	movl	8(ap), r8
    39  	movl	4(ap), r9
    40  	clrl	r3
    41  	incl	r4
    42  	ashl	$-1, r4, r7
    43  	clrl	r11
    44  	movl	16(ap), r6
    45  	jlss	L(v0_big)
    46  	jlbc	r4, L(1)
    47  
    48  C Loop for v0 < 0x80000000
    49  L(tp1):	movl	(r8)+, r1
    50  	jlss	L(1n0)
    51  	emul	r1, r6, $0, r2
    52  	addl2	r11, r2
    53  	adwc	$0, r3
    54  	movl	r2, (r9)+
    55  L(1):	movl	(r8)+, r1
    56  	jlss	L(1n1)
    57  L(1p1):	emul	r1, r6, $0, r10
    58  	addl2	r3, r10
    59  	adwc	$0, r11
    60  	movl	r10, (r9)+
    61  
    62  	sobgtr	r7, L(tp1)
    63  	movl	r11, r0
    64  	ret
    65  
    66  L(1n0):	emul	r1, r6, $0, r2
    67  	addl2	r11, r2
    68  	adwc	r6, r3
    69  	movl	r2, (r9)+
    70  	movl	(r8)+, r1
    71  	jgeq	L(1p1)
    72  L(1n1):	emul	r1, r6, $0, r10
    73  	addl2	r3, r10
    74  	adwc	r6, r11
    75  	movl	r10, (r9)+
    76  
    77  	sobgtr	r7, L(tp1)
    78  	movl	r11, r0
    79  	ret
    80  
    81  L(v0_big):
    82  	jlbc	r4, L(2)
    83  
    84  C Loop for v0 >= 0x80000000
    85  L(tp2):	movl	(r8)+, r1
    86  	jlss	L(2n0)
    87  	emul	r1, r6, $0, r2
    88  	addl2	r11, r2
    89  	adwc	r1, r3
    90  	movl	r2, (r9)+
    91  L(2):	movl	(r8)+, r1
    92  	jlss	L(2n1)
    93  L(2p1):	emul	r1, r6, $0, r10
    94  	addl2	r3, r10
    95  	adwc	r1, r11
    96  	movl	r10, (r9)+
    97  
    98  	sobgtr	r7, L(tp2)
    99  	movl	r11, r0
   100  	ret
   101  
   102  L(2n0):	emul	r1, r6, $0, r2
   103  	addl2	r1, r3
   104  	addl2	r11, r2
   105  	adwc	r6, r3
   106  	movl	r2, (r9)+
   107  	movl	(r8)+, r1
   108  	jgeq	L(2p1)
   109  L(2n1):	emul	r1, r6, $0, r10
   110  	addl2	r1, r11
   111  	addl2	r3, r10
   112  	adwc	r6, r11
   113  	movl	r10, (r9)+
   114  
   115  	sobgtr	r7, L(tp2)
   116  	movl	r11, r0
   117  	ret
   118  EPILOGUE()