-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken Altivec support #84
Comments
Okay I got it compiling by changing the flags, including altivec.h, and following the documentation for gc, here: https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/PowerPC-AltiVec-Built_002din-Functions.html Basically, you can't just do Still wondering about the |
I used to have a PowerBook G4 way back in the day and that's where the AltiVec code was tested on originally. I don't have a PPC machine any more so I can't easily test AV extensions now, but I believe you when you say your fix works. As for not using the vectorized dot product with the IIR filter, I can't remember why I disabled it. I can dig into that to see if there were any issues with it. Try enabling them and then running "make check" to see if it passes the auto tests. |
That will be tough because I'm cross compiling and my target is an embedded system, but I'll check it out. |
Okay, well at least on x86 there was a problem:
I'll get out the debugger |
Oh, I figured out why LIQUID_IIRFILT_USE_DOTPROD is disabled. It's because only the normal filter functions support it. The SOS-related functions don't. The create functions were different but the destroy function was common. It led to mismatched malloc/free calls. I added some code and it passed the check. |
I can reproduce the double-free bug on my side. I committed a fix. I also defaulted to using vectorized dot product with non-SOS methods. I'm seeing a speed improvement of about 2x. Looking at how easy it would be to convert SOS to using vectorized dot product now. |
I added a preprocessor macro ( |
Oh wow, thanks. Interesting stuff. Your code definitely goes further than mine did. I will put a branch with changes to support Altivec on GCC somewhere so you can get to it if you need it. |
current HEAD fails to build on Fedora "rawhide" ppc64le as -faltivec isn't supported in gcc there. |
AFAIK the gcc option is -maltivec, -std=gnu++11 might be needed as well to solve some bool/vector type conflicts. I'll give it a try on my system. |
After adding #include <altivec.h> in dotprod_rrrf.av.c I get
which sounds like a problem with 32 bit (the code expectation) versus 64 bit (the system). |
fix proposed in #136 |
Trying to compile Liquid for modern PPC targets with the NXP SDK:
Perhaps
-faltivec
is a Mac thing. It appears that GCC uses-maltivec -mabi=altivec
. I know autoconfigure has the ability to discover the correct flags, because FFTW does so. I changed the makefile and was able to continue with the compilation. However, it failed at the dotprod module thus:This code doesn't even have
#include "altivec.h"
. Not sure how that was expected to work...Anyway I added that but a few of the errors remain.
I am currently working on fixing the code, I will offer a pull request if I get it working.
One more question:
Why is
LIQUID_IIRFILT_USE_DOTPROD
defined as0
in iirfilt? If I can use SIMD acceleration for my filters, I'd like to do that.thanks.
The text was updated successfully, but these errors were encountered: