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

     1  dnl  S/390-32 mpn_lshift.
     2  
     3  dnl  Copyright 2011 Free Software Foundation, Inc.
     4  
     5  dnl  This file is part of the GNU MP Library.
     6  dnl
     7  dnl  The GNU MP Library is free software; you can redistribute it and/or modify
     8  dnl  it under the terms of either:
     9  dnl
    10  dnl    * the GNU Lesser General Public License as published by the Free
    11  dnl      Software Foundation; either version 3 of the License, or (at your
    12  dnl      option) any later version.
    13  dnl
    14  dnl  or
    15  dnl
    16  dnl    * the GNU General Public License as published by the Free Software
    17  dnl      Foundation; either version 2 of the License, or (at your option) any
    18  dnl      later version.
    19  dnl
    20  dnl  or both in parallel, as here.
    21  dnl
    22  dnl  The GNU MP Library is distributed in the hope that it will be useful, but
    23  dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    24  dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    25  dnl  for more details.
    26  dnl
    27  dnl  You should have received copies of the GNU General Public License and the
    28  dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
    29  dnl  see https://www.gnu.org/licenses/.
    30  
    31  include(`../config.m4')
    32  
    33  C            cycles/limb
    34  C z900		 6
    35  C z990	         3
    36  C z9		 ?
    37  C z10		 ?
    38  C z196		 ?
    39  
    40  C TODO
    41  C  *
    42  
    43  C INPUT PARAMETERS
    44  define(`rp',	`%r2')
    45  define(`up',	`%r3')
    46  define(`n',	`%r4')
    47  define(`cnt',	`%r5')
    48  
    49  ASM_START()
    50  PROLOGUE(mpn_lshift)
    51  	lr	%r1, n
    52  	sll	%r1, 2
    53  	stm	%r6, %r12, 24(%r15)
    54  	la	up, 0(%r1,up)		C put up near end of U
    55  	la	rp, 0(%r1,rp)		C put rp near end of R
    56  	ahi	up, -20
    57  	ahi	rp, -16
    58  	lhi	%r8, 32
    59  	sr	%r8, cnt
    60  	l	%r12, 16(up)
    61  	srl	%r12, 0(%r8)		C return value
    62  	lhi	%r7, 3
    63  	nr	%r7, n
    64  	srl	n, 2
    65  	je	L(b0)
    66  	chi	%r7, 2
    67  	jl	L(b1)
    68  	je	L(b2)
    69  
    70  L(b3):	l	%r10, 16(up)
    71  	l	%r11, 12(up)
    72  	l	%r9,   8(up)
    73  	ahi	up, -8
    74  	lr	%r8, %r11
    75  	sldl	%r10, 0(cnt)
    76  	sldl	%r8,  0(cnt)
    77  	st	%r10, 12(rp)
    78  	st	%r8,   8(rp)
    79  	ahi	rp, -8
    80  	ltr	n, n
    81  	je	L(end)
    82  	j	L(top)
    83  
    84  L(b2):	l	%r10, 16(up)
    85  	l	%r11, 12(up)
    86  	ahi	up, -4
    87  	sldl	%r10, 0(cnt)
    88  	st	%r10, 12(rp)
    89  	ahi	rp, -4
    90  	ltr	n, n
    91  	je	L(end)
    92  	j	L(top)
    93  
    94  L(b1):	ltr	n, n
    95  	je	L(end)
    96  	j	L(top)
    97  
    98  L(b0):	l	%r10,16(up)
    99  	l	%r8, 12(up)
   100  	l	%r6,  8(up)
   101  	l	%r0,  4(up)
   102  	ahi	up, -12
   103  	lr	%r11, %r8
   104  	lr	%r9,  %r6
   105  	lr	%r7,  %r0
   106  	sldl	%r10,0(cnt)
   107  	sldl	%r8, 0(cnt)
   108  	sldl	%r6, 0(cnt)
   109  	st	%r10, 12(rp)
   110  	st	%r8,   8(rp)
   111  	st	%r6,   4(rp)
   112  	ahi	rp, -12
   113  	ahi	n, -1
   114  	je	L(end)
   115  
   116  	ALIGN(8)
   117  L(top):	l	%r10, 16(up)
   118  	l	%r8,  12(up)
   119  	l	%r6,   8(up)
   120  	l	%r0,   4(up)
   121  	l	%r1,   0(up)
   122  	lr	%r11, %r8
   123  	lr	%r9,  %r6
   124  	lr	%r7,  %r0
   125  	ahi	up, -16
   126  	sldl	%r10, 0(cnt)
   127  	sldl	%r8,  0(cnt)
   128  	sldl	%r6,  0(cnt)
   129  	sldl	%r0,  0(cnt)
   130  	st	%r10, 12(rp)
   131  	st	%r8,   8(rp)
   132  	st	%r6,   4(rp)
   133  	st	%r0,   0(rp)
   134  	ahi	rp, -16
   135  	brct	n, L(top)
   136  
   137  L(end):	l	%r10, 16(up)
   138  	sll	%r10, 0(cnt)
   139  	st	%r10, 12(rp)
   140  
   141  	lr	%r2, %r12
   142  	lm	%r6, %r12, 24(%r15)
   143  	br	%r14
   144  EPILOGUE()