From patchwork Fri Jun 19 13:51:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 39689 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 88DD83840C23; Fri, 19 Jun 2020 13:52:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88DD83840C23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1592574721; bh=hyQA2gg2MoHg/lfOtHPLVx41tbuyRq7ca+LKdmCpX5E=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=K6deoYUxDqL8KVYqx5utiXBwgERcf1rG1/sqZ2KU1saYGUEEFjIOFiQE5ePKxfGJs MP2peC3DxRrXcROw3NsAtvDKmfNo5IaqezmwTe8RROYmWeQjDf5AKMHZVFlDusWEtl d0Ed5y7XHl2dO7EriAvsMdw+Vc7ug1LDfIP77bTA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 524B63870844 for ; Fri, 19 Jun 2020 13:51:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 524B63870844 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05JDcOxU039830 for ; Fri, 19 Jun 2020 09:51:58 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 31rekdt2j8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Jun 2020 09:51:58 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05JDiq0T010512 for ; Fri, 19 Jun 2020 13:51:56 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma02fra.de.ibm.com with ESMTP id 31r0dvs3aj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Jun 2020 13:51:55 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05JDprib4915342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Jun 2020 13:51:53 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E29211C04C; Fri, 19 Jun 2020 13:51:53 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11C1911C050; Fri, 19 Jun 2020 13:51:53 +0000 (GMT) Received: from oc4452167425.ibm.com (unknown [9.145.33.208]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 19 Jun 2020 13:51:52 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] S390: Optimize __memset_z196. Date: Fri, 19 Jun 2020 15:51:50 +0200 Message-Id: <20200619135150.30278-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-19_11:2020-06-19, 2020-06-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 cotscore=-2147483648 mlxlogscore=487 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 suspectscore=1 adultscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006190096 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: Stefan Liebler via Libc-alpha From: Stefan Liebler Reply-To: Stefan Liebler Cc: Stefan Liebler Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It turned out that an 256b-mvc instruction which depends on the result of a previous 256b-mvc instruction is counterproductive. Therefore this patch adjusts the 256b-loop by storing the first byte with stc and setting the remaining 255b with mvc. Now the 255b-mvc instruction depends on the stc instruction. --- sysdeps/s390/memset-z900.S | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sysdeps/s390/memset-z900.S b/sysdeps/s390/memset-z900.S index ca3eac0522..1e0c334156 100644 --- a/sysdeps/s390/memset-z900.S +++ b/sysdeps/s390/memset-z900.S @@ -157,28 +157,27 @@ ENTRY(MEMSET_Z196) # if !defined __s390x__ llgfr %r4,%r4 # endif /* !defined __s390x__ */ - ltgr %r4,%r4 - je .L_Z196_4 + clgfi %r4,1 + jl .L_Z196_4 # n == 0 stc %r3,0(%r2) + je .L_Z196_4 # n == 1 + aghi %r4,-2 lgr %r1,%r2 - cghi %r4,1 - je .L_Z196_4 - aghi %r4,-2 - srlg %r5,%r4,8 - ltgr %r5,%r5 - jne .L_Z196_1 + risbg %r5,%r4,8,128+63,56 # r5 = n / 256 + jne .L_Z196_1 # Jump away if r5 != 0 .L_Z196_3: exrl %r4,.L_Z196_17 .L_Z196_4: br %r14 .L_Z196_1: cgfi %r5,1048576 - jh __memset_mvcle # Switch to mvcle for >256MB + jh __memset_mvcle # Switch to mvcle for >256MB .L_Z196_2: pfd 2,1024(%r1) - mvc 1(256,%r1),0(%r1) + mvc 1(255,%r1),0(%r1) aghi %r5,-1 la %r1,256(%r1) + stc %r3,0(%r1) jne .L_Z196_2 j .L_Z196_3 .L_Z196_17: