SSE SSE2和SSE3为GNU C ++ [英] SSE SSE2 and SSE3 for GNU C++

查看:425
本文介绍了SSE SSE2和SSE3为GNU C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个简单的教程我起床的速度在SSE,SSE2和SSE3在GNU C ++?你该怎么办code优化SSE?

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?

推荐答案

对不起,不知道教程。

您最好的选择(恕我直言)是通过内在功能英特尔提供包裹(一般)单SSE指令使用SSE。
这些都是通过一组命名的包含文件可用* mmintrin.h例如xmmintrin.h是原来的SSE指令集。

Your best bet (IMHO) is to use SSE via the "intrinsic" functions Intel provides to wrap (generally) single SSE instructions. These are made available via a set of include files named *mmintrin.h e.g xmmintrin.h is the original SSE instruction set.

开始熟悉英特尔的优化参考手册的内容是一个好主意(见4.3.1.2对内部函数的一个例子)和SIMD部分是必不可少的读物。该指令集的参考手册是pretty也有帮助,因为每个指令的文件包括它对应的内在的功能。

Begin familiar with the contents of Intel's Optimization Reference Manual is a good idea (see section 4.3.1.2 for an example of intrinsics) and the SIMD sections are essential reading. The instruction set reference manuals are pretty helpful too, in that each instruction's documentation includes the "intrinsic" function it corresponds to.

不要的花一些时间检查由内部函数编译器产生的汇编(你会学到很多东西)和貌相/性能测试(你会避免浪费时间SSE-ING $ C $下上功夫小回报率)。

Do spend some time inspecting the assembler produced by the compiler from intrinsics (you'll learn a lot) and on profiling/performance measurement (you'll avoid wasting time SSE-ing code for little return on the effort).

更新2011-05-31:有内在和矢量在瓦格纳雾的优化PDF文件<的一些非常好的覆盖/ A>(感谢的),虽然这是一个位S $ p $垫有关(如第一个和的second 之一)。这些都是不完全教程资料(其实有一个这些手册是不适合初学者的警告),但他们不正确地对待SIMD作为更大的优化工具箱的只是其中的一部分(无论是通过ASM,内部函数或编译器向量化使用)。

Update 2011-05-31: There is some very nice coverage of intrinsics and vectorization in Agner Fog's optimization PDFs (thanks) although it's a bit spread about (e.g section 12 of the first one and section 5 of the second one). These aren't exactly tutorial material (in fact there's a "these manuals are not for beginners" warning) but they do rightly treat SIMD (whether used via asm, intrinsics or compiler vectorization) as just one part of the larger optimization toolbox.

更新2012年10月4日: A <一个href=\"http://www.linuxjournal.com/content/introduction-gcc-compiler-intrinsics-vector-processing\">nice GCC的矢量内在小Linux杂志的文章这里值得一提。不仅仅是SSE更普遍(包括PPC和ARM扩展太)。有一个在<一个引用收集好href=\"http://www.linuxjournal.com/content/introduction-gcc-compiler-intrinsics-vector-processing?page=0,4\">last页面,吸引了我的注意英特尔的内在手册

Update 2012-10-04: A nice little Linux Journal article on gcc vector intrinsics deserves a mention here. More general than just SSE (covers PPC and ARM extensions too). There's a good collection of references on the last page, which drew my attention to Intel's "intrinsics manual".

这篇关于SSE SSE2和SSE3为GNU C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆