From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 02E213858D37 for ; Fri, 28 Apr 2023 18:18:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02E213858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1a920d484bdso2209905ad.1 for ; Fri, 28 Apr 2023 11:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1682705900; x=1685297900; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KPolthTfccxMaoC92/UWEe1AIT5FjxAmybXMdVTg6cA=; b=y7OnfMee57s89i5CTXx7MO38hXnM6vm6u34mzMRWRIE+Qu2WoAtW/lK6mFKrN1Z9rN MLUJ2Gpb+rej96btM0YiIh335ud5JGtabr7eSYEJJXRCPhTBwTdBEI/YZ1edT57dMl+w HiRdPSnoUhZLvYsPBZlkhjHvuMzBYeaI0H9Q0AUKFuid91kp2rMbD+DOZ/6QLD2WzxxR R4taFMaeHS6G0Al01wA/34eifwRf+Gai+jKjEXJQ++uBH8rj61S2UIxpGxvVnwfYH9wh 0DeFWvKKcEg8CxTp5esncHFui5tTtJSSYcpd+KgKE8xp1wSzOVJ83/MQu0NoRMUMdOMN YDjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682705900; x=1685297900; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KPolthTfccxMaoC92/UWEe1AIT5FjxAmybXMdVTg6cA=; b=hlw0Ng39aXjlvMJavWfxHH24WiSLsUs4HH9R8PA5wI9l2ZqpRwOLK124L0RQkvyiHZ EP6S2dWXevFg9AmeK6dqUejk3WAoJ2Cn9N38LaIWBfFc3oVkUczoBuJjVEuuq3dwLkie gT6XotIta5uxBzNNXdXJk9K601I+5VMk4JzHTnO3BCyvCzlO0WSRDlekwttXOBi4vCLl aZf5DRCBZEBT/XmM9PhGIaYbfdNGKENT3tFvmOkJka7RB1RP/0KwoK1NPmoeyOARX0iv 9QWBZsnbCPTzPtRACAJicpHvTVNaRWZ/N4IZpfQ8y36DTRTWGZLFRTmoX4CFJWS1wBOe y0qw== X-Gm-Message-State: AC+VfDy3hxnhBtDb9aD7/T51MEpRqosEpmYQwCG1bug1ELZjfpO02IBj cBbxfC0b7eafyeBgvoYYxWI8QA== X-Google-Smtp-Source: ACHHUZ7g5gYnVGoIdwE80KfRuGGGwOfi4ZY1+Uh2eL4UaGMQFZDHcADdhMHj3Ppy01rgqWxrFQZyvA== X-Received: by 2002:a17:902:e5c9:b0:1a9:91d7:ba2 with SMTP id u9-20020a170902e5c900b001a991d70ba2mr7369538plf.48.1682705899771; Fri, 28 Apr 2023 11:18:19 -0700 (PDT) Received: from [10.0.17.156] ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id f5-20020a170902ab8500b001991f3d85acsm13488262plr.299.2023.04.28.11.18.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Apr 2023 11:18:19 -0700 (PDT) Message-ID: <8c768ac5-5a12-4119-b43b-7652aec358a9@rivosinc.com> Date: Fri, 28 Apr 2023 11:18:17 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v5 00/11] RISC-V: Implement ISA Manual Table A.6 Mappings Content-Language: en-US From: Patrick O'Neill To: Palmer Dabbelt , jeffreyalaw@gmail.com Cc: gcc-patches@gcc.gnu.org, gnu-toolchain@rivosinc.com, Vineet Gupta , Andrew Waterman , kito.cheng@sifive.com, Daniel Lustig , cmuellner@gcc.gnu.org, Andrea Parri , hboehm@google.com References: <20873714-5809-0be2-35f0-91b76b80d7e5@rivosinc.com> In-Reply-To: <20873714-5809-0be2-35f0-91b76b80d7e5@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4/28/23 10:44, Patrick O'Neill wrote: > On 4/28/23 09:29, Palmer Dabbelt wrote: >> On Fri, 28 Apr 2023 09:14:00 PDT (-0700), jeffreyalaw@gmail.com wrote: >>> On 4/27/23 10:22, Patrick O'Neill wrote: ... >>>> LLVM mapping notes >>>> -------- >>>> LLVM emits corresponding fences for atomic_signal_fence instructions. >>>> This seems to be an oversight since AFAIK atomic_signal_fence acts >>>> as a >>>> compiler directive. GCC does not emit any fences for >>>> atomic_signal_fence >>>> instructions. >>> This starts to touch on a larger concern.  Specifically I'd really like >>> the two compilers to be compatible in terms of the code they generate >>> for the various atomics. >>> >>> What I worry about is code being written (by design or accident) >>> that is >>> dependent on the particular behavior of one compiler and then if that >>> code gets built with the other compiler, and we end up different >>> behavior.  Worse yet, if/when this happens, it's likely to be tough to >>> expose, reproduce & debug. > Agreed. > > I'll open an issue with LLVM and see what they have to say about this > particular behavior. Ideally we'd have perfectly compatible compilers > (for atomic ops) by the end of this :) > > AFAICT GCC hasn't ever been emitting fences for these instructions. > (& This behavior isn't touched by the patchset). I re-ran the set of tests I was using and couldn't replicate LLVM's behavior that was noted here. I think I mixed had up atomic_thread_fence with atomic_signal_fence at some point. That was the only difference I could find during my testing of this patchset (other than the strengthened SEQ_CST store), so I think GCC/LLVM atomics will be fully compatible once this patchset is applied.