r200233 - Cortex-M3 and Cortex-M4 should not enable hwdiv-arm

Reid Kleckner rnk at google.com
Mon Jan 27 11:32:11 PST 2014


A couple things wrong here:
1. This test fails if ARM is not a registered target (add "// REQUIRES:
arm-registered-target" to fix)
2. Clang tests shouldn't test generated assembly, that's what LLVM tests
are for
3. Driver tests shouldn't do IR generation, which this test does

I'm reverting this in r200242 for now, but feel free to recommit a test in
test/CodeGen that verifies you get the right attribute bits in the IR, if
that's how this gets passed down to LLVM.


On Mon, Jan 27, 2014 at 10:44 AM, Artyom Skrobov <Artyom.Skrobov at arm.com>wrote:

> Author: askrobov
> Date: Mon Jan 27 12:44:25 2014
> New Revision: 200233
>
> URL: http://llvm.org/viewvc/llvm-project?rev=200233&view=rev
> Log:
> Cortex-M3 and Cortex-M4 should not enable hwdiv-arm
>
> Modified:
>     cfe/trunk/lib/Basic/Targets.cpp
>     cfe/trunk/test/Driver/arm-cortex-cpus.c
>
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=200233&r1=200232&r2=200233&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Mon Jan 27 12:44:25 2014
> @@ -3832,14 +3832,15 @@ public:
>        Features["hwdiv"] = true;
>        Features["hwdiv-arm"] = true;
>        Features["crc"] = true;
> -    } else if (CPU == "cortex-r5" || CPU == "cortex-m3" ||
> -               CPU == "cortex-m4" ||
> +    } else if (CPU == "cortex-r5" ||
>                 // Enable the hwdiv extension for all v8a AArch32 cores by
>                 // default.
>                 ArchName == "armv8a" || ArchName == "armv8" ||
>                 ArchName == "thumbv8a" || ArchName == "thumbv8") {
>        Features["hwdiv"] = true;
>        Features["hwdiv-arm"] = true;
> +    } else if (CPU == "cortex-m3" || CPU == "cortex-m4") {
> +      Features["hwdiv"] = true;
>      }
>    }
>
>
> Modified: cfe/trunk/test/Driver/arm-cortex-cpus.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-cortex-cpus.c?rev=200233&r1=200232&r2=200233&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Driver/arm-cortex-cpus.c (original)
> +++ cfe/trunk/test/Driver/arm-cortex-cpus.c Mon Jan 27 12:44:25 2014
> @@ -158,3 +158,9 @@
>  // RUN: %clang -target arm -mcpu=cortex-a53 -mthumb -### -c %s 2>&1 |
> FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
>  // RUN: %clang -target arm -mcpu=cortex-a57 -mthumb -### -c %s 2>&1 |
> FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
>  // CHECK-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8-{{.*}}
> +
> +// ================== Check that Cortex-M cores don't enable hwdiv-arm
> (and don't emit Tag_DIV_use)
> +// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m3 -S %s -o - |
> FileCheck -check-prefix=CHECK-HWDIV-ARM %s
> +// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -S %s -o - |
> FileCheck -check-prefix=CHECK-HWDIV-ARM %s
> +// CHECK-HWDIV-ARM-NOT: .eabi_attribute        44
> +
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140127/cfc02153/attachment.html>


More information about the cfe-commits mailing list