Improve LLVM options for ARMv6
authorSimon Marlow <marlowsd@gmail.com>
Fri, 25 Jan 2013 20:50:00 +0000 (20:50 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 25 Jan 2013 20:54:58 +0000 (20:54 +0000)
- -float-abi=hard also works for arm v6
- pass -mattr=+vfp2 if we have VFP2

Submitted by: Karel Gardas <karel.gardas@centrum.cz>

compiler/main/DriverPipeline.hs

index c24bb51..81d0bc0 100644 (file)
@@ -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"]