public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andreas Krebbel <krebbel@linux.ibm.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH 2/2] GO S/390: Add kdsaQuery function
Date: Mon, 14 Oct 2019 09:52:00 -0000	[thread overview]
Message-ID: <20191014090900.7065-1-krebbel@linux.ibm.com> (raw)
In-Reply-To: <CAOyqgcUedUm1bF5exo-tpV53=_v1WFyz3GFR4ONP9GMuEn0+3g@mail.gmail.com>

Since the update to Go 1.13beta1 the kdsaQuery function is expected to
be present. However, it is not with GCCGO since the assembler file
from GOLANG cannot be understood by gas.  This patch adds an inline
assembly implementation to cpu_gccgo.c.

2019-10-14  Andreas Krebbel  <krebbel@linux.ibm.com>

	* libgo/go/internal/cpu/cpu_gccgo.c:
---
 libgo/go/internal/cpu/cpu_gccgo.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libgo/go/internal/cpu/cpu_gccgo.c b/libgo/go/internal/cpu/cpu_gccgo.c
index ed0e7bff8cd..76b99cb00a0 100644
--- a/libgo/go/internal/cpu/cpu_gccgo.c
+++ b/libgo/go/internal/cpu/cpu_gccgo.c
@@ -184,4 +184,19 @@ struct queryResult klmdQuery() {
     return ret;
 }
 
+struct queryResult kdsaQuery(void)
+  __asm__(GOSYM_PREFIX "internal..z2fcpu.kdsaQuery")
+  __attribute__((no_split_stack));
+
+struct queryResult kdsaQuery() {
+    struct queryResult ret;
+
+    __asm__ ("lghi   %%r0, 0\t\n"  // set function code to 0 (KDSA-Query)
+	     "la     %%r1, %[ret]\t\n"
+	     ".long  0xb93a0024\t\n"  // kdsa
+	     :[ret] "=QRST" (ret) : : "r0", "r1", "cc");
+
+    return ret;
+}
+
 #endif /* defined(__s390x__)  */
-- 
2.23.0

  parent reply	other threads:[~2019-10-14  9:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 18:29 libgo: Update to Go 1.13beta1 release Ian Lance Taylor
2019-09-07 12:03 ` Andreas Schwab
2019-09-09 23:13   ` Ian Lance Taylor
2019-09-09  8:26 ` Rainer Orth
2019-09-10 20:41   ` Ian Lance Taylor
2019-10-14  9:09 ` [PATCH 1/2] Sync hardware facility names with other files in os_linux_s390x.go Andreas Krebbel
2019-10-14 14:52   ` Ian Lance Taylor
2019-10-14  9:52 ` Andreas Krebbel [this message]
2019-10-14 14:11   ` [PATCH 2/2] GO S/390: Add kdsaQuery function Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191014090900.7065-1-krebbel@linux.ibm.com \
    --to=krebbel@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).