Support popcnt in pnacl |
||
Issue description
I'm working on a pnacl app that uses popcnt (stockfish).
While pnacl-translate can produce code with the popcnt instruction if passed -mattr=+popcnt, I don't see it in the binary generated by chrome. It like popcnt support was never added -- was there a reason or just oversight?
components/nacl/renderer/platform_info.cc
// On x86, SSE features are ordered: the most recent one implies the
// others. Care is taken here to only specify the latest SSE version,
// whereas non-SSE features don't follow this model: POPCNT is
// effectively always implied by SSE4.2 but has to be specified
// separately.
//
// TODO: AVX2, AVX, SSE 4.2.
if (cpu.has_sse41()) features.push_back("+sse4.1");
// TODO: SSE 4A, SSE 4.
else if (cpu.has_ssse3()) features.push_back("+ssse3");
// TODO: SSE 3
else if (cpu.has_sse2()) features.push_back("+sse2");
// TODO: AES, POPCNT, LZCNT, ...
return base::JoinString(features, ",");
,
Oct 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b7d2f408e8d9b4dd4443222e61b0bc71932a4ab4 commit b7d2f408e8d9b4dd4443222e61b0bc71932a4ab4 Author: ilevy <ilevy@chromium.org> Date: Sun Oct 30 20:46:57 2016 Add popcnt support for pnacl Detect popcount from cpuid and add feature flag in pnacl. BUG= 660673 Review-Url: https://codereview.chromium.org/2458333002 Cr-Commit-Position: refs/heads/master@{#428632} [modify] https://crrev.com/b7d2f408e8d9b4dd4443222e61b0bc71932a4ab4/base/cpu.cc [modify] https://crrev.com/b7d2f408e8d9b4dd4443222e61b0bc71932a4ab4/base/cpu.h [modify] https://crrev.com/b7d2f408e8d9b4dd4443222e61b0bc71932a4ab4/base/cpu_unittest.cc [modify] https://crrev.com/b7d2f408e8d9b4dd4443222e61b0bc71932a4ab4/components/nacl/renderer/platform_info.cc
,
Oct 30 2016
Verified popcnt instructions are now being produced from ctpop intermediate. Probably worth tracking other cpu feature flags. |
||
►
Sign in to add a comment |
||
Comment 1 by ilevy@chromium.org
, Oct 30 2016