This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix the spelling of 3dnow and 3dnowa in isValidFeatureName
ClosedPublic

Authored by mstorsjo on Nov 4 2017, 1:06 PM.

Details

Summary

These were missed in SVN r316783, which broke compiling mingw-w64 CRT.

isValidFeatureName should use the same spellings as used in initFeatureMap, not the ones used in hasFeature.

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 4 2017, 1:06 PM
This revision is now accepted and ready to land.Nov 4 2017, 2:58 PM
craig.topper requested changes to this revision.Nov 4 2017, 3:05 PM

Can we just add -Werror to test/CodeGen/3dnow-builtins.c to test this? I believe it should be throwing a warning currently.

Can we also remove mm3dnow and mm3dnowa from the isValidFeatureName?

This revision now requires changes to proceed.Nov 4 2017, 3:05 PM

Can we just add -Werror to test/CodeGen/3dnow-builtins.c to test this?

That file actually already has got -Werror

I believe it should be throwing a warning currently.

It doesn't. That test enables the feature via -target-feature +3dnowa on the command line, which is accepted even if it isn't matched in isValidFeatureName, and the header declaration doesn't trigger any warnings.

Can we also remove mm3dnow and mm3dnowa from the isValidFeatureName?

The clang tests seem to pass with that removed at least (and nothing in mingw-w64 seems to refer to it in that form so it should probably be fine) - I can update the patch (and retest building mingw-w64) with that change if you want it squashed.

Ok then we can keep the new test.

I believe the isValidFeature list was copied from the list in hasFeature. But isValidFeature should match the names used by initFeatureMap since that's what we use to look them up.

mstorsjo updated this revision to Diff 121623.Nov 5 2017, 3:32 AM
mstorsjo edited edge metadata.
mstorsjo retitled this revision from [X86] Add 3dnow and 3dnowa to the list of valid target features to [X86] Fix the spelling of 3dnow and 3dnowa in isValidFeatureName.
mstorsjo edited the summary of this revision. (Show Details)

Updated based on Craig's comments.

This revision is now accepted and ready to land.Nov 6 2017, 10:38 AM
This revision was automatically updated to reflect the committed changes.