Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent reordering of some floating point op under fast-math
  • Loading branch information
serge-sans-paille committed Oct 12, 2021
commit 66e950d2e90c29f826f0ad2c842861c4b6ab4b42
4 changes: 2 additions & 2 deletions include/xsimd/arch/generic/xsimd_generic_math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1733,8 +1733,8 @@ namespace xsimd {
// to v. That's not what we want, so prevent compiler optimization here.
// FIXME: it may be better to emit a memory barrier here (?).
#ifdef __FAST_MATH__
volatile batch_type d0 = v + t2n;
batch_type d = *(batch_type*)(void*)(&d0) - t2n;
volatile auto d0 = (v + t2n).data;
batch_type d = batch_type(d0) - t2n;
#else
batch_type d0 = v + t2n;
batch_type d = d0 - t2n;
Expand Down