Use shared ctpop64 helper

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3468 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2007-10-28 14:35:04 +00:00
parent 2f96c28d55
commit eed152bba5

View File

@ -1,4 +1,5 @@
#include "exec.h"
#include "host-utils.h"
//#define DEBUG_PCALL
//#define DEBUG_MMU
@ -1469,12 +1470,7 @@ void do_rdpsr()
void do_popc()
{
T0 = (T1 & 0x5555555555555555ULL) + ((T1 >> 1) & 0x5555555555555555ULL);
T0 = (T0 & 0x3333333333333333ULL) + ((T0 >> 2) & 0x3333333333333333ULL);
T0 = (T0 & 0x0f0f0f0f0f0f0f0fULL) + ((T0 >> 4) & 0x0f0f0f0f0f0f0f0fULL);
T0 = (T0 & 0x00ff00ff00ff00ffULL) + ((T0 >> 8) & 0x00ff00ff00ff00ffULL);
T0 = (T0 & 0x0000ffff0000ffffULL) + ((T0 >> 16) & 0x0000ffff0000ffffULL);
T0 = (T0 & 0x00000000ffffffffULL) + ((T0 >> 32) & 0x00000000ffffffffULL);
T0 = ctpop64(T1);
}
static inline uint64_t *get_gregset(uint64_t pstate)