[Myriad] Define __ma2x5x and __ma2x8x
authorWalter Lee <waltl@google.com>
Tue, 6 Feb 2018 22:39:47 +0000 (22:39 +0000)
committerWalter Lee <waltl@google.com>
Tue, 6 Feb 2018 22:39:47 +0000 (22:39 +0000)
Summary: Add architecture defines for ma2x5x and ma2x8x.

Reviewers: jyknight

Subscribers: fedor.sergeev, MartinO

Differential Revision: https://reviews.llvm.org/D42882

llvm-svn: 324420

clang/lib/Basic/Targets/Sparc.cpp
clang/test/Preprocessor/predefined-arch-macros.c

index 429c1ee3a23c581a06abfd95b920c3a9cff9952b..ed28bf2d435c650ade06d46ab2186396f619f585 100644 (file)
@@ -178,6 +178,13 @@ void SparcV8TargetInfo::getTargetDefines(const LangOptions &Opts,
       Builder.defineMacro(MyriadArchValue, "1");
       Builder.defineMacro(MyriadArchValue + "__", "1");
     }
+    if (Myriad2Value == "2") {
+      Builder.defineMacro("__ma2x5x", "1");
+      Builder.defineMacro("__ma2x5x__", "1");
+    } else if (Myriad2Value == "3") {
+      Builder.defineMacro("__ma2x8x", "1");
+      Builder.defineMacro("__ma2x8x__", "1");
+    }
     Builder.defineMacro("__myriad2__", Myriad2Value);
     Builder.defineMacro("__myriad2", Myriad2Value);
   }
index ef0c022ac0e274584f0b1dc0dbb363ec34226362..ba3cb44b697b7b480f2f72b19e0df01dd616a91e 100644 (file)
 // CHECK_MYRIAD2: #define __leon__ 1
 // CHECK_MYRIAD2-1: #define __myriad2 1
 // CHECK_MYRIAD2-1: #define __myriad2__ 1
+// CHECK_MYRIAD2-2: #define __ma2x5x 1
+// CHECK_MYRIAD2-2: #define __ma2x5x__ 1
 // CHECK_MYRIAD2-2: #define __myriad2 2
 // CHECK_MYRIAD2-2: #define __myriad2__ 2
+// CHECK_MYRIAD2-3: #define __ma2x8x 1
+// CHECK_MYRIAD2-3: #define __ma2x8x__ 1
 // CHECK_MYRIAD2-3: #define __myriad2 3
 // CHECK_MYRIAD2-3: #define __myriad2__ 3
 // CHECK_SPARCEL: #define __sparc 1