c - SIMD (SSE) instruction for division in GCC -


i'd optimize following snippet using sse instructions if possible:

/*  * data structure  */ typedef struct v3d v3d; struct v3d {     double x;     double y;     double z; } tmp = { 1.0, 2.0, 3.0 };  /*  * part should "optimized"  */ tmp.x /= 4.0; tmp.y /= 4.0; tmp.z /= 4.0; 

is possible @ all?

i've used simd extension under windows, have not yet under linux. being said should able take advantage of divps sse operation divide 4 float vector 4 float vector. using doubles, you'll want sse2 version divpd. forgot, make sure build -msse2 switch.

i found page details sse gcc builtins. looks kind of old, should start.

http://ds9a.nl/gcc-simd/


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -