octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59830] Architecture-dependent results for ari


From: Rik
Subject: [Octave-bug-tracker] [bug #59830] Architecture-dependent results for arithmetic operations involving NA
Date: Fri, 8 Jan 2021 17:12:32 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

Follow-up Comment #8, bug #59830 (project octave):

Can you try this?


format native-bit
x = NA
x / 4


Also, one thing I notice is that the silent signaling bit for NaN in IEEE is
turned on in Octave according to the IEEE 2008 format.  However, as I noted in
comment #6 and is shown in your comment #7, MIPS systems seem to use a value
of '0' to indicate quiet signaling by default.

Trying to reverse that convention would require using the '-mnan=2008' option
not just for Octave, but for all the libraries it links to.  That sounds hard.


Instead, you might try re-defining the high word of Octave NA so that the
quiet signaling bit is '0' to match MIPS.  As another test, I would ask you to
try changing liboctave/util/lo-ieee.h.


diff -r e4c152e827aa liboctave/util/lo-ieee.h
--- a/liboctave/util/lo-ieee.h  Thu Jan 07 18:34:18 2021 +0100
+++ b/liboctave/util/lo-ieee.h  Fri Jan 08 14:09:31 2021 -0800
@@ -69,7 +69,7 @@ typedef union
 
 #define LO_IEEE_NA_HW_OLD 0x7ff00000
 #define LO_IEEE_NA_LW_OLD 1954
-#define LO_IEEE_NA_HW 0x7FF840F4
+#define LO_IEEE_NA_HW 0x7FF040F4
 #define LO_IEEE_NA_LW 0x40000000
 #define LO_IEEE_NA_FLOAT   0x7FC207A2
 


Apply the patch with 'patch -p1 < mypatch' and then re-compile.

Try


format native-bit
x = NA
y = x / 4
isna (y)



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59830>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]