On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs. For some reason, fabs lives in libc, not in libm, and our tests now detect when fabs or fabsl is missing from libm. For those ports that sometimes have long double and sometimes don't, make it conditional. Still missing: fabs _and_ fabsl on ia64. Need help from an itanium wizard! Other portmasters: Please take a look and see if I missed any ports that might have long double where this alias will not work.diff -r1.3 -r1.4 src/lib/libc/arch/alpha/gen/fabs.S
(riastradh)
--- src/lib/libc/arch/alpha/gen/fabs.S 2000/06/14 06:49:02 1.3
+++ src/lib/libc/arch/alpha/gen/fabs.S 2018/11/07 22:21:42 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fabs.S,v 1.3 2000/06/14 06:49:02 cgd Exp $ */ | 1 | /* $NetBSD: fabs.S,v 1.4 2018/11/07 22:21:42 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1994, 1995 Carnegie-Mellon University. | 4 | * Copyright (c) 1994, 1995 Carnegie-Mellon University. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Author: Chris G. Demetriou | 7 | * Author: Chris G. Demetriou | |
8 | * | 8 | * | |
9 | * Permission to use, copy, modify and distribute this software and | 9 | * Permission to use, copy, modify and distribute this software and | |
10 | * its documentation is hereby granted, provided that both the copyright | 10 | * its documentation is hereby granted, provided that both the copyright | |
11 | * notice and this permission notice appear in all copies of the | 11 | * notice and this permission notice appear in all copies of the | |
12 | * software, derivative works or modified versions, and any portions | 12 | * software, derivative works or modified versions, and any portions | |
13 | * thereof, and that both notices appear in supporting documentation. | 13 | * thereof, and that both notices appear in supporting documentation. | |
14 | * | 14 | * | |
@@ -19,17 +19,19 @@ | @@ -19,17 +19,19 @@ | |||
19 | * Carnegie Mellon requests users of this software to return to | 19 | * Carnegie Mellon requests users of this software to return to | |
20 | * | 20 | * | |
21 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | 21 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
22 | * School of Computer Science | 22 | * School of Computer Science | |
23 | * Carnegie Mellon University | 23 | * Carnegie Mellon University | |
24 | * Pittsburgh PA 15213-3890 | 24 | * Pittsburgh PA 15213-3890 | |
25 | * | 25 | * | |
26 | * any improvements or extensions that they make and grant Carnegie the | 26 | * any improvements or extensions that they make and grant Carnegie the | |
27 | * rights to redistribute these changes. | 27 | * rights to redistribute these changes. | |
28 | */ | 28 | */ | |
29 | 29 | |||
30 | #include <machine/asm.h> | 30 | #include <machine/asm.h> | |
31 | 31 | |||
32 | STRONG_ALIAS(fabsl, fabs) | |||
33 | ||||
32 | LEAF(fabs, 1) | 34 | LEAF(fabs, 1) | |
33 | cpys fzero, fa0, fv0 | 35 | cpys fzero, fa0, fv0 | |
34 | RET | 36 | RET | |
35 | END(fabs) | 37 | END(fabs) |
--- src/lib/libc/arch/hppa/gen/fabs.c 2005/12/24 21:42:32 1.4
+++ src/lib/libc/arch/hppa/gen/fabs.c 2018/11/07 22:21:42 1.5
@@ -1,17 +1,23 @@ | @@ -1,17 +1,23 @@ | |||
1 | /* $NetBSD: fabs.c,v 1.4 2005/12/24 21:42:32 perry Exp $ */ | 1 | /* $NetBSD: fabs.c,v 1.5 2018/11/07 22:21:42 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: fabs.c,v 1.3 2002/10/21 18:41:05 mickey Exp $ */ | 3 | /* $OpenBSD: fabs.c,v 1.3 2002/10/21 18:41:05 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Written by Miodrag Vallat. Public domain | 6 | * Written by Miodrag Vallat. Public domain | |
7 | */ | 7 | */ | |
8 | 8 | |||
9 | #include <sys/cdefs.h> | |||
10 | ||||
9 | #include <math.h> | 11 | #include <math.h> | |
10 | 12 | |||
13 | #ifndef __HAVE_LONG_DOUBLE | |||
14 | __strong_alias(fasbl, fabs) | |||
15 | #endif | |||
16 | ||||
11 | double | 17 | double | |
12 | fabs(double val) | 18 | fabs(double val) | |
13 | { | 19 | { | |
14 | 20 | |||
15 | __asm volatile("fabs,dbl %0,%0" : "+f" (val)); | 21 | __asm volatile("fabs,dbl %0,%0" : "+f" (val)); | |
16 | return (val); | 22 | return (val); | |
17 | } | 23 | } |
--- src/lib/libc/arch/m68k/gen/fabs.S 2013/07/17 06:43:32 1.11
+++ src/lib/libc/arch/m68k/gen/fabs.S 2018/11/07 22:21:42 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fabs.S,v 1.11 2013/07/17 06:43:32 matt Exp $ */ | 1 | /* $NetBSD: fabs.S,v 1.12 2018/11/07 22:21:42 riastradh Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996 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 | 8 | * by | |
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. | |
@@ -20,27 +20,32 @@ | @@ -20,27 +20,32 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
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 | #include <machine/math.h> | |||
33 | 34 | |||
34 | RCSID("$NetBSD: fabs.S,v 1.11 2013/07/17 06:43:32 matt Exp $") | 35 | RCSID("$NetBSD: fabs.S,v 1.12 2018/11/07 22:21:42 riastradh Exp $") | |
36 | ||||
37 | #ifndef __HAVE_LONG_DOUBLE | |||
38 | STRONG_ALIAS(fabsl, fabs) | |||
39 | #endif | |||
35 | 40 | |||
36 | ENTRY(fabs) | 41 | ENTRY(fabs) | |
37 | #if defined(__SVR4_ABI__) && defined(__HAVE_FPU__) | 42 | #if defined(__SVR4_ABI__) && defined(__HAVE_FPU__) | |
38 | bclr #31,4(%sp) | 43 | bclr #31,4(%sp) | |
39 | fmoved 4(%sp),%fp0 | 44 | fmoved 4(%sp),%fp0 | |
40 | #else | 45 | #else | |
41 | movl 4(%sp),%d0 | 46 | movl 4(%sp),%d0 | |
42 | movl 8(%sp),%d1 | 47 | movl 8(%sp),%d1 | |
43 | bclr #31,%d0 | 48 | bclr #31,%d0 | |
44 | #endif | 49 | #endif | |
45 | rts | 50 | rts | |
46 | END(fabs) | 51 | END(fabs) |
--- src/lib/libc/arch/mips/gen/fabs.S 2009/12/14 01:07:42 1.8
+++ src/lib/libc/arch/mips/gen/fabs.S 2018/11/07 22:21:42 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt Exp $ */ | 1 | /* $NetBSD: fabs.S,v 1.9 2018/11/07 22:21:42 riastradh Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1993 | 4 | * Copyright (c) 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Ralph Campbell. | 8 | * Ralph Campbell. | |
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. | |
@@ -23,35 +23,40 @@ | @@ -23,35 +23,40 @@ | |||
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
32 | * SUCH DAMAGE. | 32 | * SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | #include <mips/asm.h> | 35 | #include <mips/asm.h> | |
36 | #include <mips/math.h> | |||
36 | 37 | |||
37 | #if defined(LIBC_SCCS) && !defined(lint) | 38 | #if defined(LIBC_SCCS) && !defined(lint) | |
38 | #if 0 | 39 | #if 0 | |
39 | RCSID("from: @(#)fabs.s 8.1 (Berkeley) 2/16/94") | 40 | RCSID("from: @(#)fabs.s 8.1 (Berkeley) 2/16/94") | |
40 | #else | 41 | #else | |
41 | RCSID("$NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt Exp $") | 42 | RCSID("$NetBSD: fabs.S,v 1.9 2018/11/07 22:21:42 riastradh Exp $") | |
42 | #endif | 43 | #endif | |
43 | #endif /* LIBC_SCCS and not lint */ | 44 | #endif /* LIBC_SCCS and not lint */ | |
44 | 45 | |||
45 | 46 | |||
46 | .set noreorder | 47 | .set noreorder | |
47 | 48 | |||
49 | #ifndef __HAVE_LONG_DOUBLE | |||
50 | STRONG_ALIAS(fabsl, fabs) | |||
51 | #endif | |||
52 | ||||
48 | /* | 53 | /* | |
49 | * fabs(x) | 54 | * fabs(x) | |
50 | * double x; | 55 | * double x; | |
51 | * | 56 | * | |
52 | * Return absolute value of x. | 57 | * Return absolute value of x. | |
53 | */ | 58 | */ | |
54 | LEAF(fabs) | 59 | LEAF(fabs) | |
55 | j ra | 60 | j ra | |
56 | abs.d $f0, $f12 # compute absolute value of x | 61 | abs.d $f0, $f12 # compute absolute value of x | |
57 | END(fabs) | 62 | END(fabs) |
--- src/lib/libc/arch/powerpc/gen/fabs_ieee754.S 2014/01/28 13:47:04 1.1
+++ src/lib/libc/arch/powerpc/gen/fabs_ieee754.S 2018/11/07 22:21:42 1.2
@@ -1,12 +1,14 @@ | @@ -1,12 +1,14 @@ | |||
1 | /* $NetBSD: fabs_ieee754.S,v 1.1 2014/01/28 13:47:04 macallan Exp $ */ | 1 | /* $NetBSD: fabs_ieee754.S,v 1.2 2018/11/07 22:21:42 riastradh Exp $ */ | |
2 | 2 | |||
3 | #include <machine/asm.h> | 3 | #include <machine/asm.h> | |
4 | 4 | |||
5 | #if defined(LIBC_SCCS) | 5 | #if defined(LIBC_SCCS) | |
6 | __RCSID("$NetBSD: fabs_ieee754.S,v 1.1 2014/01/28 13:47:04 macallan Exp $") | 6 | __RCSID("$NetBSD: fabs_ieee754.S,v 1.2 2018/11/07 22:21:42 riastradh Exp $") | |
7 | #endif | 7 | #endif | |
8 | 8 | |||
9 | STRONG_ALIAS(fabsl, fabs) | |||
10 | ||||
9 | ENTRY(fabs) | 11 | ENTRY(fabs) | |
10 | fabs %f1,%f1 | 12 | fabs %f1,%f1 | |
11 | blr | 13 | blr | |
12 | END(fabs) | 14 | END(fabs) |
--- src/lib/libc/arch/sparc/gen/fabs.S 2003/08/07 16:42:23 1.4
+++ src/lib/libc/arch/sparc/gen/fabs.S 2018/11/07 22:21:42 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fabs.S,v 1.4 2003/08/07 16:42:23 agc Exp $ */ | 1 | /* $NetBSD: fabs.S,v 1.5 2018/11/07 22:21:42 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1992, 1993 | 4 | * Copyright (c) 1992, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This software was developed by the Computer Systems Engineering group | 7 | * This software was developed by the Computer Systems Engineering group | |
8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | 8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | |
9 | * contributed to Berkeley. | 9 | * contributed to Berkeley. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -30,25 +30,27 @@ | @@ -30,25 +30,27 @@ | |||
30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
33 | * SUCH DAMAGE. | 33 | * SUCH DAMAGE. | |
34 | * | 34 | * | |
35 | * from: Header: fabs.s,v 1.4 91/10/07 23:59:05 torek Exp | 35 | * from: Header: fabs.s,v 1.4 91/10/07 23:59:05 torek Exp | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <machine/asm.h> | 38 | #include <machine/asm.h> | |
39 | #if defined(LIBC_SCCS) && !defined(lint) | 39 | #if defined(LIBC_SCCS) && !defined(lint) | |
40 | #if 0 | 40 | #if 0 | |
41 | .asciz "@(#)fabs.s 8.1 (Berkeley) 6/4/93" | 41 | .asciz "@(#)fabs.s 8.1 (Berkeley) 6/4/93" | |
42 | #else | 42 | #else | |
43 | RCSID("$NetBSD: fabs.S,v 1.4 2003/08/07 16:42:23 agc Exp $") | 43 | RCSID("$NetBSD: fabs.S,v 1.5 2018/11/07 22:21:42 riastradh Exp $") | |
44 | #endif | 44 | #endif | |
45 | #endif /* LIBC_SCCS and not lint */ | 45 | #endif /* LIBC_SCCS and not lint */ | |
46 | 46 | |||
47 | /* fabs - floating absolute value */ | 47 | /* fabs - floating absolute value */ | |
48 | 48 | |||
49 | STRONG_ALIAS(fabsl, fabs) | |||
49 | 50 | |||
50 | ENTRY(fabs) | 51 | ENTRY(fabs) | |
51 | std %o0, [%sp + 32] ! return value => %f0:f1 | 52 | std %o0, [%sp + 32] ! return value => %f0:f1 | |
52 | ldd [%sp + 32], %f0 ! (via kernel %o0/%o1 slot) | 53 | ldd [%sp + 32], %f0 ! (via kernel %o0/%o1 slot) | |
53 | retl | 54 | retl | |
54 | fabss %f0, %f0 ! return absolute value | 55 | fabss %f0, %f0 ! return absolute value | |
56 | END(fabs) |
--- src/lib/libc/arch/vax/gen/fabs.S 2011/01/25 02:38:15 1.4
+++ src/lib/libc/arch/vax/gen/fabs.S 2018/11/07 22:21:42 1.5
@@ -21,25 +21,27 @@ | @@ -21,25 +21,27 @@ | |||
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
27 | * SUCH DAMAGE. | 27 | * SUCH DAMAGE. | |
28 | */ | 28 | */ | |
29 | 29 | |||
30 | #include "DEFS.h" | 30 | #include "DEFS.h" | |
31 | 31 | |||
32 | #if defined(LIBC_SCCS) && !defined(lint) | 32 | #if defined(LIBC_SCCS) && !defined(lint) | |
33 | /* .asciz "@(#)fabs.s 8.1 (Berkeley) 6/4/93" */ | 33 | /* .asciz "@(#)fabs.s 8.1 (Berkeley) 6/4/93" */ | |
34 | RCSID("$NetBSD: fabs.S,v 1.4 2011/01/25 02:38:15 matt Exp $") | 34 | RCSID("$NetBSD: fabs.S,v 1.5 2018/11/07 22:21:42 riastradh Exp $") | |
35 | #endif /* LIBC_SCCS and not lint */ | 35 | #endif /* LIBC_SCCS and not lint */ | |
36 | 36 | |||
37 | STRONG_ALIAS(fabsl, fabs) | |||
38 | ||||
37 | /* fabs - floating absolute value */ | 39 | /* fabs - floating absolute value */ | |
38 | 40 | |||
39 | ENTRY(fabs, 0) | 41 | ENTRY(fabs, 0) | |
40 | movd 4(%ap),%r0 | 42 | movd 4(%ap),%r0 | |
41 | bgeq 1f | 43 | bgeq 1f | |
42 | mnegd %r0,%r0 | 44 | mnegd %r0,%r0 | |
43 | 1: | 45 | 1: | |
44 | ret | 46 | ret | |
45 | END(fabs) | 47 | END(fabs) |