[clang] f1cbea3 - [RISCV] Remove Zvamo implication for v1.0-rc change

ShihPo Hung via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 6 09:15:12 PDT 2021


Author: ShihPo Hung
Date: 2021-07-07T00:14:58+08:00
New Revision: f1cbea3e527547fc08c55235c11970a8d9f2637e

URL: https://github.com/llvm/llvm-project/commit/f1cbea3e527547fc08c55235c11970a8d9f2637e
DIFF: https://github.com/llvm/llvm-project/commit/f1cbea3e527547fc08c55235c11970a8d9f2637e.diff

LOG: [RISCV] Remove Zvamo implication for v1.0-rc change

As v1.0-rc specs say Zvamo is removed from standard extension,
Zvamo has to be specified explicitly.

Reviewed By: evandro

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

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Arch/RISCV.cpp
    clang/test/Preprocessor/riscv-target-features.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index f131d5321070c..ade93d6881a7a 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -258,10 +258,13 @@ static void getExtensionFeatures(const Driver &D,
         << MArch << Error << Ext;
       return;
     }
-    if (Ext == "zvamo" || Ext == "zvlsseg") {
+    if (Ext == "zvlsseg") {
+      Features.push_back("+experimental-v");
+      Features.push_back("+experimental-zvlsseg");
+    } else if (Ext == "zvamo") {
       Features.push_back("+experimental-v");
-      Features.push_back("+experimental-zvamo");
       Features.push_back("+experimental-zvlsseg");
+      Features.push_back("+experimental-zvamo");
     } else if (isExperimentalExtension(Ext))
       Features.push_back(Args.MakeArgString("+experimental-" + Ext));
     else
@@ -429,7 +432,6 @@ static bool getArchFeatures(const Driver &D, StringRef MArch,
       break;
     case 'v':
       Features.push_back("+experimental-v");
-      Features.push_back("+experimental-zvamo");
       Features.push_back("+experimental-zvlsseg");
       break;
     }

diff  --git a/clang/test/Preprocessor/riscv-target-features.c b/clang/test/Preprocessor/riscv-target-features.c
index da9b15b88a4c4..ea5754a83f1ea 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -225,12 +225,6 @@
 // RUN: -march=rv64iv0p10 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
 // RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
-// RUN: -march=rv32izvamo0p10 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
-// RUN: %clang -target riscv64-unknown-linux-gnu -menable-experimental-extensions \
-// RUN: -march=rv32izvamo0p10 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
-// RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
 // RUN: -march=rv32izvlsseg0p10 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
 // RUN: %clang -target riscv64-unknown-linux-gnu -menable-experimental-extensions \
@@ -238,9 +232,19 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
 // CHECK-V-EXT: __riscv_v 10000
 // CHECK-V-EXT: __riscv_vector 1
-// CHECK-V-EXT: __riscv_zvamo 10000
 // CHECK-V-EXT: __riscv_zvlsseg 10000
 
+// RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
+// RUN: -march=rv32izvamo0p10 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZVAMO-EXT %s
+// RUN: %clang -target riscv64-unknown-linux-gnu -menable-experimental-extensions \
+// RUN: -march=rv32izvamo0p10 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZVAMO-EXT %s
+// CHECK-ZVAMO-EXT: __riscv_v 10000
+// CHECK-ZVAMO-EXT: __riscv_vector 1
+// CHECK-ZVAMO-EXT: __riscv_zvamo 10000
+// CHECK-ZVAMO-EXT: __riscv_zvlsseg 10000
+
 // RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
 // RUN: -march=rv32izfh0p1 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZFH-EXT %s


        


More information about the cfe-commits mailing list