From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id A38463858428 for ; Thu, 25 May 2023 10:01:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A38463858428 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-39815ce6db2so599642b6e.0 for ; Thu, 25 May 2023 03:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1685008877; x=1687600877; h=mime-version:user-agent:message-id:in-reply-to:date:errors-to :references:organization:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tfeg4nyaLzGgADAHD6F5hoxR+ljtruxb1Fz3L26QA2A=; b=OZCXykcCFSmrp2OxbB2kQmckh8fCxdH2LZIadxFOZbZ3tnuTrUNU2HQ6g8id1x496+ 65sdwKAksi91KWgtzfmqeMO7dAcyEYgSgCkLWw3nKnuEhCP79byMfWvEry8f7keo0HP6 7sPDWvsHyKfTS+22G3gtrHBAFlKiByJOpIEz4iDAaHhoFGTVPbqRjd5Ioac1juH+MAve IsVrToHWf8bErYd++dD9VNF2WDOACYcKdkaNr9vvot/aFWnIEBag6KJ7zsQhnacarIGl Rhs9rpslD6LSJbaymKpiAxNGmgxt4VAYc8IUmISURCNcqqSqjBxtQClxtWT4dyOxlkq/ m6TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685008877; x=1687600877; h=mime-version:user-agent:message-id:in-reply-to:date:errors-to :references:organization:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tfeg4nyaLzGgADAHD6F5hoxR+ljtruxb1Fz3L26QA2A=; b=HENTwAj3CqUVFy9nle8xuOi/OFEUUHXhzDUm73CutOOVPzyrk7UU0+lq42zf6RCNVb RP9j7bMBPOxF/REMG8UBpv9owIwxTtdkRmxzHDSIbpa1IZWwqh2cE1dfGW00pGQNWQps Xe6NWW5VfLisdaOKQdzxNOYn8vzXtglu/12tBjnRVY+w1i53bU5jBhfSKqHVzdDlTW9I 9WkO2Fq7PEWqcq00mrlNgYr+bcx/eXnRF8aMuKbJp10zx4DLTUbTBCFGV2akETxaTi03 9Ojvmitd6OnlF8mXh8WzXhtA6zBrN8p2LKzyJQz8Jk5eGUZ8dCma+n6j8eRJoGTpOwyJ Xh3w== X-Gm-Message-State: AC+VfDxH1HOqbhU5/agp1z0iIiFga9fLXVRWbptjnFEeZKvSPaGjuvzt Vny9LKchXm+BVYkTKDxk4dhw0Q== X-Google-Smtp-Source: ACHHUZ4YsfTgP/HWbjU5G5WrreI8sz2femLv2GuDoGTe2ilAbAPAKRN9XkYwr4p8BsXMHQKxwCE3Qw== X-Received: by 2002:a05:6808:2789:b0:398:5aee:7806 with SMTP id es9-20020a056808278900b003985aee7806mr1070128oib.5.1685008876868; Thu, 25 May 2023 03:01:16 -0700 (PDT) Received: from free.home ([2804:7f1:2080:6383:46d9:ede8:ee97:8cc0]) by smtp.gmail.com with ESMTPSA id j9-20020a544809000000b003923ef75a3dsm328367oij.4.2023.05.25.03.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 03:01:16 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 34PA11oB3670957 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 25 May 2023 07:01:02 -0300 From: Alexandre Oliva To: Richard Biener Cc: gcc-patches@gcc.gnu.org, "H.J. Lu" , Jan Hubicka , Uros Bizjak Subject: Re: [PATCH] [x86] reenable dword MOVE_MAX for better memmove inlining Organization: Free thinker, does not speak for AdaCore References: Errors-To: aoliva@lxoliva.fsfla.org Date: Thu, 25 May 2023 07:01:01 -0300 In-Reply-To: (Richard Biener's message of "Wed, 24 May 2023 11:12:22 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: --text follows this line-- On May 24, 2023, Richard Biener wrote: > gimple_fold_builtin_memory_op tries to expand the call to a single > load plus a single store so we can handle overlaps by first loading > everything to registers and then storing: *nod*, that's why I figured we could afford to go back to allowing DImode (with -m32) or TImode (with -m64) even without vector modes: we'd just use a pair of registers, a single insn, even though not a single hardware instruction. > using DImode on i?86 without SSE means we eventually perform two > loads and two stores which means we need two registers available. *nod*. But the alternative is to issue an out-of-line call to memmove, which would clobber more than 2 registers. ISTM that inlining such calls is better, whether optimizing for speed or size. > So I think if we want to expand this further at the GIMPLE level we > should still honor MOVE_MAX but eventually emit multiple loads/stores > honoring the MOVE_MAX_PIECES set of constraints there and avoid > expanding to sequences where we cannot interleave the loads/stores > (aka for the memmove case). But... don't we already? If I'm reading the code right, we'll already issue gimple code to load the whole block into a temporary and then store it, but current MOVE_MAX won't let us go past 4 bytes on SSE-less x86. -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about