Equivalent C code for _mm_ type functions
What is the simple equivalent C code to overc开发者_如何学JAVAome __ functions like _mm_store_ps
, _mm_add_ps
, etc. Please specify anyone function through an example with the equivalent C code.
Why are these functions used?
Based on your previous similar questions it sounds like you're trying to solve the wrong problem. You have some existing SSE code for face detection which is crashing because you are passing misaligned data to SSE routines that require 16 byte aligned data. In previous questions people have told you how to fix this misalignment (use _mm_malloc on Windows, or memalign/posix_memalign on Linux) but you seem to be ignoring this advice and instead you are wrongly assuming that you need to re-write all the SSE code. Take some time to understand what SSE is, how your SSE code works, why it needs 16 byte alignment and how to achieve this. Your existing SSE code should run fine on either Windows or Linux so long as you fix your data misalignment problem, which should be a relatively simple task once you understand what you are doing.
MSDN shows psuedo code for the first function,
void _mm_store_ps(float *p, __m128 a );
Returns:
p[0] := a0
p[1] := a1
p[2] := a2
p[3] := a3
http://msdn.microsoft.com/en-us/library/s3h4ay6y(v=vs.80).aspx
精彩评论