Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2925)

Unified Diff: base/cpu_unittest.cc

Issue 2458333002: Add popcnt support for pnacl (Closed)
Patch Set: Add popcnt test for clang Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/cpu.cc ('k') | components/nacl/renderer/platform_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/cpu_unittest.cc
diff --git a/base/cpu_unittest.cc b/base/cpu_unittest.cc
index ec14620f98c91a79a9e6ddc1e40a983cabd621b4..9cabfd6998daeec8c3c80310f7aac390efca7c59 100644
--- a/base/cpu_unittest.cc
+++ b/base/cpu_unittest.cc
@@ -57,6 +57,11 @@ TEST(CPU, RunExtendedInstructions) {
__asm__ __volatile__("crc32 %%eax, %%eax\n" : : : "eax");
}
+ if (cpu.has_popcnt()) {
+ // Execute a POPCNT instruction.
+ __asm__ __volatile__("popcnt %%eax, %%eax\n" : : : "eax");
+ }
+
if (cpu.has_avx()) {
// Execute an AVX instruction.
__asm__ __volatile__("vzeroupper\n" : : : "xmm0");
@@ -100,6 +105,11 @@ TEST(CPU, RunExtendedInstructions) {
__asm crc32 eax, eax;
}
+ if (cpu.has_popcnt()) {
+ // Execute a POPCNT instruction.
+ __asm popcnt eax, eax;
+ }
+
// Visual C 2012 required for AVX.
#if _MSC_VER >= 1700
if (cpu.has_avx()) {
« no previous file with comments | « base/cpu.cc ('k') | components/nacl/renderer/platform_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698