Author: AdityaK
Date: 2023-07-17T16:16:13-07:00
New Revision: f7623f4f692d10ef0f764876d670968cba3c9981

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

LOG: Enable zba and zbs for RISCV64 Android

Reviewers: enh, pirama, srhines, asb

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp 
b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index 1c342d5765bfbc..17e1aab961e5a8 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -294,7 +294,7 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList 
&Args,
       return "rv32imafdc";
     else if (MABI.starts_with_insensitive("lp64")) {
       if (Triple.isAndroid())
-        return "rv64imafdc_zbb";
+        return "rv64imafdc_zba_zbb_zbs";
 
       return "rv64imafdc";
     }
@@ -314,7 +314,7 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList 
&Args,
     if (Triple.getOS() == llvm::Triple::UnknownOS)
       return "rv64imac";
     else if (Triple.isAndroid())
-      return "rv64imafdc_zbb";
+      return "rv64imafdc_zba_zbb_zbs";
     else
       return "rv64imafdc";
   }

diff  --git a/clang/test/Driver/riscv-features.c 
b/clang/test/Driver/riscv-features.c
index 78d3b2d3baecf9..f67dd3d46402ba 100644
--- a/clang/test/Driver/riscv-features.c
+++ b/clang/test/Driver/riscv-features.c
@@ -10,7 +10,9 @@
 // RUN: %clang --target=riscv32-unknown-elf -### %s -mrelax 2>&1 | FileCheck 
%s -check-prefix=RELAX
 // RUN: %clang --target=riscv32-unknown-elf -### %s -mno-relax 2>&1 | 
FileCheck %s -check-prefix=NO-RELAX
 
+// ANDROID: "-target-feature" "+zba"
 // ANDROID: "-target-feature" "+zbb"
+// ANDROID: "-target-feature" "+zbs"
 // RELAX: "-target-feature" "+relax"
 // NO-RELAX: "-target-feature" "-relax"
 // DEFAULT: "-target-feature" "+relax"


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to