tacle / tacle-bench

TACLe Benchmarks
41 stars 38 forks source link

cast, so fraction works properly on ARM #27

Closed Deffendor closed 2 years ago

Deffendor commented 2 years ago

The fft benchmark result gives a wrong value on ARM processors (Raspberry Pi 4 64-bit, compiled with aarch64-linux-gnu-gcc) because during the initialization there is a conversion/cast/overflow error (not sure exactly). The proposed change just explicitly casts into "long" types before adding the "float" and "int" types together. The change is tested and works on x86 compiled with x86_64-linux-gnu-gcc and the Raspberry Pi4 compiled with aarch64-linux-gnu-gcc. I am not sure if this is the best way for other platforms as well or if there is a more generic way, but fixes it for for the Raspberry Pi 4 at least. If there is a better solution reject this pull request and let me know how that could possibly look like.