r199896 - MachO embedded: default to soft float without issuing warning

Jim Grosbach grosbach at apple.com
Thu Jan 23 09:56:22 PST 2014


cortex-m4 (armv7em) should still default to hard-float. Does this change that?

-Jim

On Jan 23, 2014, at 7:00 AM, Tim Northover <tnorthover at apple.com> wrote:

> Author: tnorthover
> Date: Thu Jan 23 09:00:01 2014
> New Revision: 199896
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=199896&view=rev
> Log:
> MachO embedded: default to soft float without issuing warning
> 
> This is a simpler rule, broadly in line with previous Darwin (which chose
> between "soft" and "softfp") but probably safer. In practice the only real
> reason for "softfp" is ABI compatibility, not usually an issue on limited chips
> like these, so anyone who wanted hard-float should already be saying so.
> 
> That's my story and I'm sticking to it.
> 
> rdar://problem/15887493
> 
> Modified:
>    cfe/trunk/lib/Driver/Tools.cpp
>    cfe/trunk/test/Driver/darwin-embedded.c
> 
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=199896&r1=199895&r2=199896&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Thu Jan 23 09:00:01 2014
> @@ -662,6 +662,10 @@ StringRef tools::arm::getARMFloatABI(con
>         // EABI is always AAPCS, and if it was not marked 'hard', it's softfp
>         FloatABI = "softfp";
>         break;
> +      case llvm::Triple::MachO: {
> +        FloatABI = "soft";
> +        break;
> +      }
>       case llvm::Triple::Android: {
>         std::string ArchName =
>           arm::getLLVMArchSuffixForARM(arm::getARMTargetCPU(Args, Triple));
> 
> Modified: cfe/trunk/test/Driver/darwin-embedded.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-embedded.c?rev=199896&r1=199895&r2=199896&view=diff
> ==============================================================================
> --- cfe/trunk/test/Driver/darwin-embedded.c (original)
> +++ cfe/trunk/test/Driver/darwin-embedded.c Thu Jan 23 09:00:01 2014
> @@ -12,24 +12,49 @@
> // RUN: FileCheck %s < %t
> 
> // ARMv6m has no float
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "soft"
> // CHECK: libclang_rt.soft_static.a
> 
> // ARMv7em does, but defaults to soft
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "soft"
> // CHECK: libclang_rt.soft_static.a
> 
> // Which can be overridden
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "hard"
> // CHECK: libclang_rt.hard_static.a
> 
> // ARMv7m has no float either
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "soft"
> // CHECK: libclang_rt.soft_pic.a
> 
> // But it can be enabled on ARMv7em
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "hard"
> // CHECK: libclang_rt.hard_pic.a
> 
> // "softfp" must link against a soft-float library since that's what the
> // callers we're compiling will expect.
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "soft"
> // CHECK: libclang_rt.soft_pic.a
> 
> // -arch "armv7" (== embedded v7a) can be used in a couple of variants:
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "hard"
> // CHECK: libclang_rt.hard_static.a
> +
> +// CHECK-LABEL: Target:
> +// CHECK-NOT: warning: unknown platform
> +// CHECK: "-mfloat-abi" "soft"
> // CHECK: libclang_rt.soft_pic.a
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list