Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc Remove all FPA code.
details: https://anonhg.NetBSD.org/src/rev/3a790eb26df9
branches: trunk
changeset: 783882:3a790eb26df9
user: matt <matt%NetBSD.org@localhost>
date: Fri Jan 11 13:55:25 2013 +0000
description:
Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
diffstat:
lib/libc/arch/arm/Makefile.inc | 8 ++-
lib/libc/arch/arm/gen/_setjmp.S | 53 +++++++++++----------
lib/libc/arch/arm/gen/setjmp.S | 51 ++++++++++----------
lib/libc/arch/arm/hardfloat/fpgetmask.S | 61 +++++++++++------------
lib/libc/arch/arm/hardfloat/fpgetround.c | 68 ++++++++++++--------------
lib/libc/arch/arm/hardfloat/fpgetsticky.S | 59 +++++++++++------------
lib/libc/arch/arm/hardfloat/fpsetmask.S | 70 ++++++++++++++--------------
lib/libc/arch/arm/hardfloat/fpsetround.c | 69 +++++++++++++--------------
lib/libc/arch/arm/hardfloat/fpsetsticky.S | 68 +++++++++++++--------------
lib/libc/compat/arch/arm/gen/compat_setjmp.S | 29 ++---------
10 files changed, 255 insertions(+), 281 deletions(-)
diffs (truncated from 837 to 300 lines):
diff -r b734ef3ebf3b -r 3a790eb26df9 lib/libc/arch/arm/Makefile.inc
--- a/lib/libc/arch/arm/Makefile.inc Fri Jan 11 13:48:46 2013 +0000
+++ b/lib/libc/arch/arm/Makefile.inc Fri Jan 11 13:55:25 2013 +0000
@@ -1,22 +1,26 @@
-# $NetBSD: Makefile.inc,v 1.16 2012/09/27 11:20:20 skrll Exp $
+# $NetBSD: Makefile.inc,v 1.17 2013/01/11 13:55:25 matt Exp $
.include <bsd.own.mk>
SRCS+= __aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
CPPFLAGS += -I.
-CPPFLAGS += -DSOFTFLOAT
.if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb"
SRCS+= __aeabi_ldivmod.S __aeabi_uldivmod.S
SRCS+= __aeabi_lcmp.c __aeabi_ulcmp.c
+#SRCS+= __aeabi_idiv0.c __aeabi_ldiv0.c
SRCS+= fixunsgen_ieee754.c fixunssfsi_ieee754.c
SRCS+= fixunsgen64_ieee754.c fixunsdfsi_ieee754.c
.endif
+.if ${MKSOFTFLOAT} != "no"
+CPPFLAGS += -DSOFTFLOAT
+
# for earm, use the 64-bit softfloat
.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "armeb"
SOFTFLOAT_BITS=32
.endif
.include <softfloat/Makefile.inc>
+.endif
diff -r b734ef3ebf3b -r 3a790eb26df9 lib/libc/arch/arm/gen/_setjmp.S
--- a/lib/libc/arch/arm/gen/_setjmp.S Fri Jan 11 13:48:46 2013 +0000
+++ b/lib/libc/arch/arm/gen/_setjmp.S Fri Jan 11 13:55:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: _setjmp.S,v 1.7 2012/08/01 06:02:13 matt Exp $ */
+/* $NetBSD: _setjmp.S,v 1.8 2013/01/11 13:55:25 matt Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -32,6 +32,10 @@
* SUCH DAMAGE.
*/
+#if !defined(__SOFTFP__) && !defined(__VFP_FP__)
+#error FPA is not supported anymore
+#endif
+
#include <machine/asm.h>
#include <machine/setjmp.h>
@@ -50,18 +54,16 @@
ENTRY(_setjmp)
ldr r1, .L_setjmp_magic
- str r1, [r0], #4
-#ifdef SOFTFLOAT
- add r0, r0, #52
-#elif defined(__VFP_FP__)
-#error _setjmp VFP support missing
-#else
- /* Store fp registers */
- sfm f4, 4, [r0], #48
- /* Store fpsr */
- rfs r1
- str r1, [r0], #0x0004
-#endif /* SOFTFLOAT */
+ str r1, [r0]
+
+#ifndef __SOFTFP__
+ add r1, r0, #(_JB_REG_D8 * 4)
+ vstmia r1, {d8-d15}
+ vmrs r1, fpscr
+ str r1, [r0, #(_JB_REG_FPSCR * 4)]
+#endif
+
+ add r0, r0, #(_JB_REG_R4 * 4)
/* Store integer registers */
stmia r0, {r4-r14}
@@ -69,25 +71,26 @@
RET
.L_setjmp_magic:
+#ifdef __SOFTFP__
.word _JB_MAGIC__SETJMP
+#else
+ .word _JB_MAGIC__SETJMP_VFP
+#endif
ENTRY(_longjmp)
ldr r2, .L_setjmp_magic
- ldr r3, [r0], #4
+ ldr r3, [r0]
teq r2, r3
bne botch
-#ifdef SOFTFLOAT
- add r0, r0, #52
-#elif defined(__VFP_FP__)
-#error _longjmp VFP support missing
-#else
- /* Restore fp registers */
- lfm f4, 4, [r0], #48
- /* Restore fpsr */
- ldr r4, [r0], #0x0004
- wfs r4
-#endif /* SOFTFLOAT */
+#ifndef __SOFTFP__
+ add r1, r0, #(_JB_REG_D8 * 4)
+ vldmia r1, {d8-d15}
+ ldr r1, [r0, #(_JB_REG_FPSCR * 4)]
+ vmsr fpscr, r1
+#endif
+
+ add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
ldmia r0, {r4-r14}
diff -r b734ef3ebf3b -r 3a790eb26df9 lib/libc/arch/arm/gen/setjmp.S
--- a/lib/libc/arch/arm/gen/setjmp.S Fri Jan 11 13:48:46 2013 +0000
+++ b/lib/libc/arch/arm/gen/setjmp.S Fri Jan 11 13:55:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setjmp.S,v 1.9 2012/08/01 06:02:13 matt Exp $ */
+/* $NetBSD: setjmp.S,v 1.10 2013/01/11 13:55:25 matt Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -32,6 +32,10 @@
* SUCH DAMAGE.
*/
+#if !defined(__SOFTFP__) && !defined(__VFP_FP__)
+#error FPA is not supported anymore
+#endif
+
#include <machine/asm.h>
#include <machine/setjmp.h>
@@ -55,26 +59,27 @@
ldmfd sp!, {r0-r2, r14}
ldr r1, .Lsetjmp_magic
- str r1, [r0], #4
+ str r1, [r0]
-#ifdef SOFTFLOAT
- add r0, r0, #52
-#elif defined(__VFP_FP__)
-#error __setjmp14 VFP support missing
-#else
- /* Store fp registers */
- sfm f4, 4, [r0], #48
- /* Store fpsr */
- rfs r1
- str r1, [r0], #0x0004
-#endif /*SOFTFLOAT*/
+#ifndef __SOFTFP__
+ add r1, r0, #(_JB_REG_D8 * 4)
+ vstmia r1, {d8-d15}
+ vmrs r1, fpscr
+ str r1, [r0, #(_JB_REG_FPSCR * 4)]
+#endif /* !__SOFTFP__ */
+
/* Store integer registers */
+ add r0, r0, #(_JB_REG_R4 * 4)
stmia r0, {r4-r14}
mov r0, #0x00000000
RET
.Lsetjmp_magic:
+#ifdef __SOFTFP__
.word _JB_MAGIC_SETJMP
+#else
+ .word _JB_MAGIC_SETJMP_VFP
+#endif
ENTRY(__longjmp14)
@@ -91,18 +96,14 @@
bl PIC_SYM(_C_LABEL(__sigprocmask14), PLT)
ldmfd sp!, {r0-r2, r14}
- add r0, r0, #4
-#ifdef SOFTFLOAT
- add r0, r0, #52
-#elif defined(__VFP_FP__)
-#error __longjmp14 VFP support missing
-#else
- /* Restore fp registers */
- lfm f4, 4, [r0], #48
- /* Restore FPSR */
- ldr r4, [r0], #0x0004
- wfs r4
-#endif /* SOFTFLOAT */
+#ifndef __SOFTFP__
+ add r1, r0, #(_JB_REG_D8 * 4)
+ vldmia r1, {d8-d15}
+ ldr r1, [r0, #(_JB_REG_FPSCR * 4)]
+ vmsr fpscr, r1
+#endif /* !__SOFTFP__ */
+
+ add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
ldmia r0, {r4-r14}
diff -r b734ef3ebf3b -r 3a790eb26df9 lib/libc/arch/arm/hardfloat/fpgetmask.S
--- a/lib/libc/arch/arm/hardfloat/fpgetmask.S Fri Jan 11 13:48:46 2013 +0000
+++ b/lib/libc/arch/arm/hardfloat/fpgetmask.S Fri Jan 11 13:55:25 2013 +0000
@@ -1,9 +1,12 @@
-/* $NetBSD: fpgetmask.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
+/* $NetBSD: fpgetmask.S,v 1.6 2013/01/11 13:55:26 matt Exp $ */
-/*
- * Copyright (c) 1996 Mark Brinicombe
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,28 +15,25 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD project.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#ifndef __VFP_FP__
+#error FPA is not supported anymore
+#endif
+#include <arm/asm.h>
+#include <arm/vfpreg.h>
/*
* Return the current FP exception enable mask
@@ -41,15 +41,12 @@
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpgetmask, _fpgetmask)
-ENTRY(_fpgetmask)
-#else
-ENTRY(fpgetmask)
+#define fpgetmask _fpgetmask
#endif
-#ifdef __VFP_FP__
-#error _fpgetmask VFP support missing
-#else
- rfs r0
- mov r0, r0, lsr #16
- and r0, r0, #0x1f
+
+ENTRY(fpgetmask)
+ mrc p10, 7, r0, c1, c0, 0
+ and r0, r0, #VFP_FPSCR_ESUM
+ mov r0, r0, lsr #8
RET
-#endif
+END(fpgetmask)
diff -r b734ef3ebf3b -r 3a790eb26df9 lib/libc/arch/arm/hardfloat/fpgetround.c
--- a/lib/libc/arch/arm/hardfloat/fpgetround.c Fri Jan 11 13:48:46 2013 +0000
+++ b/lib/libc/arch/arm/hardfloat/fpgetround.c Fri Jan 11 13:55:25 2013 +0000
@@ -1,9 +1,12 @@
-/* $NetBSD: fpgetround.c,v 1.5 2012/06/24 15:26:02 christos Exp $ */
+/* $NetBSD: fpgetround.c,v 1.6 2013/01/11 13:55:26 matt Exp $ */
Home |
Main Index |
Thread Index |
Old Index