Merge branch 'vendor/GCC50' - gcc 5.0 snapshot 1 FEB 2015
[dragonfly.git] / contrib / gcc-5.0 / libgcc / config / arc / ieee-754 / floatunsidf.S
1 /* Copyright (C) 2008-2015 Free Software Foundation, Inc.
2    Contributor: Joern Rennecke <joern.rennecke@embecosm.com>
3                 on behalf of Synopsys Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
20
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24 <http://www.gnu.org/licenses/>.  */
25
26 #include "arc-ieee-754.h"
27
28 #if 0 /* DEBUG */
29         .global __floatunsidf
30         .balign 4
31         FUNC(__floatunsidf)
32 __floatunsidf:
33         push_s blink
34         bl.d __floatunsidf_c
35         push_s r0
36         ld_s r2,[sp]
37         st_s r1,[sp]
38         push_s r0
39         bl.d __floatunsidf_asm
40         mov_s r0,r2
41         pop_s r2
42         pop_s r3
43         pop_s blink
44         cmp r0,r2
45         cmp.eq r1,r3
46         jeq_s [blink]
47         bl abort
48         ENDFUNC(__floatunsidf)
49 #define __floatunsidf __floatunsidf_asm
50 #endif /* DEBUG */
51
52         .global __floatunsidf
53         .balign 4
54         FUNC(__floatunsidf)
55 __floatunsidf:
56         lsr_s r1,r0
57         breq_s r0,0,.Lret0
58         norm r2,r1
59         mov r12,-0x41d ; -(0x3ff+31-1)
60         rsub.f r3,r2,11
61         add_s r12,r2,r12
62         add_s r2,r2,21
63 #ifdef __LITTLE_ENDIAN__
64         lsr DBL0H,r0,r3
65         asl_s DBL0L,r0,r2
66 #else
67         asl DBL0L,r0,r2
68         lsr_s DBL0H,r0,r3
69 #endif
70         asl_s r12,r12,20
71         mov.lo DBL0H,DBL0L
72         sub_s DBL0H,DBL0H,r12
73 .Lret0: j_s.d [blink]
74         mov.ls DBL0L,0
75         ENDFUNC(__floatunsidf)