Index: src/ppc/simulator-ppc.cc |
diff --git a/src/ppc/simulator-ppc.cc b/src/ppc/simulator-ppc.cc |
index cdce60eb5980f73ffa5015b0199a3595d454e137..88cc760d2d3efe0365708934d43f6d61beecb6ce 100644 |
--- a/src/ppc/simulator-ppc.cc |
+++ b/src/ppc/simulator-ppc.cc |
@@ -1863,6 +1863,22 @@ bool Simulator::ExecuteExt2_10bit(Instruction* instr) { |
set_register(ra, count); |
break; |
} |
+#if V8_TARGET_ARCH_PPC64 |
+ case POPCNTD: { |
+ int rs = instr->RSValue(); |
+ int ra = instr->RAValue(); |
+ uintptr_t rs_val = get_register(rs); |
+ uintptr_t count = 0; |
+ int n = 0; |
+ uintptr_t bit = 0x8000000000000000UL; |
+ for (; n < 64; n++) { |
+ if (bit & rs_val) count++; |
+ bit >>= 1; |
+ } |
+ set_register(ra, count); |
+ break; |
+ } |
+#endif |
case SYNC: { |
// todo - simulate sync |
break; |