From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id AD5FD3858D28 for ; Mon, 19 Sep 2022 19:55:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD5FD3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x235.google.com with SMTP id o64so822486oib.12 for ; Mon, 19 Sep 2022 12:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=Q144Ug/EoyFgiqYO9yolOUaaKdRrFOpZElNy+C0EyFA=; b=oaFpIIcA1DODjp7YQBWroG+i3JV4bqKbI+820IhE0asD2O3/c6SMbX+8T8TQdIfJwP GIzR4tZF5XxLLU1G0XrN339uzapF0048ajR9cycvfhXz6rAbxIJVhF+DULif+LSOsY3z +NDGuJHLA84KlKcYGrIijwPrnF8orekQEZ2NSBXzkAEj1bcOOb7v+sPr1UGhopP7c8rw dJ7YB1NPXrMzEpXthpAcEnO/OgHvwmVyCnVd6M74uw3TJw3En7ZND+bqhGTUk2JqrKLq NU5XKaKRe7h3JzmuTViHteOtqwQ2tlhY6deY6kNHxZSxFSLi2CUHs8yLqn1ZUQnH/lxv aRRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=Q144Ug/EoyFgiqYO9yolOUaaKdRrFOpZElNy+C0EyFA=; b=zaLNbz3rOs1hT4YOuU6yyo+5IEowC/JIHhp+HSc6yfw5bkLCYPWAgRb1rU8u9l8klJ h9WtZtuwB/moOq6haqRLj/sGX69oGNuywAJwp9zqvUBr6PCkTxl7Jw94+PB6lCVyMAHW 0BZn0gT3wNyRgvjNKiBw0b2jxTUTL3Fp5fo1H+MijTPKtfvVhP/KRPWUZSd05aHfNFtV m4OwKaXt+rKA55+J00kiKGu/lxoIwAd5YYSaFjbahYdE2ZqXsM3P6WtcPwJqmvipR4rc rgkDTGzT9KE8M7cJ+A4vJdhNGXHiDwXRtmUhmQT0OAEibKoxR+7kNgV/EWqLH/7JVqB5 NdGQ== X-Gm-Message-State: ACrzQf1+sI/GbHCUDo5PXWZEewGoCVeE3fylbFSnVwa30axr6rFWUc6P 9r3M+qe3EFqFLUVDCFuIHKOIsmPXhjS35CH4 X-Google-Smtp-Source: AMsMyM4KAP7QeMNqG75oeKD/5FZ1zMlvMuJoubEKJtF9Oy2QVdB4ZIDhzRiDf4MRKiOAwbYHXjU+rQ== X-Received: by 2002:a05:6808:1206:b0:350:51ab:f7d with SMTP id a6-20020a056808120600b0035051ab0f7dmr8692299oil.226.1663617354008; Mon, 19 Sep 2022 12:55:54 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:c266:6474:c804:752d:521c? ([2804:1b3:a7c1:c266:6474:c804:752d:521c]) by smtp.gmail.com with ESMTPSA id bl32-20020a05680830a000b0034d9042758fsm13313026oib.24.2022.09.19.12.55.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 12:55:53 -0700 (PDT) Message-ID: Date: Mon, 19 Sep 2022 16:55:51 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 16/17] powerpc: Add string-fza.h Content-Language: en-US To: Paul E Murphy , libc-alpha@sourceware.org Cc: Richard Henderson , Joseph Myers , caiyinyu References: <20220902203940.2385967-1-adhemerval.zanella@linaro.org> <20220902203940.2385967-17-adhemerval.zanella@linaro.org> <496d9efc-6d13-7391-a70c-4a9b5ff18ed9@linux.ibm.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <496d9efc-6d13-7391-a70c-4a9b5ff18ed9@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 06/09/22 11:48, Paul E Murphy wrote: > > > On 9/2/22 3:39 PM, Adhemerval Zanella via Libc-alpha wrote: >> From: Richard Henderson >> >> While ppc has the more important string functions in assembly, >> there are still a few generic routines used. >> >> Use the Power 6 CMPB insn for testing of zeros. >> >> Checked on powerpc64le-linux-gnu. >> --- >>   sysdeps/powerpc/string-fza.h | 70 ++++++++++++++++++++++++++++++++++++ >>   1 file changed, 70 insertions(+) >>   create mode 100644 sysdeps/powerpc/string-fza.h >> >> diff --git a/sysdeps/powerpc/string-fza.h b/sysdeps/powerpc/string-fza.h >> new file mode 100644 >> index 0000000000..5f7e9c5cbe >> --- /dev/null >> +++ b/sysdeps/powerpc/string-fza.h >> @@ -0,0 +1,70 @@ >> +/* Zero byte detection; basics.  PowerPC version. >> +   Copyright (C) 2022 Free Software Foundation, Inc. >> +   This file is part of the GNU C Library. >> + >> +   The GNU C Library is free software; you can redistribute it and/or >> +   modify it under the terms of the GNU Lesser General Public >> +   License as published by the Free Software Foundation; either >> +   version 2.1 of the License, or (at your option) any later version. >> + >> +   The GNU C Library is distributed in the hope that it will be useful, >> +   but WITHOUT ANY WARRANTY; without even the implied warranty of >> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU >> +   Lesser General Public License for more details. >> + >> +   You should have received a copy of the GNU Lesser General Public >> +   License along with the GNU C Library; if not, see >> +   .  */ >> + >> +#ifndef POWERPC_STRING_FZA_H >> +#define POWERPC_STRING_FZA_H 1 >> + >> +/* PowerISA 2.03 (POWER6) provides cmpb instruction.  */ > > Should this read "PowerISA 2.05"? cmpb is listed as implemented from v2.05 in ISA 3.1. Yes, it should be 2.05 indeed. > >> +#ifdef _ARCH_PWR6 >> +# include >> + >> +/* This function returns 0xff for each byte that is >> +   equal between X1 and X2.  */ >> + >> +static inline op_t >> +find_eq_all (op_t x1, op_t x2) >> +{ >> +  op_t ret; >> +  asm ("cmpb %0,%1,%2" : "=r"(ret) : "r"(x1), "r"(x2)); > > Is it possible to use the gcc builtin __builtin_cmpb? Unfortunately __builtin_cmpb is only supported on GCC 8+. > > Otherwise, LGTM. >