From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by sourceware.org (Postfix) with ESMTPS id 77FB83849ADA for ; Fri, 10 May 2024 22:42:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 77FB83849ADA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 77FB83849ADA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c2b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715380948; cv=none; b=mhMiP5xCPu6CgQ0ILs1Fm5qKfPnyT3CkyWIjG8djSvahPBS6+WCvaa63mmwrCih3/SxeiBt07V7cg7iwy/oYSiWc4GpGpciL6RFkjr8ZWu6KoUevdOJDNVcCaA2hs4GnCFqm77BSwtpFyw9Hgc3wQjyP36eqz10+AhAX3tnCLBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715380948; c=relaxed/simple; bh=p0i2VlNIY0OuppuHRxfmXb/0+ZxZDU437NLiIj7mvQs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=aj98+z6nrNWOLZOMA76gpQMJz7WA1pAyjO+jk1U10/FHzVyDJWMI3m90jkNbMvFOtGhwfZhdwUxubVn+O5Upnios0Ki7axoAbirEw39PbAgQJAXQMyfoQWcJFPyr2xjgSd4o51RJDwIgw/jAmBoVT6H+syC0MAD3bxLHry1t3iI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-5b279e04391so1146533eaf.3 for ; Fri, 10 May 2024 15:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715380946; x=1715985746; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=iua6pzHAwAnJNFNwPM3tXkXx9MYP6f09E4Ic1OD/bNI=; b=kx93xpIEXIzOhryNEW09sV0okPmDZg8ssRDSETDWMpb9lbqxMx5AMzMh1EYjssAMXK n/82vfxkCW5/5apNvrM2A5thnndQPlhQnx9Pn4Tfrx1B60ctojfIXzZ1IciXDlTWovup mHzSNlnBbspoCLKQj0dFgzqrF7Dp4XuQjDVP41PTqJCJAlsGGxTrV1koBjxjSD9vWUQX i+7zCV02Q3DOQJiEtoVJcKwhrTja9AhAVxUaLwnwYi5uCjgJRsAppL36chuoeY+grd+B NQszRVl7axi75G9xkg0VajEGwJXW7X1bfvAmVoN8AwzAraJTpeh7GL5BOpN4byyC2I8A x25A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715380946; x=1715985746; h=content-transfer-encoding:in-reply-to:from:references: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=iua6pzHAwAnJNFNwPM3tXkXx9MYP6f09E4Ic1OD/bNI=; b=W0eSa1iXX3pOGXxY2br+lcW7fcUelprm1Mlk3BQupFL3JsIhLtGlrGjkjh++QvW15a hvaST6VcBHQom8g/sAYF4RmFhnEckopXe9zVvaN61vYyw6QR0mxtCfxLoOcrEutlGBDq EHUD3C3Al29GF8s368LTsLUfkR9i3meK19TZmDTArf1ikqvyV517ONHztnFuxMaV8Iu4 Fh3Ndwy+1hPEp1Kq1SkdQXX9d3JZki8hixstkKF79ckvNQGYTtYdJF2AmOuv3B/Ofgky CY+YQ1NpGsjH+1pHNLNBsxV9m7tCmQN1qNBOefB1prwauC0qUo+cqqvEjUVRivbpfi7E OkjA== X-Forwarded-Encrypted: i=1; AJvYcCUGbxCJIcAYchZ1ke6nIvEkv959zXTqNm31PRKtPWnN52+7koCuudwckN2w0p3Sb/5WtzQwrH5xjw5xlExQpaLOhvIHYtGlQQ== X-Gm-Message-State: AOJu0Yy6KC2DzZ9pM8mKeqk4w3XMNUxcJ9YnitTo63tnwguhFqKufb3c FzUgKbx0so4YD5Aw3M2It8BHe6x0VIEHdfuMf0bDcg9xD0+1MGpS X-Google-Smtp-Source: AGHT+IGAxqZ6m4ROusDemsBIlONFIHv6CeXFhU80xVX9ypkblj0f4BzjENQDW2y+yxZVEAL0hMK9xw== X-Received: by 2002:a05:6871:588:b0:23d:5285:5dc6 with SMTP id 586e51a60fabf-24172c4db06mr4404923fac.52.1715380945578; Fri, 10 May 2024 15:42:25 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-6f0eb32b6a6sm458542a34.8.2024.05.10.15.42.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 May 2024 15:42:25 -0700 (PDT) Message-ID: Date: Fri, 10 May 2024 16:42:24 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH 4/4] RISC-V: Allow by-pieces to do overlapping accesses in block_move_straight Content-Language: en-US To: =?UTF-8?Q?Christoph_M=C3=BCllner?= , gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Vineet Gupta References: <20240508051756.3999080-1-christoph.muellner@vrull.eu> <20240508051756.3999080-5-christoph.muellner@vrull.eu> From: Jeff Law In-Reply-To: <20240508051756.3999080-5-christoph.muellner@vrull.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_MANYTO,KAM_SHORT,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 5/7/24 11:17 PM, Christoph Müllner wrote: > The current implementation of riscv_block_move_straight() emits a couple > of loads/stores with with maximum width (e.g. 8-byte for RV64). > The remainder is handed over to move_by_pieces(). > The by-pieces framework utilizes target hooks to decide about the emitted > instructions (e.g. unaligned accesses or overlapping accesses). > > Since the current implementation will always request less than XLEN bytes > to be handled by the by-pieces infrastructure, it is impossible that > overlapping memory accesses can ever be emitted (the by-pieces code does > not know of any previous instructions that were emitted by the backend). > > This patch changes the implementation of riscv_block_move_straight() > such, that it utilizes the by-pieces framework if the remaining data > is less than 2*XLEN bytes, which is sufficient to enable overlapping > memory accesses (if the requirements for them are given). > > The changes in the expansion can be seen in the adjustments of the > cpymem-NN-ooo test cases. The changes in the cpymem-NN tests are > caused by the different instruction ordering of the code emitted > by the by-pieces infrastructure, which emits alternating load/store > sequences. > > gcc/ChangeLog: > > * config/riscv/riscv-string.cc (riscv_block_move_straight): > Hand over up to 2xXLEN bytes to move_by_pieces(). > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/cpymem-32-ooo.c: Adjustments for overlapping > access. > * gcc.target/riscv/cpymem-32.c: Adjustments for code emitted by > by-pieces. > * gcc.target/riscv/cpymem-64-ooo.c: Adjustments for overlapping > access. > * gcc.target/riscv/cpymem-64.c: Adjustments for code emitted by > by-pieces. OK once any prereqs are in. jeff