public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6408] internal/cpu: add aarch64 support functions
@ 2021-01-01 23:14 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2021-01-01 23:14 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:5a4e0d121ab199d8a2036b219065f30f9f7411a3
commit r11-6408-g5a4e0d121ab199d8a2036b219065f30f9f7411a3
Author: Ian Lance Taylor <iant@golang.org>
Date: Fri Jan 1 12:05:39 2021 -0800
internal/cpu: add aarch64 support functions
Patch from Andreas Schwab.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/281000
Diff:
---
gcc/go/gofrontend/MERGE | 2 +-
libgo/go/internal/cpu/cpu_gccgo.c | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index e51285c7214..f4c99756d25 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-fa161cb71880cf80ef53fb4bf35dba8ee01af648
+2b5bdd22b7ec2fc13ae0f644c781f64c1a209500
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/go/internal/cpu/cpu_gccgo.c b/libgo/go/internal/cpu/cpu_gccgo.c
index da26f4d7407..6a20b394469 100644
--- a/libgo/go/internal/cpu/cpu_gccgo.c
+++ b/libgo/go/internal/cpu/cpu_gccgo.c
@@ -200,3 +200,29 @@ struct queryResult kdsaQuery() {
}
#endif /* defined(__s390x__) */
+
+#ifdef __aarch64__
+
+uint64_t getisar0(void)
+ __asm__(GOSYM_PREFIX "internal_1cpu.getisar0")
+ __attribute__((no_split_stack));
+
+uint64_t getisar0() {
+ uint64_t isar0;
+
+ __asm__("mrs %0,id_aa64isar0_el1" : "=r"(isar0));
+ return isar0;
+}
+
+uint64_t getMIDR(void)
+ __asm__(GOSYM_PREFIX "internal_1cpu.getMIDR")
+ __attribute__((no_split_stack));
+
+uint64_t getMIDR() {
+ uint64_t MIDR;
+
+ __asm__("mrs %0,midr_el1" : "=r"(MIDR));
+ return MIDR;
+}
+
+#endif /* defined(__aarch64__) */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-01 23:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 23:14 [gcc r11-6408] internal/cpu: add aarch64 support functions Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).