From: Dominik Vogt <vogt@linux.vnet.ibm.com>
To: libffi-discuss@sourceware.org
Subject: Re: [PATCH 3/4] s390: Reorganize assembly
Date: Mon, 22 Dec 2014 12:25:00 -0000 [thread overview]
Message-ID: <20141222122517.GA30481@linux.vnet.ibm.com> (raw)
In-Reply-To: <20141222121250.GA25775@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 168 bytes --]
Or rather the attached patch stat replaces
stm %r2,%r3,0(%r12)
nop
with
st %r2,0(%r12)
st %r3,4(%r12)
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany
[-- Attachment #2: 0001-s390-Optimize-return-type-table-in-ffi_call_SYSV.patch --]
[-- Type: text/x-diff, Size: 2209 bytes --]
From 08ef4df7343ae07bfc8c032387ac57a19bfa9820 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Mon, 22 Dec 2014 12:51:59 +0100
Subject: [PATCH] s390: Optimize return type table in ffi_call_SYSV.
---
src/s390/internal.h | 8 ++++----
src/s390/sysv.S | 22 +++++++---------------
2 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/src/s390/internal.h b/src/s390/internal.h
index b875578..33246e9 100644
--- a/src/s390/internal.h
+++ b/src/s390/internal.h
@@ -1,8 +1,8 @@
/* If these values change, sysv.S must be adapted! */
-#define FFI390_RET_DOUBLE 0
-#define FFI390_RET_FLOAT 1
-#define FFI390_RET_INT64 2
-#define FFI390_RET_INT32 3
+#define FFI390_RET_INT32 0
+#define FFI390_RET_DOUBLE 1
+#define FFI390_RET_FLOAT 2
+#define FFI390_RET_INT64 3
#define FFI390_RET_VOID 4
#define FFI360_RET_MASK 7
diff --git a/src/s390/sysv.S b/src/s390/sysv.S
index c4b5006..9e3c2a7 100644
--- a/src/s390/sysv.S
+++ b/src/s390/sysv.S
@@ -76,6 +76,10 @@ ffi_call_SYSV:
.balign 8
.Ltable:
+# FFI390_RET_INT32
+ st %r2,0(%r12)
+ j .Ldone
+
# FFI390_RET_DOUBLE
std %f0,0(%r12)
j .Ldone
@@ -87,16 +91,11 @@ ffi_call_SYSV:
.balign 8
# FFI390_RET_INT64
+ st %r2,0(%r12)
st %r3,4(%r12)
- nop
# fallthru
.balign 8
-# FFI390_RET_INT32
- st %r2,0(%r12)
- nop
- # fallthru
-
.balign 8
# FFI390_RET_VOID
.Ldone:
@@ -209,7 +208,7 @@ ffi_call_SYSV:
.cfi_rel_offset r14, 112
.cfi_def_cfa_register r13
stg %r2,0(%r15) # Set up back chain
- larl %r14,.Ltable # Set up return address
+ larl %r14,.Ltable-8 # Set up return address
slag %r3,%r3,3 # ret_type *= 8
lgr %r12,%r4 # Save ret_addr
lgr %r1,%r5 # Save fun
@@ -223,6 +222,7 @@ ffi_call_SYSV:
br %r1 # ... and call function
.balign 8
+# FFI390_RET_INT32 is not used, table starts at entry 1, not entry 0
.Ltable:
# FFI390_RET_DOUBLE
std %f0,0(%r12)
@@ -238,14 +238,6 @@ ffi_call_SYSV:
stg %r2,0(%r12)
.balign 8
-# FFI390_RET_INT32
- # Never used, as we always store type ffi_arg.
- # But the stg above is 6 bytes and we cannot
- # jump around this case, so fall through.
- nop
- nop
-
- .balign 8
# FFI390_RET_VOID
.Ldone:
lg %r14,112(%r13)
--
1.8.4.2
next prev parent reply other threads:[~2014-12-22 12:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-18 21:33 [PATCH 0/4] s390 improvements Richard Henderson
2014-12-18 21:33 ` [PATCH 3/4] s390: Reorganize assembly Richard Henderson
2014-12-22 12:12 ` Dominik Vogt
2014-12-22 12:25 ` Dominik Vogt [this message]
2014-12-22 16:30 ` Richard Henderson
2014-12-23 9:54 ` Dominik Vogt
2014-12-18 21:33 ` [PATCH 1/4] s390: Kill trailing whitespace Richard Henderson
2014-12-18 21:33 ` [PATCH 2/4] s390: Avoid aliasing warnings Richard Henderson
2014-12-18 21:33 ` [PATCH 4/4] s390: Use pc-relative insns in 31-bit mode Richard Henderson
2014-12-19 15:07 ` [PATCH 0/4] s390 improvements Ulrich Weigand
2014-12-19 15:33 ` Richard Henderson
2014-12-19 16:15 ` Ulrich Weigand
2014-12-19 16:37 ` Richard Henderson
2014-12-19 17:08 ` Ulrich Weigand
2014-12-19 16:43 ` [PATCH 5/4] s390: Inline and tidy ffi_prep_args Richard Henderson
2014-12-22 11:34 ` [PATCH 0/4] s390 improvements Dominik Vogt
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=20141222122517.GA30481@linux.vnet.ibm.com \
--to=vogt@linux.vnet.ibm.com \
--cc=libffi-discuss@sourceware.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).