diff options
author | Thomas Preud'homme <thomas.preudhomme@arm.com> | 2015-12-09 06:00:55 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-12-09 12:30:31 +0300 |
commit | 5b9873fa7236daa522c59c2c40f85938098acfe7 (patch) | |
tree | 8689354e0921c1522de203b9520a9ca52bbb426d /newlib | |
parent | 91a8eacec6575a3a2c6aa4c4cf26961870f6074a (diff) |
Check for 64 FP instructions availability in libm before using them
Currently, double precision math functions in newlib/libm/machine/arm detect whether neon instructions can be used for double precision computation by checking the architecture version (>= 8) and the availability of floating-point instructions. However, these instructions would not be available if targeting fpv5-sp-d16 as the FPU, which by definition does not have 64bit float instructions. This patch adds a check that __ARM_FP advertises 64bit float instructions.
* libm/machine/arm/s_ceil.c: Also check that 64bit FP instructions are
available in the guard.
* libm/machine/arm/s_floor.c: Likewise.
* libm/machine/arm/s_nearbyint.c: Likewise.
* libm/machine/arm/s_rint.c: Likewise.
* libm/machine/arm/s_round.c: Likewise.
* libm/machine/arm/s_trunc.c: Likewise.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 10 | ||||
-rw-r--r-- | newlib/libm/machine/arm/s_ceil.c | 2 | ||||
-rw-r--r-- | newlib/libm/machine/arm/s_floor.c | 2 | ||||
-rw-r--r-- | newlib/libm/machine/arm/s_nearbyint.c | 2 | ||||
-rw-r--r-- | newlib/libm/machine/arm/s_rint.c | 2 | ||||
-rw-r--r-- | newlib/libm/machine/arm/s_round.c | 2 | ||||
-rw-r--r-- | newlib/libm/machine/arm/s_trunc.c | 2 |
7 files changed, 16 insertions, 6 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index de5c84b21..1524b9923 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,13 @@ +2015-12-09 Thomas Preud'homme <thomas.preudhomme@arm.com> + + * libm/machine/arm/s_ceil.c: Also check that 64bit FP instructions are + available in the guard. + * libm/machine/arm/s_floor.c: Likewise. + * libm/machine/arm/s_nearbyint.c: Likewise. + * libm/machine/arm/s_rint.c: Likewise. + * libm/machine/arm/s_round.c: Likewise. + * libm/machine/arm/s_trunc.c: Likewise. + 2015-12-08 Corinna Vinschen <corinna@vinschen.de> * libc/stdio/fclose.c (_fclose_r): Make _flockfile/_funlockfile calls diff --git a/newlib/libm/machine/arm/s_ceil.c b/newlib/libm/machine/arm/s_ceil.c index ceb5bbfb0..ed1e85a3c 100644 --- a/newlib/libm/machine/arm/s_ceil.c +++ b/newlib/libm/machine/arm/s_ceil.c @@ -24,7 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) +#if __ARM_ARCH >= 8 && (__ARM_FP & 0x8) && !defined (__SOFTFP__) #include <math.h> double diff --git a/newlib/libm/machine/arm/s_floor.c b/newlib/libm/machine/arm/s_floor.c index 50019819c..d25132f0d 100644 --- a/newlib/libm/machine/arm/s_floor.c +++ b/newlib/libm/machine/arm/s_floor.c @@ -24,7 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) +#if __ARM_ARCH >= 8 && (__ARM_FP & 0x8) && !defined (__SOFTFP__) #include <math.h> double diff --git a/newlib/libm/machine/arm/s_nearbyint.c b/newlib/libm/machine/arm/s_nearbyint.c index c3b50dc7b..7ead69b12 100644 --- a/newlib/libm/machine/arm/s_nearbyint.c +++ b/newlib/libm/machine/arm/s_nearbyint.c @@ -24,7 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) +#if __ARM_ARCH >= 8 && (__ARM_FP & 0x8) && !defined (__SOFTFP__) #include <math.h> double diff --git a/newlib/libm/machine/arm/s_rint.c b/newlib/libm/machine/arm/s_rint.c index 9050424a7..02c102250 100644 --- a/newlib/libm/machine/arm/s_rint.c +++ b/newlib/libm/machine/arm/s_rint.c @@ -24,7 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) +#if __ARM_ARCH >= 8 && (__ARM_FP & 0x8) && !defined (__SOFTFP__) #include <math.h> double diff --git a/newlib/libm/machine/arm/s_round.c b/newlib/libm/machine/arm/s_round.c index 97f0296c6..a8f246602 100644 --- a/newlib/libm/machine/arm/s_round.c +++ b/newlib/libm/machine/arm/s_round.c @@ -24,7 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) +#if __ARM_ARCH >= 8 && (__ARM_FP & 0x8) && !defined (__SOFTFP__) #include <math.h> double diff --git a/newlib/libm/machine/arm/s_trunc.c b/newlib/libm/machine/arm/s_trunc.c index 2f38a3574..6fb696814 100644 --- a/newlib/libm/machine/arm/s_trunc.c +++ b/newlib/libm/machine/arm/s_trunc.c @@ -24,7 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) +#if __ARM_ARCH >= 8 && (__ARM_FP & 0x8) && !defined (__SOFTFP__) #include <math.h> double |