From 6efc71c9205f4d02d2ffb5a436408a90d3a52c53 Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Tue, 10 Oct 2023 16:26:26 -0700 Subject: [PATCH 1/3] Add the V (vector) extension to the riscv64-linux-android target spec This feature has been enabled and tested internally in the Android project. --- compiler/rustc_target/src/spec/riscv64_linux_android.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/riscv64_linux_android.rs b/compiler/rustc_target/src/spec/riscv64_linux_android.rs index 91f5e562d8b..5312c761d6f 100644 --- a/compiler/rustc_target/src/spec/riscv64_linux_android.rs +++ b/compiler/rustc_target/src/spec/riscv64_linux_android.rs @@ -9,7 +9,7 @@ pub fn target() -> Target { options: TargetOptions { code_model: Some(CodeModel::Medium), cpu: "generic-rv64".into(), - features: "+m,+a,+f,+d,+c,+Zba,+Zbb,+Zbs".into(), + features: "+m,+a,+f,+d,+c,+Zba,+Zbb,+Zbs,+V".into(), llvm_abiname: "lp64d".into(), supported_sanitizers: SanitizerSet::ADDRESS, max_atomic_width: Some(64), From 899f81fcb8a4ead2524d5728cb40518b085496bf Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Wed, 11 Oct 2023 17:01:39 -0700 Subject: [PATCH 2/3] Add documentation for the riscv64-android-linux target This commit adds additional documentation describing the features/extensions required by the riscv64-linux-android target. --- src/doc/rustc/src/platform-support/android.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/doc/rustc/src/platform-support/android.md b/src/doc/rustc/src/platform-support/android.md index 4ef74295e0f..9ddf00e3a50 100644 --- a/src/doc/rustc/src/platform-support/android.md +++ b/src/doc/rustc/src/platform-support/android.md @@ -45,3 +45,19 @@ The riscv64-linux-android target is supported as a Tier 3 target. A list of all supported targets can be found [here](../platform-support.html) + +## Architecture Notes + +### riscv64-linux-android + +Currently the `riscv64-linux-android` target requires the following architecture features/extensions: + +* `a` (atomics) +* `d` (double-precision floating-point) +* `c` (compressed instruction set) +* `f` (single-precision floating-point) +* `m` (multiplication and division) +* `v` (vector) +* `Zba` (address calculation instructions) +* `Zbb` (base instructions) +* `Zbs` (single-bit instructions) From 166c3534849c88e38ca730457970d916a9d31f1a Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Fri, 13 Oct 2023 10:01:14 -0700 Subject: [PATCH 3/3] Lowercase the feature flags for riscv64-linux-android --- compiler/rustc_target/src/spec/riscv64_linux_android.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/riscv64_linux_android.rs b/compiler/rustc_target/src/spec/riscv64_linux_android.rs index 5312c761d6f..121237f6ba4 100644 --- a/compiler/rustc_target/src/spec/riscv64_linux_android.rs +++ b/compiler/rustc_target/src/spec/riscv64_linux_android.rs @@ -9,7 +9,7 @@ pub fn target() -> Target { options: TargetOptions { code_model: Some(CodeModel::Medium), cpu: "generic-rv64".into(), - features: "+m,+a,+f,+d,+c,+Zba,+Zbb,+Zbs,+V".into(), + features: "+m,+a,+f,+d,+c,+zba,+zbb,+zbs,+v".into(), llvm_abiname: "lp64d".into(), supported_sanitizers: SanitizerSet::ADDRESS, max_atomic_width: Some(64),