From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16994 invoked by alias); 22 Dec 2014 12:25:23 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 16984 invoked by uid 89); 22 Dec 2014 12:25:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp16.uk.ibm.com Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 22 Dec 2014 12:25:22 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Dec 2014 12:25:19 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 22 Dec 2014 12:25:18 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id F3EC117D8047 for ; Mon, 22 Dec 2014 12:25:44 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBMCPH4p60424252 for ; Mon, 22 Dec 2014 12:25:17 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBMCPHDx001268 for ; Mon, 22 Dec 2014 05:25:17 -0700 Received: from bl3ahm9f.de.ibm.com (sig-9-81-107-9.evts.de.ibm.com [9.81.107.9]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sBMCPGeT001237 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 22 Dec 2014 05:25:16 -0700 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1Y3234-00080T-81; Mon, 22 Dec 2014 13:25:18 +0100 Date: Mon, 22 Dec 2014 12:25:00 -0000 From: Dominik Vogt To: libffi-discuss@sourceware.org Subject: Re: [PATCH 3/4] s390: Reorganize assembly Message-ID: <20141222122517.GA30481@linux.vnet.ibm.com> Reply-To: libffi-discuss@sourceware.org Mail-Followup-To: libffi-discuss@sourceware.org References: <1418938403-15836-1-git-send-email-rth@twiddle.net> <1418938403-15836-4-git-send-email-rth@twiddle.net> <20141222121250.GA25775@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline In-Reply-To: <20141222121250.GA25775@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14122212-0025-0000-0000-000002FBCCFD X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00282.txt.bz2 --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 168 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 --TB36FDmn/VVEgNH/ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-s390-Optimize-return-type-table-in-ffi_call_SYSV.patch" Content-length: 2210 >From 08ef4df7343ae07bfc8c032387ac57a19bfa9820 Mon Sep 17 00:00:00 2001 From: Dominik Vogt 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 --TB36FDmn/VVEgNH/--