Index: stable/10/lib/libc/arm/aeabi/Makefile.inc =================================================================== --- stable/10/lib/libc/arm/aeabi/Makefile.inc (revision 273470) +++ stable/10/lib/libc/arm/aeabi/Makefile.inc (revision 273471) @@ -1,35 +1,37 @@ # $FreeBSD$ .PATH: ${.CURDIR}/arm/aeabi -SRCS+= aeabi_atexit.c \ +SRCS+= aeabi_asm_double.S \ + aeabi_asm_float.S \ + aeabi_atexit.c \ aeabi_double.c \ aeabi_float.c \ aeabi_unwind_cpp.c \ aeabi_unwind_exidx.c .if ${MACHINE_ARCH:Marmv6*} SRCS+= aeabi_vfp_double.S \ aeabi_vfp_float.S .endif # Add the aeabi_mem* functions. While they live in compiler-rt they call into # libc. This causes issues when other parts of libc call these functions. # We work around this by including these functions in libc but mark them as # hidden so users of libc will not pick up these versions. .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm SRCS+= aeabi_memcmp.S \ aeabi_memcpy.S \ aeabi_memmove.S \ aeabi_memset.S # Mark the functions as hidden so they are not available outside of libc. CFLAGS.aeabi_memcmp.S= -DVISIBILITY_HIDDEN CFLAGS.aeabi_memcpy.S= -DVISIBILITY_HIDDEN CFLAGS.aeabi_memmove.S= -DVISIBILITY_HIDDEN CFLAGS.aeabi_memset.S= -DVISIBILITY_HIDDEN CFLAGS+= ${CFLAGS.${.IMPSRC:T}} SYM_MAPS+=${.CURDIR}/arm/aeabi/Symbol.map Index: stable/10/lib/libc/arm/aeabi/Symbol.map =================================================================== --- stable/10/lib/libc/arm/aeabi/Symbol.map (revision 273470) +++ stable/10/lib/libc/arm/aeabi/Symbol.map (revision 273471) @@ -1,47 +1,55 @@ /* * $FreeBSD$ */ /* * This only needs to contain AEABI symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSDprivate_1.0 { __aeabi_atexit; __aeabi_dcmpeq; __aeabi_dcmplt; __aeabi_dcmple; __aeabi_dcmpge; __aeabi_dcmpgt; __aeabi_dcmpun; + __aeabi_cdcmpeq; + __aeabi_cdcmple; + __aeabi_cdrcmple; + __aeabi_d2iz; __aeabi_d2f; __aeabi_dadd; __aeabi_ddiv; __aeabi_dmul; __aeabi_dsub; __aeabi_fcmpeq; __aeabi_fcmplt; __aeabi_fcmple; __aeabi_fcmpge; __aeabi_fcmpgt; __aeabi_fcmpun; + + __aeabi_cfcmpeq; + __aeabi_cfcmple; + __aeabi_cfrcmple; __aeabi_f2iz; __aeabi_f2d; __aeabi_fadd; __aeabi_fdiv; __aeabi_fmul; __aeabi_fsub; __aeabi_i2d; __aeabi_i2f; }; Index: stable/10/lib/libc/arm/aeabi/aeabi_asm_double.S =================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_asm_double.S (nonexistent) +++ stable/10/lib/libc/arm/aeabi/aeabi_asm_double.S (revision 273471) @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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. + * + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#define PCR_Z (1 << 30) +#define PCR_C (1 << 29) + +/* + * These functions return the result in the CPSR register. + * + * For __aeabi_cdcmple: + * Z C + * LT 0 0 + * EQ 1 1 + * else 0 1 + * + * __aeabi_cdrcmple is the same as __aeabi_cdcmple, however the arguments + * have been swapped. + */ +ENTRY(__aeabi_cdcmple) + push {r4, r5, r6, r7, ip, lr} + + /* Backup the input registers */ + mov r4, r0 + mov r5, r1 + mov r6, r2 + mov r7, r3 + /* Is it less than? */ + bl __aeabi_dcmplt + cmp r0, #1 + bne 1f + /* Yes, clear Z and C */ + msr cpsr_c, #(0) + b 99f + +1: + /* Restore the input regsters for the next function call */ + mov r0, r4 + mov r1, r5 + mov r2, r6 + mov r3, r7 + /* Is it equal? */ + bl __aeabi_dcmpeq + cmp r0, #1 + bne 2f + /* Yes, set Z and C */ + msr cpsr_c, #(PCR_Z | PCR_C) + b 99f + +2: + /* Not less than or equal, set C and clear Z */ + msr cpsr_c, #(PCR_C) + +99: + pop {r4, r5, r6, r7, ip, pc} +END(__aeabi_cdcmple) + +ENTRY(__aeabi_cdrcmple) + /* Swap the first half of the arguments */ + mov ip, r0 + mov r0, r2 + mov r2, ip + + /* And the second half */ + mov ip, r1 + mov r1, r3 + mov r3, ip + + b __aeabi_cdcmple +END(__aeabi_cdrcmple) + +/* + * This is just like __aeabi_cdcmple except it will not throw an exception + * in the presence of a quiet NaN. If either argument is a signalling NaN we + * will still signal. + */ +ENTRY(__aeabi_cdcmpeq) + /* Check if we can call __aeabi_cfcmple safely */ + push {r0, r1, r2, r3, r4, lr} + bl __aeabi_cdcmpeq_helper + cmp r0, #1 + pop {r0, r1, r2, r3, r4, lr} + beq 1f + + bl __aeabi_cdcmple + RET + +1: + msr cpsr_c, #(PCR_C) + RET +END(__aeabi_cdcmpeq) Property changes on: stable/10/lib/libc/arm/aeabi/aeabi_asm_double.S ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: stable/10/lib/libc/arm/aeabi/aeabi_asm_float.S =================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_asm_float.S (nonexistent) +++ stable/10/lib/libc/arm/aeabi/aeabi_asm_float.S (revision 273471) @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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. + * + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#define PCR_Z (1 << 30) +#define PCR_C (1 << 29) + +/* + * These functions return the result in the CPSR register. + * + * For __aeabi_cfcmple: + * Z C + * LT 0 0 + * EQ 1 1 + * else 0 1 + * + * __aeabi_cfrcmple is the same as __aeabi_cfcmple, however the arguments + * have been swapped. + */ +ENTRY(__aeabi_cfcmple) + push {r4, r5, ip, lr} + + /* Backup the input registers */ + mov r4, r0 + mov r5, r1 + /* Is it less than? */ + bl __aeabi_fcmplt + cmp r0, #1 + bne 1f + /* Yes, clear Z and C */ + msr cpsr_c, #(0) + b 99f + +1: + /* Restore the input regsters for the next function call */ + mov r0, r4 + mov r1, r5 + /* Is it equal? */ + bl __aeabi_fcmpeq + cmp r0, #1 + bne 2f + /* Yes, set Z and C */ + msr cpsr_c, #(PCR_Z | PCR_C) + b 99f + +2: + /* Not less than or equal, set C and clear Z */ + msr cpsr_c, #(PCR_C) + +99: + pop {r4, r5, ip, pc} +END(__aeabi_cfcmple) + +ENTRY(__aeabi_cfrcmple) + /* Swap the arguments */ + mov ip, r0 + mov r0, r1 + mov r1, ip + + b __aeabi_cfcmple +END(__aeabi_cfrcmple) + +/* + * This is just like __aeabi_cfcmple except it will not throw an exception + * in the presence of a quiet NaN. If either argument is a signalling NaN we + * will still signal. + */ +ENTRY(__aeabi_cfcmpeq) + /* Check if we can call __aeabi_cfcmple safely */ + push {r0, r1, r2, lr} + bl __aeabi_cfcmpeq_helper + cmp r0, #1 + pop {r0, r1, r2, lr} + beq 1f + + bl __aeabi_cfcmple + RET + +1: + msreq cpsr_c, #(PCR_C) + RET +END(__aeabi_cfcmpeq) Property changes on: stable/10/lib/libc/arm/aeabi/aeabi_asm_float.S ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: stable/10/lib/libc/arm/aeabi/aeabi_double.c =================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_double.c (revision 273470) +++ stable/10/lib/libc/arm/aeabi/aeabi_double.c (revision 273471) @@ -1,76 +1,101 @@ /* * Copyright (C) 2012 Andrew Turner * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * * 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. * */ #include __FBSDID("$FreeBSD$"); #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" #include "aeabi_vfp.h" extern int _libc_arm_fpu_present; flag __unorddf2(float64, float64); /* These are written in asm and are only called from this file */ int __aeabi_dcmpeq_vfp(float64, float64); int __aeabi_dcmplt_vfp(float64, float64); int __aeabi_dcmple_vfp(float64, float64); int __aeabi_dcmpgt_vfp(float64, float64); int __aeabi_dcmpge_vfp(float64, float64); int __aeabi_dcmpun_vfp(float64, float64); int __aeabi_d2iz_vfp(float64); float32 __aeabi_d2f_vfp(float64); float64 __aeabi_i2d_vfp(int); float64 __aeabi_dadd_vfp(float64, float64); float64 __aeabi_ddiv_vfp(float64, float64); float64 __aeabi_dmul_vfp(float64, float64); float64 __aeabi_dsub_vfp(float64, float64); /* * Depending on the target these will: * On armv6 with a vfp call the above function, or * Call the softfloat function in the 3rd argument. */ int AEABI_FUNC2(dcmpeq, float64, float64_eq) int AEABI_FUNC2(dcmplt, float64, float64_lt) int AEABI_FUNC2(dcmple, float64, float64_le) int AEABI_FUNC2_REV(dcmpge, float64, float64_le) int AEABI_FUNC2_REV(dcmpgt, float64, float64_lt) int AEABI_FUNC2(dcmpun, float64, __unorddf2) int AEABI_FUNC(d2iz, float64, float64_to_int32_round_to_zero) float32 AEABI_FUNC(d2f, float64, float64_to_float32) float64 AEABI_FUNC(i2d, int, int32_to_float64) float64 AEABI_FUNC2(dadd, float64, float64_add) float64 AEABI_FUNC2(ddiv, float64, float64_div) float64 AEABI_FUNC2(dmul, float64, float64_mul) float64 AEABI_FUNC2(dsub, float64, float64_sub) +int +__aeabi_cdcmpeq_helper(float64 a, float64 b) +{ + int quiet = 0; + + /* Check if a is a NaN */ + if ((a << 1) > 0xffe0000000000000ull) { + /* If it's a signalling NaN we will always signal */ + if ((a & 0x0008000000000000ull) == 0) + return (0); + + quiet = 1; + } + + /* Check if b is a NaN */ + if ((b << 1) > 0xffe0000000000000ull) { + /* If it's a signalling NaN we will always signal */ + if ((b & 0x0008000000000000ull) == 0) + return (0); + + quiet = 1; + } + + return (quiet); +} Index: stable/10/lib/libc/arm/aeabi/aeabi_float.c =================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_float.c (revision 273470) +++ stable/10/lib/libc/arm/aeabi/aeabi_float.c (revision 273471) @@ -1,76 +1,101 @@ /* * Copyright (C) 2012 Andrew Turner * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * * 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. * */ #include __FBSDID("$FreeBSD$"); #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" #include "aeabi_vfp.h" extern int _libc_arm_fpu_present; flag __unordsf2(float32, float32); /* These are written in asm and are only called from this file */ int __aeabi_fcmpeq_vfp(float32, float32); int __aeabi_fcmplt_vfp(float32, float32); int __aeabi_fcmple_vfp(float32, float32); int __aeabi_fcmpgt_vfp(float32, float32); int __aeabi_fcmpge_vfp(float32, float32); int __aeabi_fcmpun_vfp(float32, float32); int __aeabi_f2iz_vfp(float32); float64 __aeabi_f2d_vfp(float32); float32 __aeabi_i2f_vfp(int); float32 __aeabi_fadd_vfp(float32, float32); float32 __aeabi_fdiv_vfp(float32, float32); float32 __aeabi_fmul_vfp(float32, float32); float32 __aeabi_fsub_vfp(float32, float32); /* * Depending on the target these will: * On armv6 with a vfp call the above function, or * Call the softfloat function in the 3rd argument. */ int AEABI_FUNC2(fcmpeq, float32, float32_eq) int AEABI_FUNC2(fcmplt, float32, float32_lt) int AEABI_FUNC2(fcmple, float32, float32_le) int AEABI_FUNC2_REV(fcmpge, float32, float32_le) int AEABI_FUNC2_REV(fcmpgt, float32, float32_lt) int AEABI_FUNC2(fcmpun, float32, __unordsf2) int AEABI_FUNC(f2iz, float32, float32_to_int32_round_to_zero) float64 AEABI_FUNC(f2d, float32, float32_to_float64) float32 AEABI_FUNC(i2f, int, int32_to_float32) float32 AEABI_FUNC2(fadd, float32, float32_add) float32 AEABI_FUNC2(fdiv, float32, float32_div) float32 AEABI_FUNC2(fmul, float32, float32_mul) float32 AEABI_FUNC2(fsub, float32, float32_sub) +int +__aeabi_cfcmpeq_helper(float32 a, float32 b) +{ + int quiet = 0; + + /* Check if a is a NaN */ + if ((a << 1) > 0xff000000u) { + /* If it's a signalling NaN we will always signal */ + if ((a & 0x00400000u) == 0) + return (0); + + quiet = 1; + } + + /* Check if b is a NaN */ + if ((b << 1) > 0xff000000u) { + /* If it's a signalling NaN we will always signal */ + if ((b & 0x00400000u) == 0) + return (0); + + quiet = 1; + } + + return (quiet); +} Index: stable/10/lib/libc/arm/aeabi/aeabi_vfp_double.S =================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_vfp_double.S (revision 273470) +++ stable/10/lib/libc/arm/aeabi/aeabi_vfp_double.S (revision 273471) @@ -1,170 +1,197 @@ /* * Copyright (C) 2013 Andrew Turner * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * * 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. * */ #include __FBSDID("$FreeBSD$"); #include "aeabi_vfp.h" .fpu vfp .syntax unified +/* void __aeabi_cdcmpeq(double, double) */ +AEABI_ENTRY(cdcmpeq) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + RET +AEABI_END(cdcmpeq) + +/* void __aeabi_cdcmple(double, double) */ +AEABI_ENTRY(cdcmple) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmpe.f64 d0, d1 + vmrs APSR_nzcv, fpscr + RET +AEABI_END(cdcmple) + +/* void __aeabi_cdrcmple(double, double) */ +AEABI_ENTRY(cdrcmple) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmpe.f64 d1, d0 + vmrs APSR_nzcv, fpscr + RET +AEABI_END(cdrcmple) + /* int __aeabi_dcmpeq(double, double) */ AEABI_ENTRY(dcmpeq) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vcmp.f64 d0, d1 vmrs APSR_nzcv, fpscr movne r0, #0 moveq r0, #1 RET AEABI_END(dcmpeq) /* int __aeabi_dcmplt(double, double) */ AEABI_ENTRY(dcmplt) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vcmp.f64 d0, d1 vmrs APSR_nzcv, fpscr movcs r0, #0 movlt r0, #1 RET AEABI_END(dcmplt) /* int __aeabi_dcmple(double, double) */ AEABI_ENTRY(dcmple) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vcmp.f64 d0, d1 vmrs APSR_nzcv, fpscr movhi r0, #0 movls r0, #1 RET AEABI_END(dcmple) /* int __aeabi_dcmpge(double, double) */ AEABI_ENTRY(dcmpge) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vcmp.f64 d0, d1 vmrs APSR_nzcv, fpscr movlt r0, #0 movge r0, #1 RET AEABI_END(dcmpge) /* int __aeabi_dcmpgt(double, double) */ AEABI_ENTRY(dcmpgt) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vcmp.f64 d0, d1 vmrs APSR_nzcv, fpscr movle r0, #0 movgt r0, #1 RET AEABI_END(dcmpgt) /* int __aeabi_dcmpun(double, double) */ AEABI_ENTRY(dcmpun) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vcmp.f64 d0, d1 vmrs APSR_nzcv, fpscr movvc r0, #0 movvs r0, #1 RET AEABI_END(dcmpun) /* int __aeabi_d2iz(double) */ AEABI_ENTRY(d2iz) LOAD_DREG(d0, r0, r1) #if 0 /* * This should be the correct instruction, but binutils incorrectly * encodes it as the version that used FPSCR to determine the rounding. * When binutils is fixed we can use this again. */ vcvt.s32.f64 s0, d0 #else ftosizd s0, d0 #endif vmov r0, s0 RET AEABI_END(d2iz) /* float __aeabi_d2f(double) */ AEABI_ENTRY(d2f) LOAD_DREG(d0, r0, r1) vcvt.f32.f64 s0, d0 UNLOAD_SREG(r0, s0) RET AEABI_END(d2f) /* double __aeabi_i2d(int) */ AEABI_ENTRY(i2d) vmov s0, r0 vcvt.f64.s32 d0, s0 UNLOAD_DREG(r0, r1, d0) RET AEABI_END(i2d) /* double __aeabi_dadd(double, double) */ AEABI_ENTRY(dadd) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vadd.f64 d0, d0, d1 UNLOAD_DREG(r0, r1, d0) RET AEABI_END(dadd) /* double __aeabi_ddiv(double, double) */ AEABI_ENTRY(ddiv) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vdiv.f64 d0, d0, d1 UNLOAD_DREG(r0, r1, d0) RET AEABI_END(ddiv) /* double __aeabi_dmul(double, double) */ AEABI_ENTRY(dmul) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vmul.f64 d0, d0, d1 UNLOAD_DREG(r0, r1, d0) RET AEABI_END(dmul) /* double __aeabi_dsub(double, double) */ AEABI_ENTRY(dsub) LOAD_DREG(d0, r0, r1) LOAD_DREG(d1, r2, r3) vsub.f64 d0, d0, d1 UNLOAD_DREG(r0, r1, d0) RET AEABI_END(dsub) Index: stable/10/lib/libc/arm/aeabi/aeabi_vfp_float.S =================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_vfp_float.S (revision 273470) +++ stable/10/lib/libc/arm/aeabi/aeabi_vfp_float.S (revision 273471) @@ -1,160 +1,184 @@ /* * Copyright (C) 2013 Andrew Turner * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * * 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. * */ #include __FBSDID("$FreeBSD$"); #include "aeabi_vfp.h" .fpu vfp .syntax unified +/* void __aeabi_cfcmpeq(float, float) */ +AEABI_ENTRY(cfcmpeq) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + RET +AEABI_END(cfcmpeq) + +/* void __aeabi_cfcmple(float, float) */ +AEABI_ENTRY(cfcmple) + LOAD_SREGS(s0, s1, r0, r1) + vcmpe.f32 s0, s1 + vmrs APSR_nzcv, fpscr + RET +AEABI_END(cfcmple) + +/* void __aeabi_cfrcmple(float, float) */ +AEABI_ENTRY(cfrcmple) + LOAD_SREGS(s0, s1, r0, r1) + vcmpe.f32 s1, s0 + vmrs APSR_nzcv, fpscr + RET +AEABI_END(cfrcmple) + /* int __aeabi_fcmpeq(float, float) */ AEABI_ENTRY(fcmpeq) LOAD_SREGS(s0, s1, r0, r1) vcmp.f32 s0, s1 vmrs APSR_nzcv, fpscr movne r0, #0 moveq r0, #1 RET AEABI_END(fcmpeq) /* int __aeabi_fcmplt(float, float) */ AEABI_ENTRY(fcmplt) LOAD_SREGS(s0, s1, r0, r1) vcmp.f32 s0, s1 vmrs APSR_nzcv, fpscr movcs r0, #0 movlt r0, #1 RET AEABI_END(fcmplt) /* int __aeabi_fcmple(float, float) */ AEABI_ENTRY(fcmple) LOAD_SREGS(s0, s1, r0, r1) vcmp.f32 s0, s1 vmrs APSR_nzcv, fpscr movhi r0, #0 movls r0, #1 RET AEABI_END(fcmple) /* int __aeabi_fcmpge(float, float) */ AEABI_ENTRY(fcmpge) LOAD_SREGS(s0, s1, r0, r1) vcmp.f32 s0, s1 vmrs APSR_nzcv, fpscr movlt r0, #0 movge r0, #1 RET AEABI_END(fcmpge) /* int __aeabi_fcmpgt(float, float) */ AEABI_ENTRY(fcmpgt) LOAD_SREGS(s0, s1, r0, r1) vcmp.f32 s0, s1 vmrs APSR_nzcv, fpscr movle r0, #0 movgt r0, #1 RET AEABI_END(fcmpgt) /* int __aeabi_fcmpun(float, float) */ AEABI_ENTRY(fcmpun) LOAD_SREGS(s0, s1, r0, r1) vcmp.f32 s0, s1 vmrs APSR_nzcv, fpscr movvc r0, #0 movvs r0, #1 RET AEABI_END(fcmpun) /* int __aeabi_f2iz(float) */ AEABI_ENTRY(f2iz) LOAD_SREG(s0, r0) #if 0 /* * This should be the correct instruction, but binutils incorrectly * encodes it as the version that used FPSCR to determine the rounding. * When binutils is fixed we can use this again. */ vcvt.s32.f32 s0, s0 #else ftosizs s0, s0 #endif vmov r0, s0 RET AEABI_END(f2iz) /* double __aeabi_f2d(float) */ AEABI_ENTRY(f2d) LOAD_SREG(s0, r0) vcvt.f64.f32 d0, s0 UNLOAD_DREG(r0, r1, d0) RET AEABI_END(f2d) /* float __aeabi_i2f(int) */ AEABI_ENTRY(i2f) vmov s0, r0 vcvt.f32.s32 s0, s0 UNLOAD_SREG(r0, s0) RET AEABI_END(i2f) /* float __aeabi_fadd(float, float) */ AEABI_ENTRY(fadd) LOAD_SREGS(s0, s1, r0, r1) vadd.f32 s0, s0, s1 UNLOAD_SREG(r0, s0) RET AEABI_END(fadd) /* float __aeabi_fmul(float, float) */ AEABI_ENTRY(fdiv) LOAD_SREGS(s0, s1, r0, r1) vdiv.f32 s0, s0, s1 UNLOAD_SREG(r0, s0) RET AEABI_END(fdiv) /* float __aeabi_fmul(float, float) */ AEABI_ENTRY(fmul) LOAD_SREGS(s0, s1, r0, r1) vmul.f32 s0, s0, s1 UNLOAD_SREG(r0, s0) RET AEABI_END(fmul) /* float __aeabi_fsub(float, float) */ AEABI_ENTRY(fsub) LOAD_SREGS(s0, s1, r0, r1) vsub.f32 s0, s0, s1 UNLOAD_SREG(r0, s0) RET AEABI_END(fsub) Index: stable/10 =================================================================== --- stable/10 (revision 273470) +++ stable/10 (revision 273471) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r273088