View Issue Details

IDProjectCategoryView StatusLast Update
0004910Spring engineGeneralpublic2015-07-22 16:32
Reporterabma Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version100.0+git 
Summary0004910: check if SIGNAL_NANS can be replaced by feenableexcept()
Descriptionif not, it could be made runtime changeable / always enabled and SIGNAL_NANS removed.
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

abma

2015-07-20 15:26

administrator   ~0015020

maybe as alternative if feenableexcept() / _control87() leads to the same result:
http://en.cppreference.com/w/cpp/numeric/fenv

abma

2015-07-20 15:28

administrator   ~0015021

Last edited: 2015-07-20 15:31

with this (--std=c++11)

// g++ -fno-signaling-nans -std=c++11 test.cpp -o signal-nans
#include <stdio.h>
#include <cfenv>

int main()
{
        feenableexcept(FE_ALL_EXCEPT);
        std::feraiseexcept(FE_ALL_EXCEPT);
        printf("%f\n", 1.0f / 0.0f);
        return 0;
}


i get Floating point exception (core dumped), soo...?!

jK

2015-07-22 03:53

developer   ~0015026

The engine uses that already.
Just for lua it's disabled, cause: any usage of math.huge would trigger a SIGFPE.
Crashing on such is not an option, so the engine only handles NANs when they leave lua & enter engine code.

abma

2015-07-22 11:55

administrator   ~0015028

code reference:

https://github.com/spring/spring/blob/036b798fefe0e4a3bc82be8ecb8aa8806a6a9263/rts/System/Sync/FPUCheck.cpp#L108

so, more specific: anything against making #if defined(__SUPPORT_SNAN__) a config setting?

jK

2015-07-22 16:32

developer   ~0015029

Last edited: 2015-07-22 16:32

only when SIGNAL_NANS is enabled, else it would raise in lua too and cause a lot crashes.

Issue History

Date Modified Username Field Change
2015-07-20 15:22 abma New Issue
2015-07-20 15:22 abma Description Updated
2015-07-20 15:26 abma Note Added: 0015020
2015-07-20 15:28 abma Note Added: 0015021
2015-07-20 15:31 abma Note Edited: 0015021
2015-07-20 15:32 abma Summary check if SIGNAL_NANS is slower than regular build => check if SIGNAL_NANS can be replaced by feenableexcept()
2015-07-22 03:53 jK Note Added: 0015026
2015-07-22 11:55 abma Note Added: 0015028
2015-07-22 16:32 jK Note Added: 0015029
2015-07-22 16:32 jK Note Edited: 0015029