[PATCH] D15746: Normalize the features string in SubtargetFeatures::getFeatureBits

A. Skrobov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 07:17:55 PST 2015


tyomitch created this revision.
tyomitch added reviewers: mkuper, john.brawn, echristo.
tyomitch added a subscriber: llvm-commits.
Herald added a subscriber: aemerson.

Currently, specifying a feature string such as `+fullfp16,-fp-armv8,+fp-armv8,+neon`
leads to `fullfp16` being disabled (transitively by `-fp-armv8`, and not re-enabled
by `+fp-armv8`).

It would be far more natural to make `+fullfp16,-fp-armv8,+fp-armv8,+neon`
equivalent to `+fullfp16,+neon`, matching the intuitive arithmetic and/or set-theory rules.

Note that this still doesn't make feature strings commutative:
e.g. `+fullfp16,+fp-armv8,-fp-armv8,+neon` would still disable `fullfp16`.

While there, this patch also changes SubtargetFeatures::ToggleFeature and
SubtargetFeatures::ApplyFeatureFlag to be static, so that MCSubtargetInfo
doesn't need to instantiate SubtargetFeatures for nothing.

http://reviews.llvm.org/D15746

Files:
  include/llvm/MC/SubtargetFeature.h
  lib/MC/MCSubtargetInfo.cpp
  lib/MC/SubtargetFeature.cpp
  test/MC/ARM/fullfp16-neon.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15746.43536.patch
Type: text/x-patch
Size: 5020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151223/519f0fb9/attachment.bin>


More information about the llvm-commits mailing list