SSE slower than FPU?

前端 未结 3 737
孤城傲影
孤城傲影 2021-02-08 19:32

I have a large piece of code, part of whose body contains this piece of code:

result = (nx * m_Lx + ny * m_Ly + m_Lz) / sqrt(nx * nx + ny * ny + 1);
3条回答
  •  误落风尘
    2021-02-08 20:05

    There are several problems :

    1. You will not see much benefits from using SSE instructions in such operations, because the SSE instructions are supposed to be better on parallel operations (that is, multiplying several values at the same time). What you did is a misuse of the SSE
    2. do not set the values, use the pointer to the 1st value in the array, but then your values are not in the array
    3. do not extract and copy values into the array. That is also a misuse of SSE. The result is supposed to be in an array.

提交回复
热议问题