[cfe-dev] Questions about specifying VFP4 in clang for ARM

Eli Friedman eli.friedman at gmail.com
Mon Sep 24 15:57:45 PDT 2012


On Mon, Sep 24, 2012 at 12:11 PM, Weiming Zhao <weimingz at codeaurora.org> wrote:
> Hi,
>
>
>
> I’m able to use vfp4 via llc:   “-mattr=+neon,+vfp4 –fp-contract=fast” to
> generate fused multiply-add (vfma)
>
>
>
> However, with clang driver, I tried –mfpu=vfp4, but it returns:
>
> clang: error: the clang compiler does not support '-mfpu=vfp4'
>
>
>
> Then, I added the following code  in lib/Driver/Tools.cpp, addFPUArgs():
>
>>
> else if (FPU == "vfp4" || FPU == "vfpv4") {
>
>     CmdArgs.push_back("-target-feature");
>
>     CmdArgs.push_back("+vfp4");
>
>     CmdArgs.push_back("-target-feature");
>
>     CmdArgs.push_back("+neon");
>
> ..
>
>
>
> I also updated lib/Basic/Targets.cpp::setFeatureEanbled()
>
> if (Name == "soft-float" || Name == "soft-float-abi" ||
>
>         Name == "vfp2" || Name == "vfp3" || Name == "neon" || Name == "d16"
> ||
>
>         Name == "neonfp" || Name == "vfp4") {
>
>       Features[Name] = Enabled;
>
>
>
> But still no luck. It doesn’t even fold the mul/add to vmla instructions.

I see a pretty obvious hole in your reasoning: you didn't specify
anything to make clang default to –fp-contract=fast.  Am I missing
something?

-Eli




More information about the cfe-dev mailing list