From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id BFEF93858402 for ; Wed, 10 Nov 2021 13:57:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BFEF93858402 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AADedWd031274 for ; Wed, 10 Nov 2021 13:57:56 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3c8ck33nn2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Nov 2021 13:57:56 +0000 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1AADvu83020134 for ; Wed, 10 Nov 2021 13:57:56 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 3c8ck33nm5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Nov 2021 13:57:56 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1AADrA7N032330; Wed, 10 Nov 2021 13:57:53 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03fra.de.ibm.com with ESMTP id 3c5hbagsve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Nov 2021 13:57:53 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1AADvnbn34865638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Nov 2021 13:57:49 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D26D4C04A; Wed, 10 Nov 2021 13:57:49 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 189D44C05C; Wed, 10 Nov 2021 13:57:49 +0000 (GMT) Received: from [9.145.188.76] (unknown [9.145.188.76]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 10 Nov 2021 13:57:49 +0000 (GMT) Message-ID: <39f1fda9-6085-13af-b9e4-b478acb98963@linux.ibm.com> Date: Wed, 10 Nov 2021 14:57:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH] s390: Use long branches across object boundaries (jgh instead of jh) Content-Language: en-US To: "Carlos O'Donell" , Florian Weimer , libc-alpha@sourceware.org Cc: Nick Clifton , Arjun Shankar References: <875yt19q0w.fsf@oldenburg.str.redhat.com> <800880a2-33bc-3007-dce4-1b839263c523@redhat.com> From: Stefan Liebler In-Reply-To: <800880a2-33bc-3007-dce4-1b839263c523@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: tJZu5zYCnQRNbCvOsYeh92VkPP2Wydmh X-Proofpoint-ORIG-GUID: YExeSH8Nx8fXR3ekzhNvoa6wOixdaS3K X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-10_04,2021-11-08_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 phishscore=0 priorityscore=1501 suspectscore=0 spamscore=0 mlxscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111100071 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 13:57:59 -0000 On 09/11/2021 20:06, Carlos O'Donell wrote: > On 11/9/21 12:50, Florian Weimer wrote: >> Depending on the layout chosen by the linker, the 16-bit displacement >> of the jh instruction is insufficient to reach the target label. >> >> Analysis of the linker failure was carried out by Nick Clifton. >> >> Tested on a z13 and z15, s390x-linux-gnu only. > > Looks correct to me. Converting from BRC to BRCL doubles the available offset bits. > I tested assembling a few variants and they look good to me. > > Reviewed-by: Carlos O'Donell > >> --- >> sysdeps/s390/memmem-arch13.S | 2 +- >> sysdeps/s390/strstr-arch13.S | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/sysdeps/s390/memmem-arch13.S b/sysdeps/s390/memmem-arch13.S >> index c5c8d8c97e..58df8cdb14 100644 >> --- a/sysdeps/s390/memmem-arch13.S >> +++ b/sysdeps/s390/memmem-arch13.S >> @@ -41,7 +41,7 @@ ENTRY(MEMMEM_ARCH13) >> # error The arch13 variant of memmem needs the z13 variant of memmem! >> # endif >> clgfi %r5,9 >> - jh MEMMEM_Z13 > > OK. jh is BRC (branch relative on condition, A7-M-4-RI) with a 16-bit offset. > >> + jgh MEMMEM_Z13 > > OK. jgh is BRCL (branch relative on condition long, C0-M-4-RI) with a 32-bit offset. > >> >> aghik %r0,%r5,-1 /* vll needs highest index. */ >> bc 4,0(%r14) /* cc==1: return if needle-len == 0. */ >> diff --git a/sysdeps/s390/strstr-arch13.S b/sysdeps/s390/strstr-arch13.S >> index c7183e627c..222a6de91a 100644 >> --- a/sysdeps/s390/strstr-arch13.S >> +++ b/sysdeps/s390/strstr-arch13.S >> @@ -49,7 +49,7 @@ ENTRY(STRSTR_ARCH13) >> # error The arch13 variant of strstr needs the z13 variant of strstr! >> # endif >> clgfi %r4,9 >> - jh STRSTR_Z13 >> + jgh STRSTR_Z13 > > Likewise. > >> >> /* In case of a partial match, the vstrs instruction returns the index >> of the partial match in a vector-register. Then we have to >> > > This patch is okay. Thanks for catching this. I've also had a look into the wcsmbs implementations like sysdeps/s390/wcscpy-vx.S where we jump to c-implementation as fallback. There we also use jg which is brcl with all bits set in the condition mask. Thanks, Stefan