aeabi_double.c (245655) | aeabi_double.c (263239) |
---|---|
1/* 2 * Copyright (C) 2012 Andrew Turner 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> | 1/* 2 * Copyright (C) 2012 Andrew Turner 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/lib/libc/arm/aeabi/aeabi_double.c 245655 2013-01-19 05:33:55Z andrew $"); | 29__FBSDID("$FreeBSD: head/lib/libc/arm/aeabi/aeabi_double.c 263239 2014-03-16 13:16:30Z andrew $"); |
30 31#include "softfloat-for-gcc.h" 32#include "milieu.h" 33#include "softfloat.h" 34 | 30 31#include "softfloat-for-gcc.h" 32#include "milieu.h" 33#include "softfloat.h" 34 |
35flag __unorddf2(float64, float64); | 35#include "aeabi_vfp.h" |
36 | 36 |
37int __aeabi_dcmpeq(float64 a, float64 b) 38{ 39 return float64_eq(a, b); 40} | 37extern int _libc_arm_fpu_present; |
41 | 38 |
42int __aeabi_dcmplt(float64 a, float64 b) 43{ 44 return float64_lt(a, b); 45} | 39flag __unorddf2(float64, float64); |
46 | 40 |
47int __aeabi_dcmple(float64 a, float64 b) 48{ 49 return float64_le(a, b); 50} | 41/* These are written in asm and are only called from this file */ 42int __aeabi_dcmpeq_vfp(float64, float64); 43int __aeabi_dcmplt_vfp(float64, float64); 44int __aeabi_dcmple_vfp(float64, float64); 45int __aeabi_dcmpgt_vfp(float64, float64); 46int __aeabi_dcmpge_vfp(float64, float64); 47int __aeabi_dcmpun_vfp(float64, float64); 48int __aeabi_d2iz_vfp(float64); 49float32 __aeabi_d2f_vfp(float64); 50float64 __aeabi_i2d_vfp(int); 51float64 __aeabi_dadd_vfp(float64, float64); 52float64 __aeabi_ddiv_vfp(float64, float64); 53float64 __aeabi_dmul_vfp(float64, float64); 54float64 __aeabi_dsub_vfp(float64, float64); |
51 | 55 |
52int __aeabi_dcmpge(float64 a, float64 b) 53{ 54 return float64_le(b, a); 55} | 56/* 57 * Depending on the target these will: 58 * On armv6 with a vfp call the above function, or 59 * Call the softfloat cunstion in the 3rd argument. 60 */ 61int AEABI_FUNC2(dcmpeq, float64, float64_eq) 62int AEABI_FUNC2(dcmplt, float64, float64_lt) 63int AEABI_FUNC2(dcmple, float64, float64_le) 64int AEABI_FUNC2_REV(dcmpge, float64, float64_le) 65int AEABI_FUNC2_REV(dcmpgt, float64, float64_lt) 66int AEABI_FUNC2(dcmpun, float64, __unorddf2) |
56 | 67 |
57int __aeabi_dcmpgt(float64 a, float64 b) 58{ 59 return float64_lt(b, a); 60} | 68int AEABI_FUNC(d2iz, float64, float64_to_int32_round_to_zero) 69float32 AEABI_FUNC(d2f, float64, float64_to_float32) 70float64 AEABI_FUNC(i2d, int, int32_to_float64) |
61 | 71 |
62int __aeabi_dcmpun(float64 a, float64 b) 63{ 64 return __unorddf2(a, b); 65} | 72float64 AEABI_FUNC2(dadd, float64, float64_add) 73float64 AEABI_FUNC2(ddiv, float64, float64_div) 74float64 AEABI_FUNC2(dmul, float64, float64_mul) 75float64 AEABI_FUNC2(dsub, float64, float64_sub) |
66 | 76 |
67int __aeabi_d2iz(float64 a) 68{ 69 return float64_to_int32_round_to_zero(a); 70} 71 72float32 __aeabi_d2f(float64 a) 73{ 74 return float64_to_float32(a); 75} 76 77float64 __aeabi_i2d(int a) 78{ 79 return int32_to_float64(a); 80} 81 82float64 __aeabi_dadd(float64 a, float64 b) 83{ 84 return float64_add(a, b); 85} 86 87float64 __aeabi_ddiv(float64 a, float64 b) 88{ 89 return float64_div(a, b); 90} 91 92float64 __aeabi_dmul(float64 a, float64 b) 93{ 94 return float64_mul(a, b); 95} 96 97float64 __aeabi_dsub(float64 a, float64 b) 98{ 99 return float64_sub(a, b); 100} 101 | |