[commit: ghc] master: Improve LLVM options for ARMv6 (48a96bd)

Simon Marlow marlowsd at gmail.com
Fri Jan 25 23:20:26 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/48a96bdbec81d9db527b6b4ad637a630508f3561

>---------------------------------------------------------------

commit 48a96bdbec81d9db527b6b4ad637a630508f3561
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Fri Jan 25 20:50:00 2013 +0000

    Improve LLVM options for ARMv6
    
    - -float-abi=hard also works for arm v6
    - pass -mattr=+vfp2 if we have VFP2
    
    Submitted by: Karel Gardas <karel.gardas at centrum.cz>

>---------------------------------------------------------------

 compiler/main/DriverPipeline.hs |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index c24bb51..81d0bc0 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1454,14 +1454,17 @@ runPhase LlvmLlc input_fn dflags
                                       else if (elem VFPv3D16 ext)
                                            then ["-mattr=+v7,+vfp3,+d16"]
                                            else []
+                   ArchARM ARMv6 ext _ -> if (elem VFPv2 ext)
+                                          then ["-mattr=+v6,+vfp2"]
+                                          else ["-mattr=+v6"]
                    _                 -> []
         -- On Ubuntu/Debian with ARM hard float ABI, LLVM's llc still
         -- compiles into soft-float ABI. We need to explicitly set abi
         -- to hard
         abiOpts = case platformArch (targetPlatform dflags) of
-                    ArchARM ARMv7 _ HARD -> ["-float-abi=hard"]
-                    ArchARM ARMv7 _ _    -> []
-                    _                    -> []
+                    ArchARM _ _ HARD -> ["-float-abi=hard"]
+                    ArchARM _ _ _    -> []
+                    _                -> []
 
         sseOpts | isSse4_2Enabled dflags = ["-mattr=+sse42"]
                 | isSse2Enabled dflags   = ["-mattr=+sse2"]





More information about the ghc-commits mailing list