| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: floatunsisf.S,v 1.1 2013/07/18 21:25:11 matt Exp $ */ | | 1 | /* $NetBSD: floatunsisf.S,v 1.2 2013/07/19 22:32:04 matt Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Matt Thomas of 3am Software Foundry. | | 8 | * by Matt Thomas of 3am Software Foundry. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -22,45 +22,45 @@ | | | @@ -22,45 +22,45 @@ |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <machine/asm.h> | | 32 | #include <machine/asm.h> |
33 | | | 33 | |
34 | #if defined(LIBC_SCCS) && !defined(lint) | | 34 | #if defined(LIBC_SCCS) && !defined(lint) |
35 | RCSID("$NetBSD: floatunsisf.S,v 1.1 2013/07/18 21:25:11 matt Exp $") | | 35 | RCSID("$NetBSD: floatunsisf.S,v 1.2 2013/07/19 22:32:04 matt Exp $") |
36 | #endif /* LIBC_SCCS and not lint */ | | 36 | #endif /* LIBC_SCCS and not lint */ |
37 | | | 37 | |
38 | #ifdef __mcoldfire__ | | 38 | #ifdef __mcoldfire__ |
39 | .section .rodata,"a" | | 39 | .section .rodata,"a" |
40 | .p2align 2 | | 40 | .p2align 2 |
41 | L2G: .double 0r2147483648.0 | | 41 | L2G: .double 0r2147483648.0 |
42 | #endif | | 42 | #endif |
43 | | | 43 | |
44 | /* LINTSTUB: double __floatunsisf(unsigned int); */ | | 44 | /* LINTSTUB: double __floatunsisf(unsigned int); */ |
45 | ENTRY(__floatunsisf) | | 45 | ENTRY(__floatunsisf) |
46 | movl 4(%sp),%d0 | | 46 | movl 4(%sp),%d0 |
47 | jpl 1f | | 47 | jpl 1f |
48 | fsmovel %d0,%fp0 | | 48 | fmovel %d0,%fp0 |
49 | #ifndef __SVR4_ABI__ | | 49 | #ifndef __SVR4_ABI__ |
50 | fmoves %fp0,%d0 | | 50 | fmoves %fp0,%d0 |
51 | #endif | | 51 | #endif |
52 | rts | | 52 | rts |
53 | 1: | | 53 | 1: |
54 | bclr #31,%d0 | | 54 | bclr #31,%d0 |
55 | fsmovel %d0,%fp0 | | 55 | fmovel %d0,%fp0 |
56 | #ifdef __mcoldfire__ | | 56 | #ifdef __mcoldfire__ |
57 | LEA_LCL(L2G,%a0) | | 57 | LEA_LCL(L2G,%a0) |
58 | fsaddd (%a0),%fp0 | | 58 | faddd (%a0),%fp0 |
59 | #else | | 59 | #else |
60 | fsaddd #0r2147483648.0,%fp0 | | 60 | faddd #0r2147483648.0,%fp0 |
61 | #endif | | 61 | #endif |
62 | #ifndef __SVR4_ABI__ | | 62 | #ifndef __SVR4_ABI__ |
63 | fmoves %fp0,%d0 | | 63 | fmoves %fp0,%d0 |
64 | #endif | | 64 | #endif |
65 | rts | | 65 | rts |
66 | END(__floatunsisf) | | 66 | END(__floatunsisf) |