[PATCH] D39631: [X86] Add 3dnow and 3dnowa to the list of valid target features

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 4 13:06:52 PDT 2017


mstorsjo created this revision.

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


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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39631.121598.patch
Type: text/x-patch
Size: 991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171104/b835b19f/attachment.bin>


More information about the cfe-commits mailing list