Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reyoung/avx_mathfun
AVX-optimized sin(), cos(), exp() and log() functions
https://github.com/reyoung/avx_mathfun
Last synced: about 2 months ago
JSON representation
AVX-optimized sin(), cos(), exp() and log() functions
- Host: GitHub
- URL: https://github.com/reyoung/avx_mathfun
- Owner: reyoung
- Created: 2016-04-13T12:29:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T14:22:11.000Z (about 3 years ago)
- Last Synced: 2023-03-11T22:07:06.867Z (almost 2 years ago)
- Language: C
- Homepage:
- Size: 7.81 KB
- Stars: 89
- Watchers: 7
- Forks: 22
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## AVX-optimized sin(), cos(), exp() and log() functions
### Introduction
Origin from [here](http://software-lisc.fbk.eu/avx_mathfun/). But fix several problem for it.* The origin file is not compatible with GCC 4.9+.
* because header immintrin.h is changed between [gcc 4.8](https://github.com/gcc-mirror/gcc/blob/gcc-4_8_5-release/gcc/config/i386/immintrin.h)
and [gcc 4.9](https://github.com/gcc-mirror/gcc/blob/gcc-4_9_0-release/gcc/config/i386/immintrin.h)
* In gcc 4.9, AVX2 function will always be defined whenever -mavx2 is set or not. So there are multi-define problems
when use gcc 4.9 before.
* In macos, the clang also use the header like gcc 4.9
* I just add "avx_" prefix for each function in AVX2 to solve this problem.
* There is a warning in int constant variable define.
* Just add a cast to fix it.
* AVX2 use intrinsics like '_mm256_and_si256', '_mm256_andnot_si256'
* Change origin header to fix it. Make it work well in both avx and avx2.### Test and Compile
Test programs use cmake. Just do
# Install gtest before, and make sure your computer support avx2/avx.
mkdir build
cmake -D CMAKE_BUILD_TYPE=Release ..
make -j 2
./test_avx2 ; ./test_avxIt will run some unittest.
### How to use this library
Just include "avx_mathfun.h" in your project.
### License
The origin [file](http://software-lisc.fbk.eu/avx_mathfun/) uses zlib license. It is not changed.