forked from FFTW/fftw3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid transforming uninitalized data.
In r2c/c2r transforms when using 4-way SIMD, sometimes FFTW uses the following hack: to transform an odd number of inputs, it copies the input into a buffer that holds space for one extra input; it transforms the buffer (now comprising an even number of inputs, as required by SIMD); it copies back the odd number of transformed inputs, ignoring the padding element. The extra input was uninitialized until now. This is ok because we ignore the transform of the uninitialized input. Transforming uninitialized data may cause floating-point exceptions, an effect that is observable. This patch initializes the additional elements to zero, thus avoiding the problem. This patch also includes a test, but the test is disabled by default because it is nonportable. To observe the FP exception, one must use feenableexcept(), which appears to be a GNU-ism.
- Loading branch information
1 parent
2493129
commit cde4559
Showing
4 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters