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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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