SSE SSE2 and SSE3 for GNU C++

前端 未结 5 2000
清酒与你
清酒与你 2020-12-07 07:35

Is there a simple tutorial for me to get up to speed in SSE, SSE2 and SSE3 in GNU C++? How can you do code optimization in SSE?

5条回答
  •  广开言路
    2020-12-07 08:05

    The most simple optimization to use is to allow gcc to emit SSE code.

    Flags: -msse, -msse2, -msse3, -march=, -mfpmath=sse

    For a more concise list about 386 options, see http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options , more exact documentation for your specific compiler version is there: http://gcc.gnu.org/onlinedocs/ .

    For optimization, always check out Agner Fog's: http://agner.org/optimize/ . I think he doesn't have SSE tutorials for intrinsics, but he has some really neat std-c++ tricks and also provides lots of information about coding SSE assembly (which can often be transcribed to intrinsics).

提交回复
热议问题