From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 8C073384F037 for ; Mon, 14 Nov 2022 19:01:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C073384F037 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-pj1-x1032.google.com with SMTP id m6-20020a17090a5a4600b00212f8dffec9so11639731pji.0 for ; Mon, 14 Nov 2022 11:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PgRGVKqnhrZp0DpDI8Ht7WYoCCGaGcPEZsZkZzmhwkc=; b=OXhqWwSp/BpjEZZdBkCC+0+9n2XbnuDllGidhJddsn6zMKcXUlRVIn1KGk2Nx3TevX 3xTAfTOPX2f8TciE2jj8hdH/H4lFQWr6w13r4bDQ8w8SNWj9tVgwtIE4lgON7pBfllLC giZKjQffkZIKwyYFKsGvz68ZPtfnRkfBSbtHpIMf+nObbXyHlxDHFCglzYmLjqjWFsmt dpOKybUNhyUpKsmbkz2vuFcgjHFKFQl1qCnR9OACr+2rQY7q9ckgY3eY1yxwqp7pmdL+ Stbtvh/9RklQgsAVVA3lHKZHjaNotrTWdctPK66XV3wov8KnxnpRoOHzuw4izE/0sQgS e23g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PgRGVKqnhrZp0DpDI8Ht7WYoCCGaGcPEZsZkZzmhwkc=; b=4e2dyUgvaBEL/hDdWN1HJOvPJknahcIIOv/uKavBQSDU1YjYvJ+3Qj/1gtZc/w+Yft 6fmLbHerbDU6lmfzwz5ZBcbuPn1WAYDXhSq+eHfUfTIHIhqLyrALfnogZjAMEiEnTOSl NYfAVfAMbMcScDOwdkJ8hm+05St+JhUTgzfDgeXn+UaG6eLFnlGb4CnRNRoOJHdVaCQi QRRCvuzklDyMLw6097yjofmGjdB1Fbu85LeDFaiGE9btAyXt4i8d8+bUumFu5VffFaRf FBOiseo4UZFePvmrADhxQ7n9Zk8HKXk7MpqwE2ZIHXxVw/Tk3lNdZdqDsKvLfuZMo1rE r7fQ== X-Gm-Message-State: ANoB5pnvOne8Q+Uj9mhNadOy4AnmVYsNP1Q0tn6aSiNoKjboI0Vi2Nfs GyuNFC2Fl/drIwoi48+GqzuAycW003sB5t4Qj7KWWA== X-Google-Smtp-Source: AA0mqf4NZH16lT6oJd8IjZFSWrkw58fifY2xKGLGWV/whCL6ahGqIWyG1CGwXqqB8w32bcEs0bSghEvJxt7BJPFMQsc= X-Received: by 2002:a17:90a:3487:b0:211:2c1c:2b74 with SMTP id p7-20020a17090a348700b002112c1c2b74mr14815732pjb.18.1668452510530; Mon, 14 Nov 2022 11:01:50 -0800 (PST) MIME-Version: 1.0 References: <20221113230521.712693-1-christoph.muellner@vrull.eu> <20221113230521.712693-6-christoph.muellner@vrull.eu> <4975b815-11e5-28ae-2b7b-9d38886119ed@gmail.com> In-Reply-To: <4975b815-11e5-28ae-2b7b-9d38886119ed@gmail.com> From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Mon, 14 Nov 2022 20:01:35 +0100 Message-ID: Subject: Re: [PATCH 5/7] riscv: Use by-pieces to do overlapping accesses in block_move_straight To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Vineet Gupta Content-Type: multipart/alternative; boundary="0000000000003715f305ed72dfe2" X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: --0000000000003715f305ed72dfe2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 14, 2022 at 6:16 PM Jeff Law wrote: > > On 11/13/22 16:05, Christoph Muellner wrote: > > From: Christoph M=C3=BCllner > > > > The current implementation of riscv_block_move_straight() emits a couple > > of load-store pairs with maximum width (e.g. 8-byte for RV64). > > The remainder is handed over to move_by_pieces(), which emits code based > > target settings like slow_unaligned_access and overlap_op_by_pieces. > > > > move_by_pieces() will emit overlapping memory accesses with maximum > > width only if the given length exceeds the size of one access > > (e.g. 15-bytes for 8-byte accesses). > > > > This patch changes the implementation of riscv_block_move_straight() > > such, that it preserves a remainder within the interval > > [delta..2*delta) instead of [0..delta), so that overlapping memory > > access may be emitted (if the requirements for them are given). > > > > gcc/ChangeLog: > > > > * config/riscv/riscv-string.c (riscv_block_move_straight): > > Adjust range for emitted load/store pairs. > > The change to riscv_expand_block_move isn't noted in the ChangeLog. OK > with that fixed (I'm assuming you want to attempt to use overlapping > word ops for that case). > The change in riscv_expand_block_move is a code cleanup. At the beginning of riscv_expand_block_move we do the following: unsigned HOST_WIDE_INT length =3D UINTVAL (length); The signature of riscv_block_move_straight wants a "unsigned HOST_WIDE_INT length". So we can simply reuse length instead of doing "INTVAL (length)", which is redundant and uses the wrong signess (INTVAL vs UINTVAL). Also, the ChangeLog entry for the test was missing. Thanks, Christoph > > > jeff > > > --0000000000003715f305ed72dfe2--