grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

arm64 softfloat


From: Leif Lindholm
Subject: arm64 softfloat
Date: Tue, 2 Jun 2015 13:09:17 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

As I mentioned yeaterday, I ran into some toolchain issues yesterday.
When attempting my first build on Fedora 22, which uses GCC5.1, the
build fails. First with an internal compiler error, and with a
workaround for that, it simply refuses to go past.

Basically, AArch64 (arm64) does not define a soft-float ABI. Recent
versions of GCC now (presumably correctly) bails out when encountering
floating-point if +nofp has been specified in -march flags. Also, the
UEFI specification mandates that for aarch64 the cpu is configured
such that floating-point exceptions are not generated - so it should
be safe to generate floating-point instructions.

So would it be possible to do something like the below?:

>From a1821c9222bab447b2d3faccf69e518c65e0f638 Mon Sep 17 00:00:00 2001
From: Leif Lindholm <address@hidden>
Date: Mon, 1 Jun 2015 23:58:44 +0100
Subject: [PATCH] arm64: do not force-enable soft-float

AArch64 (arm64) does not define a soft-float ABI. GCC5.1 now (presumably
correctly) bails out when encountering floating-point if +nofp has been
specified in -march flags. Also, the UEFI specification mandates that
the cpu is configured such that floating-point exceptions are not
generated - so it should be safe to generate floating-point instructions.

So drop +nofp and +nosimd from configure.ac for arm64.

Signed-off-by: Leif Lindholm <address@hidden>
---
 configure.ac | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 891c14f..0a6d2e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -686,9 +686,8 @@ if test x"$platform" != xemu ; then
   AC_CACHE_CHECK([for options to get soft-float], 
grub_cv_target_cc_soft_float, [
     grub_cv_target_cc_soft_float=no
     if test "x$target_cpu" = xarm64; then
-       CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd -Werror"
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
-                        
[grub_cv_target_cc_soft_float="-march=armv8-a+nofp+nosimd"], [])
+       CFLAGS="$TARGET_CFLAGS -Werror"
+       grub_cv_target_cc_soft_float=""
     fi
     if test "x$target_cpu" = xia64; then
        CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt 
-Werror"
@@ -720,15 +719,7 @@ if test x"$platform" != xemu ; then
       TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_soft_float"
       ;;
   esac
-  case x"$grub_cv_target_cc_soft_float" in
-    x"-march=armv8-a+nofp+nosimd")
-      # +nosimd disables also the cache opcodes that we need in asm.
-      TARGET_CCASFLAGS="$TARGET_CCASFLAGS -march=armv8-a+nofp"
-      ;;
-    *)
-      TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float"
-      ;;
-  esac
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float"
 
 fi
 
-- 
2.1.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]