]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/mips/mips64/lshift.S
* elf/dl-load.c (_dl_map_object_from_fd): Bail if no PT_LOAD phdrs
[thirdparty/glibc.git] / sysdeps / mips / mips64 / lshift.S
1 /* MIPS3 __mpn_lshift --
2 *
3 * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc.
4 *
5 * This file is part of the GNU MP Library.
6 *
7 * The GNU MP Library is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or (at your
10 * option) any later version.
11 *
12 * The GNU MP Library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with the GNU MP Library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 * MA 02111-1307, USA.
21 */
22
23 #include <sysdep.h>
24 #include <sys/asm.h>
25
26 /* INPUT PARAMETERS
27 * res_ptr $4
28 * src_ptr $5
29 * size $6
30 * cnt $7
31 */
32
33 #ifdef __PIC__
34 .option pic2
35 #endif
36 .text
37 .align 2
38 .globl __mpn_lshift
39 .ent __mpn_lshift
40 __mpn_lshift:
41 #ifdef __PIC__
42 SETUP_GP /* ??? unused */
43 #endif
44 .set noreorder
45 .set nomacro
46
47 dsll $2,$6,3
48 daddu $5,$5,$2 # make r5 point at end of src
49 ld $10,-8($5) # load first limb
50 dsubu $13,$0,$7
51 daddu $4,$4,$2 # make r4 point at end of res
52 daddiu $6,$6,-1
53 and $9,$6,4-1 # number of limbs in first loop
54 beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop
55 dsrl $2,$10,$13 # compute function result
56
57 dsubu $6,$6,$9
58
59 L(Loop0): ld $3,-16($5)
60 daddiu $4,$4,-8
61 daddiu $5,$5,-8
62 daddiu $9,$9,-1
63 dsll $11,$10,$7
64 dsrl $12,$3,$13
65 move $10,$3
66 or $8,$11,$12
67 bne $9,$0,L(Loop0)
68 sd $8,0($4)
69
70 L(L0): beq $6,$0,L(Lend)
71 nop
72
73 L(Loop): ld $3,-16($5)
74 daddiu $4,$4,-32
75 daddiu $6,$6,-4
76 dsll $11,$10,$7
77 dsrl $12,$3,$13
78
79 ld $10,-24($5)
80 dsll $14,$3,$7
81 or $8,$11,$12
82 sd $8,24($4)
83 dsrl $9,$10,$13
84
85 ld $3,-32($5)
86 dsll $11,$10,$7
87 or $8,$14,$9
88 sd $8,16($4)
89 dsrl $12,$3,$13
90
91 ld $10,-40($5)
92 dsll $14,$3,$7
93 or $8,$11,$12
94 sd $8,8($4)
95 dsrl $9,$10,$13
96
97 daddiu $5,$5,-32
98 or $8,$14,$9
99 bgtz $6,L(Loop)
100 sd $8,0($4)
101
102 L(Lend): dsll $8,$10,$7
103 j $31
104 sd $8,-8($4)
105 .end __mpn_lshift