From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 88E583858286 for ; Tue, 2 Apr 2024 11:45:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 88E583858286 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 88E583858286 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712058346; cv=none; b=rJHGnIGm9z5ZciOeeb9Sjz42SFEdx2/AkFol+UKNJuKqZJ/AU/IHM8D9YznJTxy5czmhz5mZjtFLr8PCS4ow2shO1tXNuQnEIU5Onm9nfo/HLrUPJz1pufYcoRH0YixGzNj+Hp9K7HaJioVEgW9SR7sE3yArOGL2YrXz+GuWHQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712058346; c=relaxed/simple; bh=t75mmNBTRPpdB4etuYXrxmyuNNq+ljbDHc7l4qv2w30=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=INEBUGn/wPP88JSD0qRIaZIcMpetEXGHo2AnxDvb5f8nhZtMQs0F36nvyIQFm3KcSU2tzGvYskPWASwaja6/Je0YqOLfGeDb+yJtmpTnjUrZAgYDFPCcyHm9Sm4QakrP6VwtN5kkTUGuj65mVxHLQIeZUztSP0a1S6M22l4YFHo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712058343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5Vgm52rTXRUW8v/L7Ke6rhWEtEddjI7//dCB+I3zoms=; b=daYxDubHjtU0Y/Uc1StfE2JCHsY/B2j2cEHAHRgiHqOxEuWQR95ViEQoGml2BT2wsd9/G+ /Oqan8KlNs6CD7HSrYQhEvLssDTFWX3jauCv1i5tUIkKAquPVxFkgIRegFnF6Q8f04aHU8 1BAP/6wvL2GQsQJyqw95snOLi+qJvrY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-570-VuKDdqIqOA6MpF4b1uzDcA-1; Tue, 02 Apr 2024 07:45:41 -0400 X-MC-Unique: VuKDdqIqOA6MpF4b1uzDcA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E1348007BB; Tue, 2 Apr 2024 11:45:41 +0000 (UTC) Received: from oldenburg3.str.redhat.com (unknown [10.39.192.250]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFFF04067A02; Tue, 2 Apr 2024 11:45:39 +0000 (UTC) From: Florian Weimer To: Xi Ruoyao Cc: caiyinyu , josmyers@redhat.com, libc-alpha@sourceware.org, adhemerval.zanella@linaro.org Subject: Re: [PATCH] LoongArch: Add soft floating-point fe* function implementations. References: <20240331101400.474159-1-caiyinyu@loongson.cn> <87le5x1ar2.fsf@oldenburg3.str.redhat.com> <393612ff-b4fa-6047-d203-5b23bd96d29a@loongson.cn> <98f2d5adc158e05a3fa487a8a3a3899734b97a45.camel@xry111.site> Date: Tue, 02 Apr 2024 13:45:17 +0200 In-Reply-To: <98f2d5adc158e05a3fa487a8a3a3899734b97a45.camel@xry111.site> (Xi Ruoyao's message of "Tue, 02 Apr 2024 18:40:06 +0800") Message-ID: <87y19wxa2a.fsf@oldenburg3.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: * Xi Ruoyao: > On Tue, 2024-04-02 at 11:40 +0800, caiyinyu wrote: >> The LoongArch soft ABI was added to glibc in version 2.37[1], but it was >> not fully implemented, >> lacking functions for handling soft float exceptions/rounding modes. >> This patch fills in >> the missing functions and fixes related failed test cases. >> Therefore, would backporting this patch to 2.37 be sufficient? > > The problem is this change is breaking ABI. The behavior of > feenableexcept etc. *is* a part of the ABI. For example, if a not so > careful programmer invokes feenableexcept(FE_INVALID) and then > mistakenly invokes something like acos(1.0000001), before this change > the program will continue to run with a NaN, but after this change it'll > crash with SIGFPE. That's a behavioral change, not an ABI change. > You may argue such a program is buggy, but ABI stability requires that > even such a buggy program should still behave, unless it's invoking an > undefined behavior per the specification **when the program was built**. > For example, on x86_64 Glibc still have memcpy@GLIBC_2.2.5 which is > actually memmove, to support programs built before ISO C (invoking > memcpy with overlapping ranges, doing so was well defined before ISO C > but an undefined behavior today). No, this was done to keep Adobe Flash working: Strange sound on mp3 flash website In general, we do not promise bug-for-bug compatibility. > In this case, the specification before Glibc 2.40 is well defined as > "feenableexcept will do nothing and return an error": there is even a > linker warning actively tells the user this definition! On the other hand, if an application keeps using the stub despite this warning, I think it should be prepared for turning into a real implementation. > Or maybe we can provide both feenableexcept@GLIBC_2_37 and > feenableexcept@GLIBC_2_40 in libm.so.6? I don't know if doing so is > really possible. Yes, it's possible to add a compat symbol for that and keep the do-nothing behavior for old applications. Wouldn't the issue manifest on other architectures with a working (non-stub) feenableexcept implementation? Thanks, Florian