|
Packit |
5c3484 |
dnl S/390-64 mpn_copyi
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 2011 Free Software Foundation, Inc.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl This file is part of the GNU MP Library.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit |
5c3484 |
dnl it under the terms of either:
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU Lesser General Public License as published by the Free
|
|
Packit |
5c3484 |
dnl Software Foundation; either version 3 of the License, or (at your
|
|
Packit |
5c3484 |
dnl option) any later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU General Public License as published by the Free Software
|
|
Packit |
5c3484 |
dnl Foundation; either version 2 of the License, or (at your option) any
|
|
Packit |
5c3484 |
dnl later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or both in parallel, as here.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit |
5c3484 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit |
5c3484 |
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
Packit |
5c3484 |
dnl for more details.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl You should have received copies of the GNU General Public License and the
|
|
Packit |
5c3484 |
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
|
|
Packit |
5c3484 |
dnl see https://www.gnu.org/licenses/.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
include(`../config.m4')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C cycles/limb
|
|
Packit |
5c3484 |
C z900 1.25
|
|
Packit |
5c3484 |
C z990 0.75
|
|
Packit |
5c3484 |
C z9 ?
|
|
Packit |
5c3484 |
C z10 1
|
|
Packit |
5c3484 |
C z196 ?
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C NOTE
|
|
Packit |
5c3484 |
C * This is based on GNU libc memcpy which was written by Martin Schwidefsky.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C INPUT PARAMETERS
|
|
Packit |
5c3484 |
define(`rp', `%r2')
|
|
Packit |
5c3484 |
define(`up', `%r3')
|
|
Packit |
5c3484 |
define(`n', `%r4')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ASM_START()
|
|
Packit |
5c3484 |
PROLOGUE(mpn_copyi)
|
|
Packit |
5c3484 |
ltgr %r4, %r4
|
|
Packit |
5c3484 |
sllg %r4, %r4, 3
|
|
Packit |
5c3484 |
je L(rtn)
|
|
Packit |
5c3484 |
aghi %r4, -1
|
|
Packit |
5c3484 |
srlg %r5, %r4, 8
|
|
Packit |
5c3484 |
ltgr %r5, %r5 C < 256 bytes to copy?
|
|
Packit |
5c3484 |
je L(1)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
L(top): mvc 0(256, rp), 0(up)
|
|
Packit |
5c3484 |
la rp, 256(rp)
|
|
Packit |
5c3484 |
la up, 256(up)
|
|
Packit |
5c3484 |
brctg %r5, L(top)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
L(1): bras %r5, L(2) C make r5 point to mvc insn
|
|
Packit |
5c3484 |
mvc 0(1, rp), 0(up)
|
|
Packit |
5c3484 |
L(2): ex %r4, 0(%r5) C execute mvc with length ((n-1) mod 256)+1
|
|
Packit |
5c3484 |
L(rtn): br %r14
|
|
Packit |
5c3484 |
EPILOGUE()
|