Hello,
This simple program (below) compiles and runs, but it does not work correctly. The output I get is
> nan 2 3 4
but I should get something like
> 2 3 1 4
Why that ???
(Compiled with GNU Compiler GCC 2.96 and 3.2 ...)
Thanks for help,
Fredwurst
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
float vec1[4] = {1,2,3,4};
float vec2[4];
__asm__ __volatile__ ("
movaps %1, %%xmm0;
pshufd $0x78, %%xmm0, %%xmm1;
movaps %%xmm0, %0;
"
: "=m"(vec2[0])
: "m"(vec1[0])
);
cout << vec2[0] << " " << vec2[1] << " " <<
vec2[2] << " " << vec2[3] << endl;
return 0;
}
This simple program (below) compiles and runs, but it does not work correctly. The output I get is
> nan 2 3 4
but I should get something like
> 2 3 1 4
Why that ???
(Compiled with GNU Compiler GCC 2.96 and 3.2 ...)
Thanks for help,
Fredwurst
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
float vec1[4] = {1,2,3,4};
float vec2[4];
__asm__ __volatile__ ("
movaps %1, %%xmm0;
pshufd $0x78, %%xmm0, %%xmm1;
movaps %%xmm0, %0;
"
: "=m"(vec2[0])
: "m"(vec1[0])
);
cout << vec2[0] << " " << vec2[1] << " " <<
vec2[2] << " " << vec2[3] << endl;
return 0;
}