Skip to content

Commit f7623f4

Browse files
committed
Enable zba and zbs for RISCV64 Android
Reviewers: enh, pirama, srhines, asb Differential Revision: https://reviews.llvm.org/D155339
1 parent 53abf2d commit f7623f4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/Driver/ToolChains/Arch/RISCV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args,
294294
return "rv32imafdc";
295295
else if (MABI.starts_with_insensitive("lp64")) {
296296
if (Triple.isAndroid())
297-
return "rv64imafdc_zbb";
297+
return "rv64imafdc_zba_zbb_zbs";
298298

299299
return "rv64imafdc";
300300
}
@@ -314,7 +314,7 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args,
314314
if (Triple.getOS() == llvm::Triple::UnknownOS)
315315
return "rv64imac";
316316
else if (Triple.isAndroid())
317-
return "rv64imafdc_zbb";
317+
return "rv64imafdc_zba_zbb_zbs";
318318
else
319319
return "rv64imafdc";
320320
}

clang/test/Driver/riscv-features.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
// RUN: %clang --target=riscv32-unknown-elf -### %s -mrelax 2>&1 | FileCheck %s -check-prefix=RELAX
1111
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-relax 2>&1 | FileCheck %s -check-prefix=NO-RELAX
1212

13+
// ANDROID: "-target-feature" "+zba"
1314
// ANDROID: "-target-feature" "+zbb"
15+
// ANDROID: "-target-feature" "+zbs"
1416
// RELAX: "-target-feature" "+relax"
1517
// NO-RELAX: "-target-feature" "-relax"
1618
// DEFAULT: "-target-feature" "+relax"

0 commit comments

Comments
 (0)