]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: autoselect crc32c based on cpu features 393/head
authorSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 19:20:45 +0000 (12:20 -0700)
committerSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 19:20:51 +0000 (12:20 -0700)
commit08dd35d9e3c18f669e9da9f91d8a83af644c2ab3
treeb535b1d11580554811ac5f668793b10c6f93e272
parent7c59288d9168ddef3b3dc570464ae9a1f180d18c
common: autoselect crc32c based on cpu features

If the CPu supposts SSE4.2, use the crc32c instructions.  Use the magic
incantation from who knows where to do this.  __builtin_cpu_supports()
is a nicer way to do it, but that is new in gcc 4.8.

Avoid static globals; they are bad.  Sadly that means we redetect the CPU
feature on every call. I assume that is reasonably efficient...

Signed-off-by: Sage Weil <sage@inktank.com>
src/Makefile.am
src/common/crc32c-intel.c
src/common/sctp_crc32.c
src/include/crc32c.h