Define bit_SSE2 and index_SSE2.
[glibc.git] / sysdeps / x86_64 / lshift.S
blob5ac66f0a365fdbf86f359fdedb13eb0917a03be7
1 /* AMD64 __mpn_lshift --
2    Copyright 2004, 2006 Free Software Foundation, Inc.
3    This file is part of the GNU MP Library.
5    The GNU MP Library is free software; you can redistribute it and/or modify
6    it under the terms of the GNU Lesser General Public License as published by
7    the Free Software Foundation; either version 2.1 of the License, or (at your
8    option) any later version.
10    The GNU MP Library is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
13    License for more details.
15    You should have received a copy of the GNU Lesser General Public License
16    along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
17    the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18    MA 02111-1307, USA. */
20 #include "sysdep.h"
21 #include "asm-syntax.h"
24         .text
25 ENTRY (__mpn_lshift)
26         movq    -8(%rsi,%rdx,8), %mm7
27         movd    %ecx, %mm1
28         movl    $64, %eax
29         subl    %ecx, %eax
30         movd    %eax, %mm0
31         movq    %mm7, %mm3
32         psrlq   %mm0, %mm7
33         movd    %mm7, %rax
34         subq    $2, %rdx
35         jl      L(endo)
36         .p2align 2
37 L(loop):
38         movq    (%rsi,%rdx,8), %mm6
39         movq    %mm6, %mm2
40         psrlq   %mm0, %mm6
41         psllq   %mm1, %mm3
42         por     %mm6, %mm3
43         movq    %mm3, 8(%rdi,%rdx,8)
44         je      L(ende)
45         movq    -8(%rsi,%rdx,8), %mm7
46         movq    %mm7, %mm3
47         psrlq   %mm0, %mm7
48         psllq   %mm1, %mm2
49         por     %mm7, %mm2
50         movq    %mm2, (%rdi,%rdx,8)
51         subq    $2, %rdx
52         jge     L(loop)
53 L(endo):
54         movq    %mm3, %mm2
55 L(ende):
56         psllq   %mm1, %mm2
57         movq    %mm2, (%rdi)
58         emms
59         ret
60 END (__mpn_lshift)