From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id C1A01385803D for ; Thu, 18 Feb 2021 20:21:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C1A01385803D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jimw@sifive.com Received: by mail-ej1-x635.google.com with SMTP id do6so7839668ejc.3 for ; Thu, 18 Feb 2021 12:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ynbqc25HMfwGR5ZYJ3HnVQfCaYyi8Vujl+VvVM6AiYc=; b=luB+RcmdmakTj7n/qzW+au2v5cXeoIQ3fDikGbqJg3hp1tSZJCT6hqEijfSCQ/TdCS 5GMmHYVn6XzeOpqTNBZyx25rphWiAKN1wTMOHjvIul6KAOj9RagkS38Xtwo1XYWnJda+ QM57haMpQikITCeUh1HYfBltsAOvymiOYeQgm2POEXatsrT7Y6hwH4CfZN6LcGrtbo7P i3aqdMfiwfMhzEDi0rKVHgJnx2+yXybK6HRcWQvxjiNt4xBQhvcxPRN+ANYptnFGd/Rv wla6LojL9L9GKJqoq7R3vdOc6H3IywzHoSgfy9kLRzeaoDk3Y0PhTZXY/Z329bXyKe+p j7VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ynbqc25HMfwGR5ZYJ3HnVQfCaYyi8Vujl+VvVM6AiYc=; b=nR+tyxtIGJ0f8UGi/KuIIYBNhZCS0fdztoQHmAwjjqvi3BThG9qdmp9s2B1FFCFXmR mJSGgyo1dT2AuZJWldg9TPZvHsvgeXmLvDYwJZwwKp+BGBberuaT4U8WeGCyD7GyX9Ib ReH8t513Q2eNbG+YX0LtRWQk+40qPbD0gnmhk/lGmKfsUNHefWWl+WWumOpk7lzoyQLj KqkzOA1WF+jut/hn5c+AcHiNmNQUwB8uRHf8cudzCONyKqwEZ5ayo28YF8X7QH4Pgegs NlnIUA1CZy6y+np4rfJukyPRevTzuUx0MdtUcssD3T28xizPvwNw2VzuQVQB0YlrQGFy hznA== X-Gm-Message-State: AOAM533MLCrYn4kKuyUNknpAkfa8i78Ti82eKoEdVgYYoRvs7kF+evjh f9yWMkPGGNeLaS/4slM00n6KoiD7t5BF64viK+uSjw== X-Google-Smtp-Source: ABdhPJyDVwehi/ePKh5P3ptAXigy0U3gyNrebjC0qvDq9Ii4UzmoVAI1Ll0boHir0MEkOTWO62ryvkYglwUwfOh7yt0= X-Received: by 2002:a17:907:b08:: with SMTP id h8mr5697353ejl.165.1613679677698; Thu, 18 Feb 2021 12:21:17 -0800 (PST) MIME-Version: 1.0 References: <20210106173303.27988-1-philipp.tomsich@vrull.eu> In-Reply-To: From: Jim Wilson Date: Thu, 18 Feb 2021 12:21:06 -0800 Message-ID: Subject: Re: [PATCH] RISC-V: Zihintpause: add __builtin_riscv_pause To: Kito Cheng Cc: Philipp Tomsich , Kito Cheng , Andrew Waterman , GCC Patches X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2021 20:21:21 -0000 On Thu, Jan 7, 2021 at 12:50 AM Kito Cheng wrote: > My point is tracking info and consistent behavior/scheme with other > extensions, so personally I strongly prefer it should be guarded with > -march. > It is a hint. We should allow it even if the architecture extension is not enabled. For comparison, I suggest you look at the aarch64 port. They have 3 kinds of hints: branch protection (bti), pointer authentication, and speculation control. They deliberately allow you to emit the instructions even if the hardware doesn't support the feature because they are hints, and execute as nops if the hardware support is missing. The rationale is that the code will work with or without the hardware support, but will work better with the hardware support, so it is best to always allow it. We should do the same with RISC-V hints. I agree that we need to include LLVM folks in the discussion to make sure that GCC and LLVM handle this the same way. Jim