From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by sourceware.org (Postfix) with ESMTPS id 13D7B3875B6A for ; Sat, 17 Dec 2022 10:39:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13D7B3875B6A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-qt1-x82e.google.com with SMTP id i20so4645715qtw.9 for ; Sat, 17 Dec 2022 02:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; 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=7SqFk8GSh8xIOvAV+V0rt075JrLr+gC0+TgeS5PZIXU=; b=RjvTO3iQoeHLneI9eeCh6OkjYEDHWbH9m48IKbxlMRljDV63ElkzQ3bNc1mRqp/gQn MYCM87GYXE3I4RQ2LBKLlrpOQY+1jix6X/8vZiWfMkcIqtKvc9ky9trnEvEE9er3INlU 4HQvbwLQt6nwrojoPrPCrfq3VMItxdMbU7ejkZa4jwgdfOsuLGN+VjoaO6ssLKT5EsXK jhqn1szbcc0ZCpdjuXKIyk88gAXg53Au4aE/ayuVHwnrWump1mipq6VtuoWpNEpq7Aez xMqvLXR0EjhGw6pX2UIRBK6ta0lclfeQ4thS5ZtRYy/+6t6p87kqpMvNWAzTmCBYLAvL 903Q== 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=7SqFk8GSh8xIOvAV+V0rt075JrLr+gC0+TgeS5PZIXU=; b=Wfkm46ahPIefgpgmqNCq408yDOWokGthsOQx3HottZvYNq/JaKID7lvHetFOMbcPzp FB/OMTzc5UEOa4Mn9Hk/OOITHY6ekImZl+I3EhBa/FnSxRsw5czP4bFxIqmIo8tOvUJm ljzoqaTq0dklKQQt5qpc8xZjwYF1Sitgzg1KA5dKHruB0VCMCnHkT1lnyOEdcq1Fx7gd yyf3daTacVwyLtulFQZsCFln2gzbr6vS+rMopB1OF9n8lQZw3BDJY6wgkLI9/mcRaEJE a/CcTtk4lXKHb3vEnQjOEm1UmEV0X55L4WX7baaO0F/hcLQulUGIv6p0FFzBDx7GHfiJ JMAA== X-Gm-Message-State: AFqh2koprfoU4htsfbW2SwfUCU4Tjlkeb0ju4NRwFjVpHh9MTfX3zyk8 n7PPQPgWHrDhH7bIFWtbe4N/zzhwq7jJdaco7nskNDfu6QmtBZcOcmC+N8qrE3TKs2+5kgvao5I gZkjN+ujOd+j5okucjizEGJDQY6mf19e7Fze08fTetdNi+yH92AVGP/ou6F9n2ddOWacgco0= X-Google-Smtp-Source: AMrXdXv7mVHIzr0XdR04uuNPvfhJW5to9S7rR9ZLQIicuJP7Q5L8xyn0go+85556ZwbIH9rXDV/TRg== X-Received: by 2002:ac8:44a1:0:b0:3a9:7782:fd69 with SMTP id a1-20020ac844a1000000b003a97782fd69mr6170648qto.14.1671273560976; Sat, 17 Dec 2022 02:39:20 -0800 (PST) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com. [209.85.219.170]) by smtp.gmail.com with ESMTPSA id f7-20020ac84707000000b00397b1c60780sm2769493qtp.61.2022.12.17.02.39.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Dec 2022 02:39:20 -0800 (PST) Received: by mail-yb1-f170.google.com with SMTP id b16so4966703yba.0 for ; Sat, 17 Dec 2022 02:39:19 -0800 (PST) X-Received: by 2002:a5b:b45:0:b0:6f8:ce8a:57a5 with SMTP id b5-20020a5b0b45000000b006f8ce8a57a5mr44056388ybr.26.1671273559545; Sat, 17 Dec 2022 02:39:19 -0800 (PST) MIME-Version: 1.0 References: <87r0wypcgw.fsf@linux-m68k.org> <87mt7mpby8.fsf@linux-m68k.org> In-Reply-To: <87mt7mpby8.fsf@linux-m68k.org> From: Andrew Waterman Date: Sat, 17 Dec 2022 02:39:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] RISC-V: Note that __builtin_riscv_pause() implies Xgnuzihintpausestate To: Andreas Schwab Cc: Palmer Dabbelt , Kito Cheng , gcc-patches@gcc.gnu.org, Greg Favor Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Sat, Dec 17, 2022 at 2:21 AM Andreas Schwab wrote: > > On Dez 17 2022, Andrew Waterman wrote: > > > On Sat, Dec 17, 2022 at 2:10 AM Andreas Schwab wrote: > >> > >> On Dez 17 2022, Andrew Waterman wrote: > >> > >> > It took me a few minutes to understand the purpose of this chicanery, but > >> > there's indeed a contradiction in the ISA spec. HINT instructions _do_ > >> > affect architectural state in a limited fashion--namely, updating the PC. > >> > >> How can an insn _not_ affect the PC? (Other than the trivial infinite > >> loop.) > > > > Heh, yeah, that's roughly what I meant by "common-sense reading" (and > > that's my rationale for simply clarifying the spec and nuking this > > Xgnuzihintpausestate extension). > > My point is that the implicit update of the PC cannot be part of the > architectural state in the first place. Even the trivial infinite loop > has this, before the actual state change (setting PC back) is performed. It's just a definitional issue. By analogy, this is why we have the concept of "explicit memory access" (the thing a load or store is trying to do) and "implicit memory access" (all of the other memory accesses, like the instruction fetch or page-table walk). The PC update is very much an architectural-state change, but it would be fair to call it an "implicit architectural-state change" to contrast with e.g. writing an x-register being an "explicit architectural state change". Anyway, I don't think we're disagreeing with each other (and I still think there's no problem to be solved here). > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different."