From patchwork Tue Mar 19 21:42:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 87387 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34DC43858C39 for ; Tue, 19 Mar 2024 21:43:30 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 5C2F9385841F for ; Tue, 19 Mar 2024 21:42:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C2F9385841F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C2F9385841F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::236 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710884580; cv=none; b=OGhGTB4vP2vifF+CLOzx9cBTvuFzdoB8JIKR2dwhT2vtTi1sIbj1KMsSsDH4PfBPS4DuHaJcKyHaDinRUcYkRuOHCWdphc7KpiM0hwYi+RDIQOAXc2b1RzeFO6jmxLzEuMNk19cfLb2JJl2XMrbMiLumLKBV+4+gWgvKKUdc+6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710884580; c=relaxed/simple; bh=9vm67h6z2zNPIDrHUWgEByQkFwcbMgGgzD38RVAwz08=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lGS8FPYwG6wlgi883/PoJ3cef98fLJCqKuXy9F1KXp/ybfnRJI18aF7fGtpx9k2hiNz7DkFxzKbvV3N7vM7Rm7hlIzLIIOJADcZ0Ccwp6PLguaSUFoYsovuImRBr+t3S0vHyWR9+UeWxXOceyM0dQ+WUQJ9RHNdVzMapUr5SfXI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2d68c6a4630so5413701fa.3 for ; Tue, 19 Mar 2024 14:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710884576; x=1711489376; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9z9qLOgTMYvVX0wXoZxk7qct+eKNn8JwO/lREqZCH6s=; b=RH2fdEMvvmcPuu6LyFKd6e+wQ+Ya5mh6gMInluhw6eSko4MQP++ASakHqOb/PoGd/L IO5Ycza7E95pKypN/WkQuEEorlddYUpjTOui5QUFoeCqGc7y1qlD/vGpYxPX3WFhHmbr mSkjUHQnxDrA7oEeYfAlwFqVrstqZ+gESiQUrJUENFRW8snyuBTMzA/D8ylsUKxHmlXx cB8XQMt7YY2Csm1/xUJlVtukiR50sEPLRBvfsgiQQJuwbW73EnJv4pCxFgdiVDVWLWkr H8k2v6+QTtlYxZ91H0xIevAkA4SRfBuAC4EfQyOmP2I5UFmt0BkI0TPRZULv+lnMjUnd vOpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710884576; x=1711489376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9z9qLOgTMYvVX0wXoZxk7qct+eKNn8JwO/lREqZCH6s=; b=gTlXz3Anik8TtC/QKHLL7DYjn+AHLVHaP4t5XFTtGqVz0TyMkZ1sXYY7ISiyWTADL7 W+i4ewhGz8GJfGdVJAP9i0BAKckbJn2FCrq2UsVgN+jMQ/8G9YF+Ucs5JMRy866Wcbna a/kZ6FfIqIT4vEKL6xD9lUcqHvpsHNu8aN0fmYiynOZM55n1xfQxiy8b5VetzVJ48asS ln8t77WYhh9FrfXJnPs2Wm6Rb+c1tDE1u7aD0m1ZaWo1GdstMBpTmEW+o9QHCQUOwLVh Vs6DmcwXtiRERKYY+xvi1PA8J19wjx3j0otZJ5I/n29GDLCmDAfXhLJNw549Q2veP209 V9kw== X-Gm-Message-State: AOJu0Yz6fevvux2HOuB4puOcD5NNn7KcxX7mCp5O5ihjiPyPT4h+mWEd 6BHJlZLWaJsOyUC+KNc98PpNTAsryvUIXOEujPlZh5crE40bg5jW3btcUgNz X-Google-Smtp-Source: AGHT+IHNv0UB0RRLVsaSeaiS0h3QlgYQpvcQZPkH8mzY9Wp3lcE8wSTkQcWK2XDEnkMYYaRji754Vg== X-Received: by 2002:a2e:8518:0:b0:2d4:764f:87ea with SMTP id j24-20020a2e8518000000b002d4764f87eamr2970125lji.34.1710884575603; Tue, 19 Mar 2024 14:42:55 -0700 (PDT) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id p11-20020a05600c358b00b0041408af4b34sm107553wmq.10.2024.03.19.14.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 14:42:54 -0700 (PDT) From: Stafford Horne To: GLIBC patches Cc: Linux OpenRISC , Stafford Horne Subject: [PATCH 3/4] or1k: Only define fpu rouding and exceptions with hard-float Date: Tue, 19 Mar 2024 21:42:43 +0000 Message-ID: <20240319214244.736981-4-shorne@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319214244.736981-1-shorne@gmail.com> References: <20240319214244.736981-1-shorne@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org This test failure: math/test-fenv If rounding mode and exception macros are defined then the fenv tests run and always fail. This patch adds an ifdef using the __or1k_hard_float__ macro provided by gcc to avoid defining these fenv macros when they cnnot be used. This is similar to what is done in csky. Note, I will post the or1k hard-float support soon. So, I prefer to leave the hard-float bits here for now. --- sysdeps/or1k/bits/fenv.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sysdeps/or1k/bits/fenv.h b/sysdeps/or1k/bits/fenv.h index 587039ca03..01267805e6 100644 --- a/sysdeps/or1k/bits/fenv.h +++ b/sysdeps/or1k/bits/fenv.h @@ -21,6 +21,7 @@ # error "Never use directly; include instead." #endif +#ifdef __or1k_hard_float__ /* Define bits representing exceptions in the FPCSR status word. */ enum { @@ -51,6 +52,24 @@ enum #define FE_UPWARD (0x2 << 1) #define FE_DOWNWARD (0x3 << 1) +#else + +/* In the soft-float case only rounding to nearest is supported, with + no exceptions. */ + +enum + { + __FE_UNDEFINED = -1, + + FE_TONEAREST = +# define FE_TONEAREST 0x0 + FE_TONEAREST + }; + +# define FE_ALL_EXCEPT 0 + +#endif /* __or1k_hard_float__ */ + /* Type representing exception flags. */ typedef unsigned int fexcept_t;