Skip to content

Commit

Permalink
Enable zba and zbs for RISCV64 Android
Browse files Browse the repository at this point in the history
Reviewers: enh, pirama, srhines, asb

Differential Revision: https://reviews.llvm.org/D155339
  • Loading branch information
hiraditya committed Jul 17, 2023
1 parent 53abf2d commit f7623f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/Driver/ToolChains/Arch/RISCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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";
}
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Driver/riscv-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f7623f4

Please sign in to comment.