Exophase said:
What I meant by scalar NEON is to use vector pair operations but ignore half of the vector. Actually, I find it rather strange that this never comes up as an option.
You'll admit your comment was poorly worded then
And I agree that gcc should emit "half vector" NEON FP instructions if it can, provided the user is aware this is not correct due to these operations not being IEEE compliant.
Poorly worded, I don't know ;D It's analogous to the option for allowing scalar SSE to be used instead of x87 on GCC. But here this is actually SSE code, not a special mode that executes x87 on SSE. Now granted, there are actual scalar SSE instructions, but in this case I don't think there's really any benefit to doing half over full, except possibly cutting the register space in half.
"vector pair" (two vectors?) or scalar pair (vector = pair)? I'm guessing NEON is optimized for mathematics on graphics then... but I'm in the dark here.
I've been giving some thought to NEON today, and I'd love it if we could spearhead a community project to implement a floating point NEON library for Pandora... a "PandoraNEONMath.h" we could all share. I'd love to help on this, but I have to admit I'm in the dark here. I don't have any assembly experience and looking at a few examples (ffmpeg's v4l code) things are cryptic at best.
That being said I pick up things quickly and feel that if someone could generate some 1.1+1.1=2.2 code (or perhaps (1.1,2.2)+(3.3,4.4)=(4.4,6,6) code if we're talking about 2D vectors) I could probably run with it, as I pick up things pretty quickly. Heck, I hadn't touched C or C++ for 16 years until I started this one up. I'd be especially interested in implementing more complex mathematical functions.
Not having access to a Neon isn't going to help though.
Not very practical ... the problem here is that Neon ( just like VPF on the iPhone ) requires explicit set of instructions to switch into vector mode and these instructions are serializing ( meaning slow).
You can't just leave Neon in that mode because you are going to trip the compiler and thus you will have to switch it back into scalar mode which is again , slooooow.
In other words, using vector mode works best if you need to perform a long set of operations - having simple inline math library where you constantly enable/disable vector mode will kill your performance.
Now, I don't have access to Neon at this point, but I have done a lot of asm coding for the iPhone which is quite similar so I could be wrong ... but , judging from what they have on their site in terms of documentation , it doesn't look promising.