lua-users home
lua-l archive

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



After sending the message I realised how lame it was.  Sorry.

The interesting part is, how are people actually using -ffast-math with connection to Lua. And can a Lua that has been stripped of proper nan and inf functionality still even be called Lua? Also, with -ffast-math, Lua code still expects certain behaviour (via luai_numisnan macro) instead of disabling all code paths having to do with nans.

-asko



Miles Bader kirjoitti 8.4.2009 kello 1:08:

Asko Kauppi <askok@dnainternet.net> writes:
I've been revising the LNUM patch (more of that later) and spend several
hours today trying to understand what exactly -ffast-math does  with
regard to NaN's (not-a-numbers).

Basically, it does not seem to know them. It gives nan==nan and other
no-can-dos that I regard as Completely Evil as to Lua compatibility.

There's a list of what exactly -ffast-math does in the gcc manual (see
Taj Khattra's followup for a quote), but I just wanted to note that you
can tune it by following the -ffast-math option with finer-grained
options that reverse parts of its effect.

E.g., in my proggie, I use:

-ffast-math -fno-finite-math-only -ftrapping-math -fno-associative- math

"-fno-finite-math-only" and "-ftrapping-math" reverse some of the usual
effect of -ffast-math (-fno-associative-math is just to silence a
warning, as -ftrapping-math automatically implies that anyway).

-Miles

--
o The existentialist, not having a pillow, goes everywhere with the book by
 Sullivan, _I am going to spit on your graves_.