[PATCH] D39631: [X86] Fix the spelling of 3dnow and 3dnowa in isValidFeatureName
Martin Storsjö via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 5 03:32:21 PST 2017
mstorsjo updated this revision to Diff 121623.
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.
mstorsjo added a comment.
Updated based on Craig's comments.
https://reviews.llvm.org/D39631
Files:
lib/Basic/Targets/X86.cpp
test/Headers/mm3dnow.c
Index: test/Headers/mm3dnow.c
===================================================================
--- /dev/null
+++ test/Headers/mm3dnow.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding %s -verify
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s -verify
+// expected-no-diagnostics
+
+#if defined(i386) || defined(__x86_64__)
+#include <mm3dnow.h>
+
+int __attribute__((__target__(("3dnow")))) foo(int a) {
+ _m_femms();
+ return 4;
+}
+
+__m64 __attribute__((__target__(("3dnowa")))) bar(__m64 a) {
+ return _m_pf2iw(a);
+}
+#endif
Index: lib/Basic/Targets/X86.cpp
===================================================================
--- lib/Basic/Targets/X86.cpp
+++ lib/Basic/Targets/X86.cpp
@@ -1121,6 +1121,8 @@
bool X86TargetInfo::isValidFeatureName(StringRef Name) const {
return llvm::StringSwitch<bool>(Name)
+ .Case("3dnow", true)
+ .Case("3dnowa", true)
.Case("aes", true)
.Case("avx", true)
.Case("avx2", true)
@@ -1147,8 +1149,6 @@
.Case("fxsr", true)
.Case("lwp", true)
.Case("lzcnt", true)
- .Case("mm3dnow", true)
- .Case("mm3dnowa", true)
.Case("mmx", true)
.Case("movbe", true)
.Case("mpx", true)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39631.121623.patch
Type: text/x-patch
Size: 1235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171105/9582bf8e/attachment-0001.bin>
More information about the cfe-commits
mailing list