From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by sourceware.org (Postfix) with ESMTPS id 58C583858D35 for ; Fri, 20 Oct 2023 18:08:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58C583858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 58C583858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697825332; cv=none; b=emqOKsvAcDiOEBkbbwccVlg9t/DHXXCE1GOBkaPmGypOk0DcTc9HkvnKEc30DAJmAtWDnVJOXIF+Bdyjt9e+MN6KUuURduPREDG7MqSB19MZfy9GPewrMBBY51xncUEfJpEqFVOaKDT+46Qa+DqpnjTULZFTQ3NDa0GvpMAnN8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697825332; c=relaxed/simple; bh=jKxlHdUIijRHe3nSOAMdInl2Z0yEx8Uxx+eWOsr6q44=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=f2a15ug+y9hqcc1mjMJFnvFjhadl16qusSmT7yHciFETGekDdOm1/ogYU8elAfecmOJlUd6k/5lN9NJGPfpbnlrm9ZdYPVzE0Ctl1erTRAbcUX5j0PHFvFO3+DkiuiYVCij2ndMXMhyUgHPfoGv7ROVb5TQs+43GwEr9NlsEFOY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc32.google.com with SMTP id 006d021491bc7-57babef76deso603379eaf.0 for ; Fri, 20 Oct 2023 11:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1697825330; x=1698430130; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sYS8maaytLix9YTY4hWA5QrTqe5Zg63bT/QPrqo0h7g=; b=C589hl3wxlkDmb9/EA3+iOodkUIXLscwnjRwSE1w1ymt5dcv6DrrfffH8lVL/Bmj8N gD7Y2lxzTeevr0TTiZ5JeUOd2mgJvJOX9OaFjya2BIMzOb7Qh/6rN21TJCw5EGzN2rGi iwHAuzd0Z+sCnJvKjBYkYYDCbeZUFE6f+zSKroWCeliGqkqfBA4LjiKyIqCvnqVrImxk K2odpm7rlFRMJQGrtupbCkxbd5vh23ws9pHp5U+toySLAEHkkoNdOCWTHtE47/SjKvck FJebTFdb5PZh4q6KEb9XtODKWzAIR6Z7iFdXZLDlNrXCAk/NfpL1auGMmY43j4+UcCVg vt5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697825330; x=1698430130; h=content-transfer-encoding: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=sYS8maaytLix9YTY4hWA5QrTqe5Zg63bT/QPrqo0h7g=; b=K3YZsFvBlc3ATRWq/LT2EgXWpDZ5zWcaSt4+vEvZh/XSkIltzUiRCLd2WE7HddNOC/ 98mAaYAo82SIsGKJwSEJT3hHw17mEUpbiFpbKl2rbAQ5dIyRO3AdYOHv5qOaYRXgN3zo 11IbRqx1+43Ci5rZeWzfDkE4Kt3cLQxMVTrqYB73KZ0zAiaLJj9iNeOfVvUj8nCg4HA6 3JuVv0nLHzDI80nOLYy0dxb0yC4Ep3HbQaJfW1lVTscAnM/qQEalD66OXnYesEuirjGs gyUjvevO5emxnJHNwhh6h0HopRyt1yHIjWdnUgDCF+I9rlejP3Re0A+pgk0D2yr/LSCT TQQg== X-Gm-Message-State: AOJu0Yzf2MTTSuZvFznmXh8cGuRwFFpUDUCussOnRnrII2mFeNBtMg0A buGXiRubBl3b8vYJCKQr/EE9RRHro4AxdexXXXKFIQ== X-Google-Smtp-Source: AGHT+IHyidrP9BGc4QP8oLSDoPB2QQnIb3Hn/Xy6mkCpdSanXNlnOnPIlKkiCwI8ACI6PwtEDuwNiUTT8PHSXtN3UBE= X-Received: by 2002:a05:6358:999a:b0:143:8f7f:9150 with SMTP id j26-20020a056358999a00b001438f7f9150mr2397536rwb.13.1697825330418; Fri, 20 Oct 2023 11:08:50 -0700 (PDT) MIME-Version: 1.0 References: <20231020095348.2455729-1-christoph.muellner@vrull.eu> In-Reply-To: From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Fri, 20 Oct 2023 20:08:36 +0200 Message-ID: Subject: Re: [PATCH v2 0/2] riscv: Adding support for XTHead(F)MemIdx To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: On Fri, Oct 20, 2023 at 4:33=E2=80=AFPM Jeff Law wr= ote: > > > > On 10/20/23 03:53, Christoph Muellner wrote: > > From: Christoph M=C3=BCllner > > > > This two patches add support for the XTheadMemIdx > > and XTheadFMemIdx ISA extensions, that support additional > > addressing modes. The extensions are implemented in a range > > of T-Head cores (e.g. C906, C910, C920) and are available > > on the market for quite some time. > > > > The ISA spec can be found here: > > https://github.com/T-head-Semi/thead-extension-spec > > > > An initial version of these patches has been sent a while ago. > > Jeff Law suggested to use INSNs instead of peepholes to let > > the combiner do the optimization. This is the major change > > that this patches have seen. > Did you happen to do any before/after testing? And if so, did using the > combiner help with discovery of these cases? I would expect it to have > done so, but it's always nice to have a confirmation. I had no doubt this would be equal or better, therefore I did not plan to do that. However, measuring this is not that hard, so I just did the exercise of forward-porting the peephole-based patchset (and all tiny fixes that the v2 has). I then built xalancbmk_r/peak (randomly selected) with both compilers and compared the number of indexed loads and indexed stores in the binary: v1: 3982 indexed loads / 2447 indexed stores v2: 4110 indexed loads (+3.2%) / 2476 indexed stores (+1.2%) So your suggestion indeed helps to discover additional cases. Thanks again for that! BR Christoph