Handle non-Intel platforms in Range and CpuId
authorOwen Yamauchi <oyamauchi@fb.com>
Thu, 21 Mar 2013 14:32:47 +0000 (07:32 -0700)
committerOwen Yamauchi <oyamauchi@fb.com>
Wed, 27 Mar 2013 21:40:58 +0000 (14:40 -0700)
commitae95c1d54ad1c3da2954673e2eb1ac24ad9d2320
treec1b617129f3d73feb52a1e430acb632b6ed105a2
parentde2cc5ee0d80fb06c95b7ad8c73c8a910a5a114d
Handle non-Intel platforms in Range and CpuId

Summary:
Compile out the SSE versions of these functions in Range, based on a new
entry in folly-config.h.

The change to CpuId feels slightly iffy to me. It seems like it would be
more rigorous to make compiling CpuId.h on non-Intel an error, and force
clients to handle non-Intel platforms at the callsite. However, I think
that would be too susceptible to unintentional breakage on non-Intel
platforms, since most people (including automated systems) aren't
building and testing regularly on any. Falling back to saying "none of
these features exist on this processor" seems like a reasonable
alternative.

Test Plan:
fbmake runtests, with FOLLY_HAVE_EMMINTRIN_H set to 0 and 1.
Make sure the SSE functions are getting compiled in or out as
appropriate. ##autoreconf## and ##./configure## to regenerate
folly-config.h.

Reviewed By: delong.j@fb.com

FB internal diff: D746872
folly/CpuId.h
folly/Range.cpp
folly/Range.h
folly/configure.ac