Home | History | Annotate | Line # | Download | only in s390_32
      1 dnl  S/390-32 mpn_lshiftc.
      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		 7
     35 C z990	         3.375
     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_lshiftc)
     51 	lr	%r1, n
     52 	sll	%r1, 2
     53 	stm	%r6, %r13, 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	%r13, -1
     63 	lhi	%r7, 3
     64 	nr	%r7, n
     65 	srl	n, 2
     66 	je	L(b0)
     67 	chi	%r7, 2
     68 	jl	L(b1)
     69 	je	L(b2)
     70 
     71 L(b3):	l	%r10, 16(up)
     72 	l	%r11, 12(up)
     73 	l	%r9,   8(up)
     74 	ahi	up, -8
     75 	lr	%r8, %r11
     76 	sldl	%r10, 0(cnt)
     77 	sldl	%r8,  0(cnt)
     78 	xr	%r10, %r13
     79 	xr	%r8, %r13
     80 	st	%r10, 12(rp)
     81 	st	%r8,   8(rp)
     82 	ahi	rp, -8
     83 	ltr	n, n
     84 	je	L(end)
     85 	j	L(top)
     86 
     87 L(b2):	l	%r10, 16(up)
     88 	l	%r11, 12(up)
     89 	ahi	up, -4
     90 	sldl	%r10, 0(cnt)
     91 	xr	%r10, %r13
     92 	st	%r10, 12(rp)
     93 	ahi	rp, -4
     94 	ltr	n, n
     95 	je	L(end)
     96 	j	L(top)
     97 
     98 L(b1):	ltr	n, n
     99 	je	L(end)
    100 	j	L(top)
    101 
    102 L(b0):	l	%r10,16(up)
    103 	l	%r8, 12(up)
    104 	l	%r6,  8(up)
    105 	l	%r0,  4(up)
    106 	ahi	up, -12
    107 	lr	%r11, %r8
    108 	lr	%r9,  %r6
    109 	lr	%r7,  %r0
    110 	sldl	%r10,0(cnt)
    111 	sldl	%r8, 0(cnt)
    112 	sldl	%r6, 0(cnt)
    113 	xr	%r10, %r13
    114 	xr	%r8, %r13
    115 	xr	%r6, %r13
    116 	st	%r10, 12(rp)
    117 	st	%r8,   8(rp)
    118 	st	%r6,   4(rp)
    119 	ahi	rp, -12
    120 	ahi	n, -1
    121 	je	L(end)
    122 
    123 	ALIGN(8)
    124 L(top):	l	%r10, 16(up)
    125 	l	%r8,  12(up)
    126 	l	%r6,   8(up)
    127 	l	%r0,   4(up)
    128 	l	%r1,   0(up)
    129 	lr	%r11, %r8
    130 	lr	%r9,  %r6
    131 	lr	%r7,  %r0
    132 	ahi	up, -16
    133 	sldl	%r10, 0(cnt)
    134 	sldl	%r8,  0(cnt)
    135 	sldl	%r6,  0(cnt)
    136 	sldl	%r0,  0(cnt)
    137 	xr	%r10, %r13
    138 	xr	%r8, %r13
    139 	xr	%r6, %r13
    140 	xr	%r0, %r13
    141 	st	%r10, 12(rp)
    142 	st	%r8,   8(rp)
    143 	st	%r6,   4(rp)
    144 	st	%r0,   0(rp)
    145 	ahi	rp, -16
    146 	brct	n, L(top)
    147 
    148 L(end):	l	%r10, 16(up)
    149 	sll	%r10, 0(cnt)
    150 	xr	%r10, %r13
    151 	st	%r10, 12(rp)
    152 
    153 	lr	%r2, %r12
    154 	lm	%r6, %r13, 24(%r15)
    155 	br	%r14
    156 EPILOGUE()
    157