[clang] [WIP] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)
https://github.com/hiraditya created https://github.com/llvm/llvm-project/pull/85704 Android CTS test already requires fast unaligned access https://android-review.googlesource.com/c/platform/cts/+/2675633 Pending testcase >From e9a5140853eb4a76765189f38fa31ee21be827ef Mon Sep 17 00:00:00 2001 From: AdityaK <1894981+hiradi...@users.noreply.github.com> Date: Mon, 18 Mar 2024 14:09:13 -0700 Subject: [PATCH] clang driver: enable fast unaligned access for Android on RISCV64 Android CTS test already requires fast unaligned access https://android-review.googlesource.com/c/platform/cts/+/2675633 --- clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 4 1 file changed, 4 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp index 5165bccc6d7e30..b1dd7c4372d475 100644 --- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp @@ -167,6 +167,10 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, Features.push_back("-relax"); } + // Android requires fast unaligned access on RISCV64. + if (Triple.isAndroid()) +Features.push_back("+fast-unaligned-access"); + // -mstrict-align is default, unless -mno-strict-align is specified. AddTargetFeature(Args, Features, options::OPT_mno_strict_align, options::OPT_mstrict_align, "fast-unaligned-access"); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [WIP] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information. https://github.com/llvm/llvm-project/pull/85704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [WIP] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)
https://github.com/hiraditya updated https://github.com/llvm/llvm-project/pull/85704 >From a48820a1db41d7f33b5b0f96d22842642bf3b78d Mon Sep 17 00:00:00 2001 From: AdityaK Date: Mon, 18 Mar 2024 14:09:13 -0700 Subject: [PATCH] clang driver: enable fast unaligned access for Android on RISCV64 Android CTS test already requires fast unaligned access https://android-review.googlesource.com/c/platform/cts/+/2675633 --- clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 4 clang/test/Driver/riscv-features.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp index 5165bccc6d7e30..b1dd7c4372d475 100644 --- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp @@ -167,6 +167,10 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, Features.push_back("-relax"); } + // Android requires fast unaligned access on RISCV64. + if (Triple.isAndroid()) +Features.push_back("+fast-unaligned-access"); + // -mstrict-align is default, unless -mno-strict-align is specified. AddTargetFeature(Args, Features, options::OPT_mno_strict_align, options::OPT_mstrict_align, "fast-unaligned-access"); diff --git a/clang/test/Driver/riscv-features.c b/clang/test/Driver/riscv-features.c index fe74ac773ef8ca..7db3adb117ae47 100644 --- a/clang/test/Driver/riscv-features.c +++ b/clang/test/Driver/riscv-features.c @@ -1,7 +1,7 @@ // RUN: %clang --target=riscv32-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s // RUN: %clang --target=riscv64-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s // RUN: %clang --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT -// RUN: %clang -mabi=lp64d --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT +// RUN: %clang -mabi=lp64d --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT,FAST-UNALIGNED-ACCESS // CHECK: fno-signed-char ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [WIP] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)
https://github.com/hiraditya ready_for_review https://github.com/llvm/llvm-project/pull/85704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [WIP] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v @llvm/pr-subscribers-clang Author: AdityaK (hiraditya) Changes Android CTS test already requires fast unaligned access https://android-review.googlesource.com/c/platform/cts/+/2675633 Pending testcase --- Full diff: https://github.com/llvm/llvm-project/pull/85704.diff 2 Files Affected: - (modified) clang/lib/Driver/ToolChains/Arch/RISCV.cpp (+4) - (modified) clang/test/Driver/riscv-features.c (+1-1) ``diff diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp index 5165bccc6d7e30..b1dd7c4372d475 100644 --- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp @@ -167,6 +167,10 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, Features.push_back("-relax"); } + // Android requires fast unaligned access on RISCV64. + if (Triple.isAndroid()) +Features.push_back("+fast-unaligned-access"); + // -mstrict-align is default, unless -mno-strict-align is specified. AddTargetFeature(Args, Features, options::OPT_mno_strict_align, options::OPT_mstrict_align, "fast-unaligned-access"); diff --git a/clang/test/Driver/riscv-features.c b/clang/test/Driver/riscv-features.c index fe74ac773ef8ca..7db3adb117ae47 100644 --- a/clang/test/Driver/riscv-features.c +++ b/clang/test/Driver/riscv-features.c @@ -1,7 +1,7 @@ // RUN: %clang --target=riscv32-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s // RUN: %clang --target=riscv64-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s // RUN: %clang --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT -// RUN: %clang -mabi=lp64d --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT +// RUN: %clang -mabi=lp64d --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT,FAST-UNALIGNED-ACCESS // CHECK: fno-signed-char `` https://github.com/llvm/llvm-project/pull/85704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [WIP] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)
https://github.com/hiraditya edited https://github.com/llvm/llvm-project/pull/85704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits