gcc是否使用英特尔的SSE 4.2指令进行文本处理(如果可用)? [英] Does gcc use Intel's SSE 4.2 instructions for text processing if available?

查看:565
本文介绍了gcc是否使用英特尔的SSE 4.2指令进行文本处理(如果可用)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了这里英特尔推出 SSE 4.2指令用于加速字符串处理。

I read here that Intel introduced SSE 4.2 instructions for accelerating string processing.

引用文章:


SSE 4.2指令集,首先在英特尔的Core i7,
提供了使用
SIMD操作处理字符数据的字符串和文本处理指令(STTNI)。虽然最初
是为加速字符串,文本和XML处理而设计的,但是
这些指令的强大的新功能在
这些域外是有用的,值得重新搜索和识别
阶段的众多应用程序使用STTNI来提高
的性能

The SSE 4.2 instruction set, first implemented in Intel's Core i7, provides string and text processing instructions (STTNI) that utilize SIMD operations for processing character data. Though originally conceived for accelerating string, text, and XML processing, the powerful new capabilities of these instructions are useful outside of these domains, and it is worth revisiting the search and recognition stages of numerous applications to utilize STTNI to improve performance




    <的这些说明如果可用?
  • 如果是,哪个版本?

  • 如果没有,是否有任何开源库
    提供此功能?

  • 推荐答案

    关于软件库,我会看看Agner Fog的asmlib。它有许多例程的集合,包括使用SSE4.2的几个字符串操作,在汇编中优化。我使用的一些其他有用的函数返回CPU上的信息,例如每个级别的高速缓存大小和支持哪些扩展(例如SSE4.2)。

    In regards to software libraries I would look at Agner Fog's asmlib. It has a collection of many routines, including several string manipulation ones which use SSE4.2, optimized in assembly. Some other useful functions it provides which I use return information on the CPU such as the cache size for each level and which extensions (e.g. SSE4.2) are supported.

    a href =http://www.agner.org/optimize/asmlib.zip =nofollow> http://www.agner.org/optimize/asmlib.zip

    http://www.agner.org/optimize/asmlib.zip

    要在GCC中使用-msse4.2来启用SSE4.2,或者如果你有一个带有AVX的处理器,请使用-mavx

    To enable SSE4.2 in GCC compile with -msse4.2 or if you have a processor with AVX use -mavx

    这篇关于gcc是否使用英特尔的SSE 4.2指令进行文本处理(如果可用)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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