[PATCH] D40256: [ARM] disable FPU features when using soft floating point.

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 14:04:44 PST 2017


efriedma added a comment.

Oh, I see, for some silly reason there are actually *three* -mfloat-abi options: hard, soft, and softfp.  hard means float instructions and a hard-float calling convention, soft means no floating-point and a soft-float convention, and softfp means float instructions and a soft-float convention.  This is probably worth clarifying with a comment.



================
Comment at: lib/Driver/ToolChains/Arch/ARM.cpp:406
+    const bool HasVFPv4  = (std::find(ItBegin, ItEnd, "+vfpv4") != ItEnd);
+    const bool HasFParmv8  = (std::find(ItBegin, ItEnd, "+fp-armv8") != ItEnd);
+    const bool HasFullFP16  = (std::find(ItBegin, ItEnd, "+fullfp16") != ItEnd);
----------------
I don't like explicitly enumerating the features like this; it'll mess up if there's ever a new feature which isn't explicitly enumerated here.  Can we just do `Features.push_back("-vfpv2")` and depend on that to implicitly disable all the other vfp features?


https://reviews.llvm.org/D40256





More information about the cfe-commits mailing list