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 D48FC3858D1E for ; Mon, 15 Jan 2024 14:53:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D48FC3858D1E 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 D48FC3858D1E 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=1705330433; cv=none; b=Q+7IukkjybYGJ3QGeL8ujl3KBHGkRBwnZxNamVEcaKvQZgJFkMLv4urkqlYcD2vBGrfYQ3MCAxBBPJ2PeK5BM5Jzuw0I+9lDntZF9hIBRFH7rh3rdddZJFAaXi105wlV/QTVZu2vVEw/idoR5jv4luhiZW3bToDa2JlrEespGVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705330433; c=relaxed/simple; bh=VECXj7NuePOuFMeIsc8fkPVyvFBZvYjpsD9FGlH6Qzs=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Hm/8qkNzl+5HV8jnn5EAVUFQ/np+hv/mbF3xb+txl8OyArYXVuXw/N1seEAhMyHOGN5fQTHt142epe2ur3EJsPdqVlxrGbDAilYBkdlM+98qBNyZIj1Kd1932L/b+JTMtqcl/8WJc1hMG6JedATmiOc9xwb5DGH9PQOZtbiKYnE= 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 4TDFWy6XGkz684C; Mon, 15 Jan 2024 15:53:50 +0100 (CET) Received: from cederman.got.gaisler.com (h-98-128-223-123.NA.cust.bahnhof.se [98.128.223.123]) by smtp.simply.com (Simply.com) with ESMTPA id 4TDFWy52hfz681D; Mon, 15 Jan 2024 15:53:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaisler.com; s=unoeuro; t=1705330430; bh=yKR4oyic2i95Nw98O+dbQiR4gAvyzsU9vfCIpurgOC4=; h=From:To:Cc:Subject:Date; b=mOSASmxOjZALyPMY1mu4k33KIVkf9akiN1O/dxXSDrgnMUO1hgVq78r+dqo653Xn6 lMSbBx6siMuJvBSk5JN6xNTZ5CM5yF8VrEcG9rTvvwbamwbqthmHzLjLT2TPrTLo6n 45VabxvFaQCsL0U8AgbWGg888Y+KzG0LHpkU7MJk= From: Daniel Cederman To: libc-alpha@sourceware.org Cc: daniel@gaisler.com, andreas@gaisler.com Subject: [PATCH v2] sparc: Force calculation that raises exception Date: Mon, 15 Jan 2024 15:53:43 +0100 Message-Id: <20240115145345.3389246-1-cederman@gaisler.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: Use the math_force_eval() macro to force the calculation to complete and raise the exception. With this change the math/test-fenv test pass. Signed-off-by: Daniel Cederman --- sysdeps/sparc/fpu/fraiseexcpt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sysdeps/sparc/fpu/fraiseexcpt.c b/sysdeps/sparc/fpu/fraiseexcpt.c index 26a7720ec9..87c8f9a4dc 100644 --- a/sysdeps/sparc/fpu/fraiseexcpt.c +++ b/sysdeps/sparc/fpu/fraiseexcpt.c @@ -42,7 +42,7 @@ __feraiseexcept (int excepts) /* One example of an invalid operation is 0/0. */ __asm ("" : "=e" (d) : "0" (c.zero)); d /= c.zero; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Next: division by zero. */ @@ -50,7 +50,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.one)); d /= c.zero; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Next: overflow. */ @@ -58,7 +58,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.max)); d *= d; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Next: underflow. */ @@ -66,7 +66,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.min)); d *= d; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Last: inexact. */ @@ -74,7 +74,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.one)); d /= c.pi; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Success. */ -- 2.40.1