Re: Array Byte swapping with SSE
Re: Array Byte swapping with SSE
- Subject: Re: Array Byte swapping with SSE
- From: Jeremy Sagan <email@hidden>
- Date: Thu, 27 Jul 2006 14:38:43 -0400
Hello Eric,
Thanks for the quick response. I am aware of how to swap using
standard methods and I understand that this is not a compute
intensive operation. On the other hand what I want to know is how to
do this using SSE as a small example like this will likely bootstrap
me into writing the code that I need to, that simply begins with an
endian swap and then does much more, like convert to float, vector
multiplication and addition, etc, etc, I have looked at using the
Accelerate framework but I do not see that as a good fit.
Also I am looking for a reference to the C interface to SSE. Are the
only references the Intel Pentium manuals?
Jeremy
On Jul 27, 2006, at 2:24 PM, Eric Albert wrote:
On Jul 27, 2006, at 11:15 AM, Jeremy Sagan wrote:
Does anyone have any example code for endian byte swapping an
aligned array of SInt16's using SSE on intel Macs?
I think is should be the equivalent of a sequence of loads,
permutes, and stores but I am not sure where to find the C
interface documentation for SSE and I am very interested to see
sample code like this.
Unless your array is huge, you'll usually get reasonable
performance from a simple for loop:
#include <libkern/OSByteOrder.h>
for(int i = 0; i < length; i++) {
array[i] = OSSwapInt16(array[i]);
}
That's the main reason why we haven't added bulk byte swappers to
the system yet. We've found that byte swapping rarely shows up as
a performance bottleneck for us.
If it is a performance bottleneck for you, you might want to ask
about this on the perfoptimization-dev mailing list.
-Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden