From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by sourceware.org (Postfix) with ESMTPS id 769D6393BA7B for ; Tue, 15 Nov 2022 22:13:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 769D6393BA7B 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-lf1-x129.google.com with SMTP id g7so26700094lfv.5 for ; Tue, 15 Nov 2022 14:13:07 -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=BYLfWtr33XdbkWvxxugLtNSdC2zdr2GzYWorHmSfxT8=; b=oMmj3XfmKR3bQWlOLGGkcOrJfzcGzYmtryK1dIDJFJVvozySrhQWaGdmrKMWmOelp4 /uEF9tXlaZQCBDynmhz57j2xH+0EuT2pO4yV+E3yaq+O0bIanGnr0Vn+p26SMJEbSIuf ekuyu2/NxrTzLAU8HaNnCUkzWO4yTzH2qaVKSGIgJmchXW8vJMD0dFuHt9ZNDGXI2Qte 7EQjWX+0Y2GlRgpKtRb28w0k3DhSVfdVnalgjI6e575q7p0OJicFI74mooA2inct+G7T kwpNVkusnszFGMG4C7JPeggt27CFw2LRPwpq0T2tj6SvQOqOiiz5MJAyzktmtOlZI+5v Rcug== 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=BYLfWtr33XdbkWvxxugLtNSdC2zdr2GzYWorHmSfxT8=; b=zscGPcYuYYvTuKHlWdue0F9X/plGIEEmJHJnrrMuyZgwMAd+YkML8OPZbBU56KZWQ4 NSNRG8e4xMhmpTAQ7yGlEox6qnVPcYjW/wcbFL6JOpqF+TqliVSnwPswL+10vGXIosJQ cQa0WmQJ5TMoIl35AqE1ZUFzd5qJ5CGdBqrj8zZunNHpwohfW0ZO/aVJRxnp0/lrZAlu 2FJHjDxGfZ8d+EFCaq1HaHqewJeGWLonqxSxQYa+Bcntu03clsVDvRJd3Hsjdx8Oq8FC BuLktj37If3E9E4A2LtDUA5TqIXdSO+AwKxhnPE1vVWDTNkKnrWzfHDKCncaq7eS6xch wI5w== X-Gm-Message-State: ANoB5pkNg+MVTQUP5N+abw8s8suXWBekSzpERopMGgPqVMbdHBmJkuAn u64DwOfCAn4Oa2y4mD/o0ndyxWgyAn078yM0nxJmgQ== X-Google-Smtp-Source: AA0mqf6hQiOtPxcUmojufBaxnfMveCIsuG+4tS6ZYQAHUVuZvrUMa9AO2BwYCQeUNX7ei4dP1VqvUms5D5Bcr4lhSgo= X-Received: by 2002:a05:6512:32a6:b0:4b1:4933:d0de with SMTP id q6-20020a05651232a600b004b14933d0demr5927200lfe.10.1668550385957; Tue, 15 Nov 2022 14:13:05 -0800 (PST) MIME-Version: 1.0 References: <20221113204139.4061479-1-philipp.tomsich@vrull.eu> <8c89be43-4c82-26e0-ad0a-0914b2b85578@gmail.com> In-Reply-To: <8c89be43-4c82-26e0-ad0a-0914b2b85578@gmail.com> From: Philipp Tomsich Date: Tue, 15 Nov 2022 23:12:54 +0100 Message-ID: Subject: Re: [PATCH] RISC-V: Zihintpause: add __builtin_riscv_pause To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Vineet Gupta , Palmer Dabbelt , Jeff Law , Kito Cheng , Christoph Muellner Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,KAM_SHORT,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 Tue, 15 Nov 2022 at 17:40, Jeff Law wrote: > > > On 11/13/22 13:41, Philipp Tomsich wrote: > > The Zihintpause extension uses an opcode from the 'fence' opcode range > > to add a true hint instruction (i.e. if it is not supported on any > > given platform, the 'fence' that is encoded will not enforce any > > specific ordering on memory accesses) for entering a low-power state > > (e.g. in an idle thread). We expose this new instruction through a > > machine-dependent builtin to allow generating it without a requirement > > for any inline assembly. > > > > Given that the encoding of 'pause' is valid (as a 'fence' encoding) > > even for processors that do not (yet) support Zihintpause, we make > > this builtin available without any further TARGET_* constraints. > > > > gcc/ChangeLog: > > > > * config/riscv/riscv-builtins.cc (struct riscv_builtin_description): > > add the pause machine-dependent builtin with no result and no > > arguments; mark it as always present (pause is a true hint > > that encodes into a fence-insn, if not supported with the new > > pause semantics). > > * config/riscv/riscv-ftypes.def: Add type for void -> void. > > * config/riscv/riscv.md (riscv_pause): Add risc_pause and UNSPECV_PAUSE > > * doc/gcc/extensions-to-the-c-language-family/target-builtins/risc-v-built-in-functions.rst: > > Document. > > * optabs.cc (maybe_gen_insn): Allow nops == 0 (void -> void). > > > > gcc/testsuite/ChangeLog: > > > > * gcc.target/riscv/builtin_pause.c: New test. > > OK. Though I think you'll need to adjust the doc patch now with the > sphinx work reverted. Applied to master with the earlier changes to texinfo restored. Thanks! --Philipp.