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

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

[Octave-bug-tracker] [bug #64361] sinc() return NaN on sinc(-1:0.20:1-0.


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #64361] sinc() return NaN on sinc(-1:0.20:1-0.20) expression
Date: Thu, 29 Jun 2023 16:20:24 -0400 (EDT)

Follow-up Comment #26, bug #64361 (project octave):

Rik:

I agree that we want all the ways of accessing or viewing range elements to
produce the same results.  It seems that it should be as simple as using the
same expression in the elem functions as we use in the loop in the array_value
function, but as you show in comment #25, for some compiler optimization
levels or code generation options, that's not always true.

What happens if you make the following change to the definition of the
array_value function and still compile with the -march=x86-64-v3 option?


diff --git a/liboctave/array/Range.h b/liboctave/array/Range.h
--- a/liboctave/array/Range.h
+++ b/liboctave/array/Range.h
@@ -273,6 +273,7 @@ public:
     return array_value ().diag (k);
   }
 
+  __attribute__ ((target ("no-avx")))
   Array<T> array_value () const
   {
     octave_idx_type nel = numel ();


If I understand correctly

I'm not proposing this exact change as the attribute needs to be used only if
the compiler accepts it.  I'm just curious to know whether it is a possible
route to a solution for this bug.

We could also eliminate differences in the array_value/elem/display functions
if we abandoned the size savings of the range<T> class, but then we could
still have differences in behavior for different Octave builds due to
different optimization or code generation options.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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