Skip to content

Commit 20af0e5

Browse files
authored
Enable v for RISCV64 Android (#69261)
Android has already enabled V by default for aosp: https://android-review.googlesource.com/c/platform/build/soong/+/2752805 four weeks back.
1 parent abd0d5d commit 20af0e5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args,
309309
return "rv32imafdc";
310310
else if (MABI.starts_with_insensitive("lp64")) {
311311
if (Triple.isAndroid())
312-
return "rv64imafdc_zba_zbb_zbs";
312+
return "rv64imafdcv_zba_zbb_zbs";
313313

314314
return "rv64imafdc";
315315
}
@@ -329,7 +329,7 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args,
329329
if (Triple.getOS() == llvm::Triple::UnknownOS)
330330
return "rv64imac";
331331
else if (Triple.isAndroid())
332-
return "rv64imafdc_zba_zbb_zbs";
332+
return "rv64imafdcv_zba_zbb_zbs";
333333
else
334334
return "rv64imafdc";
335335
}

clang/test/Driver/riscv-features.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
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" "+v"
1314
// ANDROID: "-target-feature" "+zba"
1415
// ANDROID: "-target-feature" "+zbb"
1516
// ANDROID: "-target-feature" "+zbs"

0 commit comments

Comments
 (0)