1 dnl x86-64 mpn_lshift 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 rsh count in cl
48 shr %cl, %rax C function return value
51 je L(rol) C jump for n = 3, 7, 11, ...
58 movq -16(up,n,8), %mm0
66 je L(1x) C jump for n = 1, 5, 9, 13, ...
67 C n = 2, 6, 10, 16, ...
70 movq -16(up,n,8), %mm0
80 movq -16(up,n,8), %mm3
82 movq -16(up,n,8), %mm0
83 movq -24(up,n,8), %mm1
89 movq %mm3, -16(rp,n,8)
92 L(rol): movq -8(up,n,8), %mm2
94 movq -16(up,n,8), %mm3
101 C finish stuff from lsh block
102 movq 16(up,n,8), %mm0
109 movq -8(up,n,8), %mm1
110 movq %mm2, 24(rp,n,8)
111 movq %mm3, 16(rp,n,8)
116 C finish stuff from rsh block
122 movq -8(up,n,8), %mm2
124 movq -16(up,n,8), %mm3
134 movq 16(up,n,8), %mm0
140 movq %mm2, 24(rp,n,8)
141 movq %mm3, 16(rp,n,8)
143 L(ast): movq (up), %mm2