From: blueswir1 Date: Sun, 28 Oct 2007 14:35:04 +0000 (+0000) Subject: Use shared ctpop64 helper X-Git-Url: https://repo.jachan.dev/qemu.git/commitdiff_plain/eed152bba588001550eb6a54366aee89f087f1bf Use shared ctpop64 helper git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3468 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index 7b1b08e430..ccadf85104 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -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)