Make variables local to loops, with appropriate types. These variables
are not read after the loop without being reset first, so this patch
doesn't change behaviour.
These variables should now be used for one purpose only, making it
easier to reason about the code. This will make future refactoring
easier.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
gWimpyBufferSize is never modified and is actually not used to modify
the number of tests -- gWimpyReductionFactor is used for that purpose by
some tests, but not all.
This patch removes this unnecessary global variable to simplify the
codebase, and reduce differences between tests.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Use one loop to read buffers from device, with the last read operation
blocking until complete.
This pattern cannot be elegantly refactored just yet, mainly for two
reasons:
- Some tests use goto statements to clean their resources.
- Some tests (not modified in this patch) only use blocking read
operations.
Once code is further unified, this pattern can be refactored into a
helper function.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Remove code for runtime measurement
The GetTime() and associated functions are not fully implemented on
Linux. This functionality is assumed to be untested, or unused at best.
Reduce differences between tests by removing this unnecessary feature.
It can be (re-)implemented later, if desired, once the math_brute_force
component is in better shape.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Coalesce if-statements
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Keep else branch
Address comments.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Improve format.
The binary_operator tests are left untouched by this commit as they
require some non-automatic changes.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Code is moved to reduce the differences between tests for single- and
double-precision.
Improve consistency in double-literal.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Add assertion to prove isNextafter is true iff the builtin is nextafter()
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Fold functions for nextafter
There is no need to differentiate nextafter() from other binary builtin
functions when creating the vtbl entries.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Split math_brute_force files
Split each file into two: one covering float and the other covering
double. The goal is to make it possible to diff files to identify bugs
more easily, reduce differences between code for float and double, and
ultimately reduce code duplication in all math_brute_force.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Address clang-format issues
In be936303 (Remove dead code in math_brute_force (#1117), 2021-01-20)
the code was reformatted using git-clang-format, which apparently is less
reliable than clang-format itself when changes occur in large files.
With the previous split of large files, git-clang-format complains about
the format of code originating from binary_two_results_i.cpp.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>