]> https://gitweb.dealii.org/ - dealii.git/commit
Test: cgal/cgal_mesh_criteria: disable floating point exceptions 16858/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 5 Apr 2024 19:57:13 +0000 (14:57 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 6 Apr 2024 02:47:27 +0000 (21:47 -0500)
commit377b23e009792094e805eef477b0a0a412a17678
tree7b8fd7a0349f5dcf25a3a7456c1eabe819d1dcd9
parenta0a0cf3300210274567fd712a57225c2338e28dd
Test: cgal/cgal_mesh_criteria: disable floating point exceptions

We trigger a (deliberate) floating point exception in the CGAL (header)
library:
```
    // The multiplications could produce some NaN, with 0 * inf. Replacing it with inf is safe.
    // min(x,y) (the order is essential) returns its second argument when the first is NaN.
    // An IEEE 754-2019 maximum could help.
    __m128d big = IA::largest().simd();
->  __m128d x1 = _mm_mul_pd(aa,bz);                       // {-ai*bi,as*bs}
    //x1 = _mm_min_pd(x1,big); // no NaN
    __m128d x2 = _mm_mul_pd(aa,c);                        // {-ai*bs,as*bi}
    x2 = _mm_min_pd(x2,big); // no NaN
    __m128d x3 = _mm_mul_pd(ap,bz);                       // {-as*bi,ai*bs}
    //x3 = _mm_min_pd(x3,big); // no NaN
    __m128d x4 = _mm_mul_pd(ap,c);                        // {-as*bs,ai*bi}
    x4 = _mm_min_pd(x4,big); // no NaN
```

Thus, disable floating point exceptions for the test.
tests/cgal/cgal_mesh_criteria.cc

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.