From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id 8F7AC389901B for ; Tue, 15 Nov 2022 16:40:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8F7AC389901B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102e.google.com with SMTP id r61-20020a17090a43c300b00212f4e9cccdso17414397pjg.5 for ; Tue, 15 Nov 2022 08:40:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=W9UPk7Pzhxi0/WsG3NEgNg+sc9vCAkm36hs9/+4wjcA=; b=P2fJOZcywzKlwXBIAUIyvsc5vwQ242R2J/r5y1GrT4zLlamtdQdinPEyjeABTYh+tQ jV6bXL0OJtljf3BW0Uc358XSwr2nnZTaqSG9+dx7RciBKl+R487fZX52qqRC8Rj+3ulB 8JG0q41mBsHgRwUS6mlxoV2r6ujAFQyYYzVJXxWDXNAg2qQKD7GbmKO67mWH4mi3wmHE xH6SBXillX6NngL2ZOlCLW0hBbdc0nlz4otck9Tq1i8dLP0oQu06SWfJQiJ5IyQrLOw/ JNg8JTkeZXb/zh/evxyooQC+MsAhOucTPEvD5ggLhKU317FqYHvwiycZLi+Yc7SRjFlx Hy+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc: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=W9UPk7Pzhxi0/WsG3NEgNg+sc9vCAkm36hs9/+4wjcA=; b=TV5VHWDyV2/gkRmvJPU8nGv9HTWkHvRszcXmMviEx/46k09x/6nJ1v7WQRyiaz+S8d LDXVlMslSBabfuLjSZCulnsk2W5ji2zexxVn0DSbZZujnNeIr7tEsfShEGLSmsCxhJ+a m977imRJXB7ohCUD34jqLEfY057sD4LGfEL1SoAfDb+WardP6dgsudKJxLyHiyhpjr9u aQ08aTaPHUbI+8SUVYwVimXmWc/ou6KA/HwPpgtMaG/Nq7khUDs+/PGvNq2RpTGE4J8F Y7Xy/eO+ssNGa2hDz8pLgj/ie1E2PWX7CWymaDcTZ2xusv2Os5y3mamDJpSTehQQC6ND EYrg== X-Gm-Message-State: ANoB5pkUrtR8GoXL1JyqIKcAU8liNHl47EvY76/HY3dJCjb5bAg56E1d fcK1EHvG/k8gnZQjpsXpJbg= X-Google-Smtp-Source: AA0mqf660jP9Gj4HZZDj79Gi3lOfXIqGgXIUlN55CXferiXHFVP98tvKjxG1CW6a6F7qO4hU44JrTg== X-Received: by 2002:a17:90a:8a91:b0:214:2920:4675 with SMTP id x17-20020a17090a8a9100b0021429204675mr1471860pjn.0.1668530448406; Tue, 15 Nov 2022 08:40:48 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id a27-20020aa7971b000000b00561d79f1064sm8968590pfg.57.2022.11.15.08.40.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 08:40:47 -0800 (PST) Message-ID: <8c89be43-4c82-26e0-ad0a-0914b2b85578@gmail.com> Date: Tue, 15 Nov 2022 09:40:46 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] RISC-V: Zihintpause: add __builtin_riscv_pause Content-Language: en-US To: Philipp Tomsich , gcc-patches@gcc.gnu.org Cc: Vineet Gupta , Palmer Dabbelt , Jeff Law , Kito Cheng , Christoph Muellner References: <20221113204139.4061479-1-philipp.tomsich@vrull.eu> From: Jeff Law In-Reply-To: <20221113204139.4061479-1-philipp.tomsich@vrull.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,NICE_REPLY_A,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 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. Jeff