From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out3.simply.com (smtp-out3.simply.com [94.231.106.210]) by sourceware.org (Postfix) with ESMTPS id 023FC3858032 for ; Mon, 15 Jan 2024 09:37:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 023FC3858032 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=gaisler.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gaisler.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 023FC3858032 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=94.231.106.210 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705311476; cv=none; b=Jjv+T/2KSCWxwszRdp/398EF7o6MMzLFNCXz0urzYglGHqfJDeWkj0HNBSHCQbM5rZ6gMbPa4eyEqAkWEPAVCr14RJfcxXHJHWeiqlCK+8OHeTyC7R/eCjuzPoumanuxqk2GGRBAa6BG0m6/C2mh/N2O38tOzFZC+UIQ3v5NKXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705311476; c=relaxed/simple; bh=gR561n25fU8kVEigy22n9f1fAXeRWCXxkOf79c6G8aM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=MWkdKq7SjH66SXW5ELu17RANItazIpyAU5U5oRdd1VoiRDhR0pvPPlSG+iIuNadKZzPNBXaESmdmzmJePhtR1hEY1SQMjHc/U8UcXloHUz/nb9pfcNiqTquIpgsRcFH4s0CYgPQ5Lmt1WWI5aD0yTUcPKaNAEAoZrGv2SN/z2sg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.simply.com (Simply.com) with ESMTP id 4TD6WK6Khdz67yS; Mon, 15 Jan 2024 10:37:49 +0100 (CET) Received: from [192.168.0.86] (h-98-128-223-123.NA.cust.bahnhof.se [98.128.223.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by smtp.simply.com (Simply.com) with ESMTPSA id 4TD6WK4kSJz67xB; Mon, 15 Jan 2024 10:37:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaisler.com; s=unoeuro; t=1705311469; bh=EM3uHNCY3VlI0TnZffLZuPPKFTcyQG7WhUGjH/0jVL0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=H61Tig8YvX/j1joz5oudYJoNm8x621naSWaXhE7YOVNHFCfAxwc7bY/TgxvEjRZwW WtRCU7m5qIE6nINjbzGU33+DvDFWNlXWkeTeSD9KVb5pCCKdBlNGkmw9LxSsZGT0w+ QgDpTZPZPwkYnN/UYAN0PfNOw+iHo0PwU49pt8LQ= Message-ID: Date: Mon, 15 Jan 2024 10:37:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sparc: Prevent stfsr from directly following floating-point instruction Content-Language: en-US To: Adhemerval Zanella Netto , libc-alpha@sourceware.org Cc: daniel@gaisler.com, andreas@gaisler.com References: <20240112092628.2464455-1-cederman@gaisler.com> <20240112092628.2464455-2-cederman@gaisler.com> <77658cde-97f2-4017-aba9-8d062a6cddba@linaro.org> From: Daniel Cederman Organization: Frontgrade Gaisler AB In-Reply-To: <77658cde-97f2-4017-aba9-8d062a6cddba@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 2024-01-12 15:38, Adhemerval Zanella Netto wrote: > > > On 12/01/24 06:26, Daniel Cederman wrote: >> On LEON, if the stfsr instruction is immediately following a floating-point >> operation instruction in a running program, with no other instruction in >> between the two, the stfsr might behave as if the order was reversed >> between the two instructions and the stfsr occurred before the >> floating-point operation. >> >> Add a nop instruction before the stfsr to prevent this from happening. >> >> Signed-off-by: Daniel Cederman > > You might want to check if __builtin_store_fsr gcc builtin is also subject > to this issue (it used on atomic floating point support as well). > Thank you for reviewing the patches! I will address your comments and send an updated version. I was not aware of the gcc builtin for fsr so that is likely something that needs to be fixed. Thanks! /Daniel