From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by sourceware.org (Postfix) with ESMTPS id B5E8A385771F for ; Thu, 27 Jul 2023 16:36:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B5E8A385771F 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-oa1-x33.google.com with SMTP id 586e51a60fabf-1bbaa549bcbso939551fac.3 for ; Thu, 27 Jul 2023 09:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690475813; x=1691080613; 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:message-id:reply-to; bh=sD1DMS4baFnUwbyx9mrPP3bAq16fP4nISBujJFqB8dw=; b=BV/WoAc6fhP9Aw5L+uq8XmCQXkhLqmV8nAPiTrgFVQCC+W8bEYf+aMNlKsumo+hCg3 9keHSX5hCal7wNeAOsGcF9Nu36I1dNlUY/zKN6UvEQ4mcv2okynmrTtoNf4KXXmbBZnT kQcayEcgeA30NuFjTevuaiUljNNHKJHFft6gcibr6erE3ld5S+EawyNta2CjseOeUBDz YavmECLvBsAKvbzuCwnVwiCmyf4lC+k3o57Agf6aSOaaQ3KekdDd/92TubnA3w4qLrOf rxnHg+YOH0YhWBeFfRjtYabKwM+ZI2R3ua7N4G13wm9g6sDIixhNmSY4LgB6oYYWZw+Z P80w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690475813; x=1691080613; 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:message-id :reply-to; bh=sD1DMS4baFnUwbyx9mrPP3bAq16fP4nISBujJFqB8dw=; b=lv17+ycK5BY55I1PfIrYCrv/MCag9AKni4I3sx0i1pZO22sdgzgdDDuCOQ8Y9zFTeH lxf+j2E11IvbVzKTE08FSeaKbSmUKV/LhS22sYNOZJ/zDqyjgR1CxESt2avQzKHTyRMM 3fbwyP9N/1vGjpkd8OKbERh+YS9J8vpmXOPe8K0KtuRNW9Xw41/scf+woAMvBhbsxtn9 PqVd3Q24FjnHhePahXCZ2o9AAgRBLbq0GGAJijbIrBSVk2JUy/N3mOsn4Jzpi2XCZpCv y2NdQpUVAH2JEte99YKw3/ltBn0yyLu+oZ/VEpnZkmQrFwX83E9mfZAgq1SiS56gqkbj SChA== X-Gm-Message-State: ABy/qLZS0M+GRnB8JLdHCDYGGLFUNtgSpsixvmqAT3fN6POJ91xgK+KE To6+zrC0oX5rvL0FMsL7ZFB86g== X-Google-Smtp-Source: APBJJlG8OmbFMA/WWvDKtjQKhl2bWrC9Ky0WobWyB18VDfA5SbcFfaGiArbSjr5qQrlzUSjdZVVzjA== X-Received: by 2002:a05:6870:1fc6:b0:1ad:3cfe:3ead with SMTP id gp6-20020a0568701fc600b001ad3cfe3eadmr4458390oac.20.1690475812711; Thu, 27 Jul 2023 09:36:52 -0700 (PDT) Received: from [192.168.15.31] (189-46-1-220.dsl.telesp.net.br. [189.46.1.220]) by smtp.gmail.com with ESMTPSA id eg27-20020a056870989b00b001a68feb9440sm864672oab.9.2023.07.27.09.36.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jul 2023 09:36:51 -0700 (PDT) Message-ID: <78cafb5d-0a31-f69a-ac02-feee07547519@linaro.org> Date: Thu, 27 Jul 2023 13:35:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] x86_64: Optimize ffsll function code size. Content-Language: en-US To: Florian Weimer , Sunil Pandey Cc: Alexander Monakov , Noah Goldstein via Libc-alpha , Noah Goldstein , Richard Henderson , hjl.tools@gmail.com References: <20230726160524.1955013-1-skpgkp2@gmail.com> <874jlp4vlz.fsf@oldenburg3.str.redhat.com> <8f7d6d53-5157-0b3a-b8ad-1afd940cae6f@ispras.ru> <87r0ot367s.fsf@oldenburg3.str.redhat.com> <492f2c2c-1cb7-20ef-e4a3-4bdda76e5f9b@ispras.ru> <87sf99xqyh.fsf@oldenburg3.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87sf99xqyh.fsf@oldenburg3.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 27/07/23 13:24, Florian Weimer via Libc-alpha wrote: > * Sunil Pandey: > >> Ffsll is one of the benchmark tests in the phoronix test suite, not >> sure how much it matters to the application. Lots of people involved >> in phoronix benchmark testing/tracking and this kind of random perf >> behavior wastes their time. > > That's a good point. I've seen similar reports before (sadly I don't > recall if they were specifically about ffsll). > > Regarding the mechanics of fixing it, if the instruction ordering and > sizing is so sensitive, should this be an assembler implementation > instead? And will the fix even work for distributions that build with > --enable-cet, considering that there's going to be an additional 4-byte > NOP at the start of the function? > Sigh... do we really need to care about this synthetic benchmark that is exercising a fallback path since compiler will most likely issue the inline builtin? And even this is really important, tune function alignment and size to fit on a cacheline should be done by the compiler, specially in the case where we can implement by using a builtin.