Does gcc use Intel's SSE 4.2 instructions for text processing if available?

前端 未结 2 1907
囚心锁ツ
囚心锁ツ 2021-02-14 14:58

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

Quote from the article:

T

2条回答
  •  深忆病人
    2021-02-14 15:57

    I'm not sure about whether gcc uses that, but it shouldn't matter as text processing is generally done through glibc. If you use the standard string functions from string.h (probably cstring will do the same), and have a reasonable glibc you should be using them automatically.

    I have searched for it and it seems glibc 2.15 (possibly even older ones have it) already has SSE4.2 strcasecmp optimizations:

    http://upstream.rosalinux.ru/changelogs/glibc/2.15/changelog.html

提交回复
热议问题