Commit cd4a490
ray: simplify nan checking by creating a macro.
Avoids the #ifdef forest and code duplication resulting from it.
There was mismatch in the two code paths, see [1] and [2], and this
commit avoids repeating the same mistake.
While there, use isnan() instead of fpclassify() == FP_NAN for the case
where isnanf() isn't available.
We use isnanf() (if available) instead of isnan() due to [3]:
I initially used isinf() and isnan(), but those ended up breaking
when using GCC because it tried to promote floats to doubles, and
the results wouldn't match any more—especially when using GCC
vectorisation.
It could very well be a bug in GCC.
[1] #223
[2] https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3976
[3] #174 (comment)1 parent f532ede commit cd4a490
2 files changed
+12
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
| |||
555 | 550 | | |
556 | 551 | | |
557 | 552 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
| 553 | + | |
565 | 554 | | |
566 | | - | |
| 555 | + | |
567 | 556 | | |
568 | | - | |
569 | 557 | | |
570 | 558 | | |
571 | 559 | | |
| |||
582 | 570 | | |
583 | 571 | | |
584 | 572 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
| 573 | + | |
592 | 574 | | |
593 | | - | |
| 575 | + | |
594 | 576 | | |
595 | | - | |
596 | 577 | | |
597 | 578 | | |
598 | 579 | | |
| |||
0 commit comments