Remove all FPA code.
Support VFP for hard float Allow MKSOFTFLOAT=no
This commit is contained in:
parent
64a326518f
commit
60e851836f
|
@ -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
|
||||
|
|
|
@ -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 @@ ENTRY(_setjmp)
|
|||
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}
|
||||
|
||||
|
|
|
@ -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 @@ ENTRY(__setjmp14)
|
|||
ldmfd sp!, {r0-r2, r14}
|
||||
|
||||
ldr r1, .Lsetjmp_magic
|
||||
str r1, [r0], #4
|
||||
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 /* !__SOFTFP__ */
|
||||
|
||||
#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*/
|
||||
/* 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 @@ ENTRY(__longjmp14)
|
|||
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}
|
||||
|
||||
|
|
|
@ -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
|
||||
#define fpgetmask _fpgetmask
|
||||
#endif
|
||||
|
||||
ENTRY(fpgetmask)
|
||||
#endif
|
||||
#ifdef __VFP_FP__
|
||||
#error _fpgetmask VFP support missing
|
||||
#else
|
||||
rfs r0
|
||||
mov r0, r0, lsr #16
|
||||
and r0, r0, #0x1f
|
||||
mrc p10, 7, r0, c1, c0, 0
|
||||
and r0, r0, #VFP_FPSCR_ESUM
|
||||
mov r0, r0, lsr #8
|
||||
RET
|
||||
#endif
|
||||
END(fpgetmask)
|
||||
|
|
|
@ -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 $ */
|
||||
|
||||
/*
|
||||
* 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,27 @@
|
|||
* 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. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
|
||||
*/
|
||||
|
||||
#ifndef __VFP_FP__
|
||||
#error FPA is not supported anymore
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: fpgetround.c,v 1.5 2012/06/24 15:26:02 christos Exp $");
|
||||
__RCSID("$NetBSD: fpgetround.c,v 1.6 2013/01/11 13:55:26 matt Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "namespace.h"
|
||||
|
@ -41,32 +43,24 @@ __RCSID("$NetBSD: fpgetround.c,v 1.5 2012/06/24 15:26:02 christos Exp $");
|
|||
#include <sys/types.h>
|
||||
#include <ieeefp.h>
|
||||
|
||||
#include <arm/vfpreg.h>
|
||||
|
||||
#ifdef __weak_alias
|
||||
__weak_alias(fpgetround,_fpgetround)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return the current FP rounding mode
|
||||
*
|
||||
* ok all we need to do is return the current FP rounding mode
|
||||
*
|
||||
* HOWEVER:
|
||||
* The ARM FPA codes the rounding mode into the actual FP instructions
|
||||
* so there is no such thing as a global rounding mode.
|
||||
* The default is round to nearest if rounding is not explicitly specified.
|
||||
* FP instructions generated by GCC will not explicitly specify a rounding
|
||||
* mode.
|
||||
*
|
||||
* So the best we can do it to return the rounding mode FP instructions
|
||||
* use if rounding is not specified which is round to nearest.
|
||||
*
|
||||
* This could change in the future with new floating point emulators or
|
||||
* soft float FP libraries.
|
||||
*/
|
||||
|
||||
fp_rnd
|
||||
fpgetround(void)
|
||||
{
|
||||
|
||||
return(FP_RN);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RN, VFP_FPSCR_RMODE) == FP_RN);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RP, VFP_FPSCR_RMODE) == FP_RP);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RM, VFP_FPSCR_RMODE) == FP_RM);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RZ, VFP_FPSCR_RMODE) == FP_RZ);
|
||||
uint32_t fpscr;
|
||||
__asm __volatile("vmrs %0, fpscr" : "=r" (fpscr));
|
||||
return __SHIFTOUT(fpscr, VFP_FPSCR_RMODE);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/* $NetBSD: fpgetsticky.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
|
||||
/* $NetBSD: fpgetsticky.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.
|
||||
*/
|
||||
#ifndef __VFP_FP__
|
||||
#error FPA is not supported anymore
|
||||
#endif
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <arm/asm.h>
|
||||
#include <arm/vfpreg.h>
|
||||
|
||||
/*
|
||||
* Return the current FP cumulative flags
|
||||
|
@ -41,14 +41,11 @@
|
|||
|
||||
#ifdef WEAK_ALIAS
|
||||
WEAK_ALIAS(fpgetsticky, _fpgetsticky)
|
||||
ENTRY(_fpgetsticky)
|
||||
#else
|
||||
#define fpgetsticky _fpgetsticky
|
||||
#endif
|
||||
|
||||
ENTRY(fpgetsticky)
|
||||
#endif
|
||||
#ifdef __VFP_FP__
|
||||
#error _fpgetsticky VFP support missing
|
||||
#else
|
||||
rfs r0
|
||||
and r0, r0, #0x1f
|
||||
vmrs r0, fpscr
|
||||
and r0, r0, #VFP_FPSCR_CSUM
|
||||
RET
|
||||
#endif
|
||||
END(fpgetsticky)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/* $NetBSD: fpsetmask.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
|
||||
/* $NetBSD: fpsetmask.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,26 @@
|
|||
* 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>
|
||||
|
||||
/*
|
||||
* Set the current FP exception enable mask
|
||||
|
@ -41,18 +42,17 @@
|
|||
|
||||
#ifdef WEAK_ALIAS
|
||||
WEAK_ALIAS(fpsetmask, _fpsetmask)
|
||||
ENTRY(_fpsetmask)
|
||||
#else
|
||||
#define fpsetmask _fpsetmask
|
||||
#endif
|
||||
|
||||
ENTRY(fpsetmask)
|
||||
#endif
|
||||
#ifdef __VFP_FP__
|
||||
#error _fpsetmask VFP support missing
|
||||
#else
|
||||
rfs r1
|
||||
bic r1, r1, #0x001f0000
|
||||
and r0, r0, #0x0000001f
|
||||
orr r0, r1, r0, lsl #16
|
||||
wfs r0
|
||||
mov r0, r1, lsr #16 /* Return old mask */
|
||||
and r2, r0, #VFP_FPSCR_CSUM
|
||||
vmrs r1, fpscr
|
||||
mov r0, r1, lsr #8 /* Return old mask */
|
||||
bic r1, r1, #VFP_FPSCR_ESUM
|
||||
orr r1, r1, r2, lsl #8
|
||||
vmsr fpscr, r1
|
||||
mcr p10, 7, r1, c1, c0, 0
|
||||
and r0, r0, #VFP_FPSCR_CSUM
|
||||
RET
|
||||
#endif
|
||||
END(fpsetmask)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/* $NetBSD: fpsetround.c,v 1.6 2006/02/25 02:28:55 wiz Exp $ */
|
||||
/* $NetBSD: fpsetround.c,v 1.7 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,27 @@
|
|||
* 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. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
|
||||
*/
|
||||
|
||||
#ifndef __VFP_FP__
|
||||
#error FPA is not supported anymore
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: fpsetround.c,v 1.6 2006/02/25 02:28:55 wiz Exp $");
|
||||
__RCSID("$NetBSD: fpsetround.c,v 1.7 2013/01/11 13:55:26 matt Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "namespace.h"
|
||||
|
@ -47,24 +49,19 @@ __weak_alias(fpsetround,_fpsetround)
|
|||
|
||||
/*
|
||||
* Return the current FP rounding mode
|
||||
*
|
||||
* ok all we need to do is return the current FP rounding mode
|
||||
*
|
||||
* HOWEVER:
|
||||
* The ARM FPA codes the rounding mode into the actual FP instructions
|
||||
* so there is no such thing as a global rounding mode.
|
||||
* The default is round to nearest if rounding is not explicitly specified.
|
||||
* FP instructions generated by GCC will not explicitly specify a rounding
|
||||
* mode.
|
||||
*
|
||||
* All we can do is abort if they ask for anything else.
|
||||
*/
|
||||
|
||||
fp_rnd
|
||||
fpsetround(fp_rnd rnd_dir)
|
||||
fpsetround(fp_rnd new_rnd)
|
||||
{
|
||||
|
||||
if (rnd_dir != FP_RN)
|
||||
abort();
|
||||
return (FP_RN);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RN, VFP_FPSCR_RMODE) == FP_RN);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RP, VFP_FPSCR_RMODE) == FP_RP);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RM, VFP_FPSCR_RMODE) == FP_RM);
|
||||
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RZ, VFP_FPSCR_RMODE) == FP_RZ);
|
||||
uint32_t fpscr;
|
||||
__asm __volatile("vmrs %0, fpscr" : "=r" (fpscr));
|
||||
fp_rnd old_rnd = __SHIFTOUT(fpscr, VFP_FPSCR_RMODE);
|
||||
fpscr ^= __SHIFTIN(new_rnd ^ old_rnd, VFP_FPSCR_RMODE);
|
||||
__asm __volatile("vmsr fpscr, %0" :: "r" (fpscr));
|
||||
return old_rnd;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/* $NetBSD: fpsetsticky.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
|
||||
/* $NetBSD: fpsetsticky.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,26 @@
|
|||
* 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>
|
||||
|
||||
/*
|
||||
* Set the current FP cumulative flags
|
||||
|
@ -41,18 +42,15 @@
|
|||
|
||||
#ifdef WEAK_ALIAS
|
||||
WEAK_ALIAS(fpsetsticky, _fpsetsticky)
|
||||
ENTRY(_fpsetsticky)
|
||||
#else
|
||||
#define fpsetsticky _fpsetsticky
|
||||
#endif
|
||||
|
||||
ENTRY(fpsetsticky)
|
||||
#endif
|
||||
#ifdef __VFP_FP__
|
||||
#error _fpsetsticky VFP support missing
|
||||
#else
|
||||
rfs r1
|
||||
bic r1, r1, #0x1f
|
||||
and r0, r0, #0x1f
|
||||
orr r0, r1, r0
|
||||
wfs r0
|
||||
mov r0, r1 /* Return old mask */
|
||||
and r1, r0, #VFP_FPSCR_CSUM
|
||||
vmrs r0, fpscr
|
||||
bic r2, r0, #VFP_FPSCR_CSUM
|
||||
orr r1, r1, r2
|
||||
vmsr fpscr, r1
|
||||
and r0, r0, #VFP_FPSCR_CSUM
|
||||
RET
|
||||
#endif
|
||||
END(fpsetsticky)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: compat_setjmp.S,v 1.1 2005/10/16 17:27:50 christos Exp $ */
|
||||
/* $NetBSD: compat_setjmp.S,v 1.2 2013/01/11 13:55:26 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Mark Brinicombe
|
||||
|
@ -56,21 +56,13 @@ ENTRY(setjmp)
|
|||
ldmfd sp!, {r0, r14}
|
||||
|
||||
/* Store signal mask */
|
||||
str r1, [r0, #(25 * 4)]
|
||||
str r1, [r0, #(_JB_SIGMASK * 4)]
|
||||
|
||||
ldr r1, .Lsetjmp_magic
|
||||
str r1, [r0], #4
|
||||
str r1, [r0]
|
||||
|
||||
#ifdef SOFTFLOAT
|
||||
add r0, r0, #52
|
||||
#else
|
||||
/* Store fp registers */
|
||||
sfm f4, 4, [r0], #48
|
||||
/* Store fpsr */
|
||||
rfs r1
|
||||
str r1, [r0], #0x0004
|
||||
#endif /*SOFTFLOAT*/
|
||||
/* Store integer registers */
|
||||
add r0, r0, #(_JB_REG_R4 * 4)
|
||||
stmia r0, {r4-r14}
|
||||
mov r0, #0x00000000
|
||||
RET
|
||||
|
@ -86,7 +78,7 @@ ENTRY(longjmp)
|
|||
bne botch
|
||||
|
||||
/* Fetch signal mask */
|
||||
ldr r2, [r0, #(25 * 4)]
|
||||
ldr r2, [r0, #(_JB_SIGMASK * 4)]
|
||||
|
||||
/* Set signal mask */
|
||||
stmfd sp!, {r0, r1, r14}
|
||||
|
@ -98,17 +90,8 @@ ENTRY(longjmp)
|
|||
add sp, sp, #4 /* unalign the stack */
|
||||
ldmfd sp!, {r0, r1, r14}
|
||||
|
||||
add r0, r0, #4
|
||||
#ifdef SOFTFLOAT
|
||||
add r0, r0, #52
|
||||
#else
|
||||
/* Restore fp registers */
|
||||
lfm f4, 4, [r0], #48
|
||||
/* Restore FPSR */
|
||||
ldr r4, [r0], #0x0004
|
||||
wfs r4
|
||||
#endif /* SOFTFLOAT */
|
||||
/* Restore integer registers */
|
||||
add r0, r0, #(_JB_REG_R4 * 4)
|
||||
ldmia r0, {r4-r14}
|
||||
|
||||
/* Validate sp and r14 */
|
||||
|
|
Loading…
Reference in New Issue