There have been several requests for providing vectorized SLEEF functions in a header file,
#230
It turned out that this functionality is not too hard to implement.
We can use C preprocessor (cpp) to generate such header files.
We will apply cpp a few times to sleefsimddp.c and sleefsimdsp.c with SLEEF_GENHEADER macro and other appropriate macros defined.
Part of the codes in misc.h and helper files will be guarded with #if, so that irrelevant lines will not appear in the resulting header files.
A header file is generated for each vector extension.
The resulting header files contain inline functions defined in dd.h and df.h, and functions defined in sleefsimddp.c and sleefsimdsp.c with all the function names renamed to the ones specified in the standard SLEEF API.
Since the inline functions in helper files are not renamed, those header files with different vector extensions cannot be included from a same file.
An example of generated header file can be seen at the following URL.
http://www.aist-nara.ac.jp/~n-sibata/header_example/sleefinline_avx2.h
Please see the example of generated header file and let me know you thought.
There have been several requests for providing vectorized SLEEF functions in a header file,
#230
It turned out that this functionality is not too hard to implement.
We can use C preprocessor (cpp) to generate such header files.
We will apply cpp a few times to sleefsimddp.c and sleefsimdsp.c with SLEEF_GENHEADER macro and other appropriate macros defined.
Part of the codes in misc.h and helper files will be guarded with #if, so that irrelevant lines will not appear in the resulting header files.
A header file is generated for each vector extension.
The resulting header files contain inline functions defined in dd.h and df.h, and functions defined in sleefsimddp.c and sleefsimdsp.c with all the function names renamed to the ones specified in the standard SLEEF API.
Since the inline functions in helper files are not renamed, those header files with different vector extensions cannot be included from a same file.
An example of generated header file can be seen at the following URL.
http://www.aist-nara.ac.jp/~n-sibata/header_example/sleefinline_avx2.h
Please see the example of generated header file and let me know you thought.