[Determinism] Add deterministic functions#216
Conversation
|
Are there any specific changes I should look for in |
|
libsleefgnuabi should be unchanged. |
|
Thank you. Does it mean that the deterministic versions of the functions are not compiled in libsleefgnuabi? |
|
At this time, no new functions are added to libsleefgnuabi. |
There was a problem hiding this comment.
I don't understand how the DETERMINISTIC version are tested with CI in this patch. Could you please explain how this is happening? Or point at CI logs showing that the deterministic tests are executed together with the non deterministic ones?
Please modify the body of the functions according to the comment below.
| return ret; | ||
| } | ||
|
|
||
| #if !defined(DETERMINISTIC) |
There was a problem hiding this comment.
Given that the function is always called "xsin" in C code, I would prefer to have the #if !defined(DETERMINISTIC) switch inside the function definition:
EXPORT CONST vdouble xsin(vdouble d) {
#if !defined(DETERMINISTIC)
// original version
#else // #if !defined(DETERMINISTIC)
// deterministic version
#endif // #if !defined(DETERMINISTIC)
}
Could you please apply this change to all the function definitions of this change-set in which you have introduced DETERMINISTIC behavior?
This is quite important because our downstream version of SLEEF is using the attribute aarch64_vector_pcs [1], and having only one declaration instead of two will make merging easier.
[1] https://developer.arm.com/products/software-development-tools/hpc/arm-compiler-for-hpc/vector-function-abi section 2.1
Thank you for explaining, I don't see a need to add deterministic functions to |
The iut programs whose name begins with "iuty" are the iut for the deterministic version of functions. By checking the result of testing with iutysse2, for example, you can be sure that the corresponding deterministic functions passes the accuracy and nonnumber tests. I will add bit-identity tests in the next patch. |
fpetrogalli
left a comment
There was a problem hiding this comment.
These are just minor changes I am asking you to do, in terms of comments. After these, I will approve the review, but I'd prefer you wait for a final OK from @xoofx before merging it to master. Please add him as a reviewer.
| add_test_iut(${TARGET_IUT${SIMD}}) | ||
| list(APPEND IUT_LIST ${TARGET_IUT${SIMD}}) | ||
|
|
||
| string(CONCAT IUTYNAME "iuty" ${LCSIMD}) |
There was a problem hiding this comment.
Please add a comment in the source explaining the difference between iut and iuty
| target_include_directories(${T} PRIVATE ${MPFR_INCLUDE_DIR}) | ||
| endif() | ||
|
|
||
| set(T "tester2y${SCSIMD}${P}") |
There was a problem hiding this comment.
Same here, make sure the distinction between the old tester2 and tester2y is clear
|
|
||
| #if !defined(DETERMINISTIC) && !defined(ENABLE_GNUABI) | ||
|
|
||
| #ifdef ENABLE_ALIAS |
There was a problem hiding this comment.
Can you explain what are these alias for? Please do it in a comment in the code.
xoofx
left a comment
There was a problem hiding this comment.
Amazing. On our side, another priority came into the project, so we have postponed deterministic implementation to Q4 (or worse to Q1/2019), but I will try to plug it into our compiler - around September - at least to check that things are running correctly
|
@xoofx No problem. |
This patch adds implementations of deterministic functions.
The SIMD source files(sleefsimd?p.c) are compiled twice for each vector extension, with DETERMINISTIC macro turned on and off.
Renaming by rename*.h is switched according to DETERMINISTIC macro.
When DETERMINISTIC macro is undefined, the function name xsin will be renamed to Sleef_sind2_u35sse2 with renamesse2.h, for example.
If DETERMINISTIC macro is defined, the function name xsin will be renamed to Sleef_cinz_sind2_u35sse2, for example.
iuty* and tester2y* are added in order to test the newly added deterministic functions. As a consequence, time for testing is increased to almost two times.