From owner-freebsd-bugs Fri May 17 0:10:20 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5787E37B404 for ; Fri, 17 May 2002 00:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4H7A1d49724; Fri, 17 May 2002 00:10:01 -0700 (PDT) (envelope-from gnats) Received: from alvman.Haakh.de (p50816A36.dip.t-dialin.net [80.129.106.54]) by hub.freebsd.org (Postfix) with ESMTP id 98DBC37B400 for ; Fri, 17 May 2002 00:01:12 -0700 (PDT) Received: from alvman.Haakh.de (localhost [127.0.0.1]) by alvman.Haakh.de (8.12.3/8.11.6) with ESMTP id g4H71BNi000805 for ; Fri, 17 May 2002 09:01:12 +0200 (CEST) (envelope-from ah@alvman.Haakh.de) Received: (from ah@localhost) by alvman.Haakh.de (8.12.3/8.12.3/Submit) id g4H71BVv000804; Fri, 17 May 2002 09:01:11 +0200 (CEST) Message-Id: <200205170701.g4H71BVv000804@alvman.Haakh.de> Date: Fri, 17 May 2002 09:01:11 +0200 (CEST) From: Andreas Haakh Reply-To: Andreas Haakh To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/38170: fpgetmask, fpsetmask yield strange results Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 38170 >Category: kern >Synopsis: fpgetmask, fpsetmask yield strange results >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 17 00:10:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Andreas Haakh >Release: FreeBSD 4.6-RC i386 >Organization: Ingenieurbüro für Baustatik >Environment: System: FreeBSD alvman.Haakh.de 4.6-RC FreeBSD 4.6-RC #0: Fri May 17 07:18:23 CEST 2002 root@alvman.Haakh.de:/usr/obj/usr/src/sys/ALVMAN i386 i686-class CPU >Description: I tried to modify the default fp_exception-mask. The results from fpgetmask and fpsetmask (and probably some other fp[sg]et-routines) are buggy. >How-To-Repeat: The following codeexample shows this strange behaviour: #include #include int main (void) { fp_except_t except, res; res=fpgetmask(); printf ("fp_except from fpgetmask: \t0x%02x!\n", res); except = FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_STK; printf ("attempt to set fp_except to: \t0x%02x!\n", except); res=fpsetmask(except); printf ("fp_except from fpsetmask: \t0x%02x!\n", res); res=fpgetmask(); printf ("fp_except from fpgetmask: \t0x%02x!\n", res); res=fpsetmask(except); printf ("retry to set fp_except to:\t0x%02x!\n", except); res=fpsetmask(except); printf ("fp_except from fpsetmask: \t0x%02x!\n", res); res=fpgetmask(); printf ("fp_except from fpgetmask: \t0x%02x!\n", res); exit (except); } The results from this prog are: fp_except from fpgetmask: 0x00! attempt to set fp_except to: 0x4d! fp_except from fpsetmask: 0x3f! fp_except from fpgetmask: 0x0d! retry to set fp_except to: 0x4d! fp_except from fpsetmask: 0x32! fp_except from fpgetmask: 0x0d! >Fix: correct the inline functions and/or macros in I have not enough knowledge to do it myself... >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message