1 dnl x86-64 mpn_rshift optimized for Pentium 4.
3 dnl Copyright 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
7 dnl The GNU MP Library is free software; you can redistribute it and/or
8 dnl modify it under the terms of the GNU Lesser General Public License as
9 dnl published by the Free Software Foundation; either version 3 of the
10 dnl License, or (at your option) any later version.
12 dnl The GNU MP Library is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 dnl Lesser General Public License for more details.
17 dnl You should have received a copy of the GNU Lesser General Public License
18 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
20 include(`../config.m4')
27 C P6-15 (Core2): 2.1 (fluctuates, presumably cache related)
42 neg %ecx C put lsh count in cl
51 shl %cl, %rax C function return value
54 je L(rol) C jump for n = 3, 7, 11, ...
69 je L(1x) C jump for n = 1, 5, 9, 13, ...
70 C n = 2, 6, 10, 16, ...
95 L(rol): movq 8(up,n,8), %mm2
104 C finish stuff from lsh block
105 movq -16(up,n,8), %mm0
106 movq -8(up,n,8), %mm1
113 movq %mm2, -24(rp,n,8)
114 movq %mm3, -16(rp,n,8)
119 C finish stuff from rsh block
120 movq -8(up,n,8), %mm2
127 movq 16(up,n,8), %mm3
128 movq %mm0, -8(rp,n,8)
137 movq -16(up,n,8), %mm0
140 movq -8(up,n,8), %mm1
143 movq %mm2, -24(rp,n,8)
144 movq %mm3, -16(rp,n,8)
146 L(ast): movq (up), %mm2