From 936ea8a0134ed8095f9496ebe1571866509530d7 Mon Sep 17 00:00:00 2001 From: Egor Ananyin Date: Sat, 23 May 2020 09:22:31 +0300 Subject: Rename header files to avoid confusion --- arm9/lib/src/MATH_pop.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 arm9/lib/src/MATH_pop.c (limited to 'arm9/lib/src/MATH_pop.c') diff --git a/arm9/lib/src/MATH_pop.c b/arm9/lib/src/MATH_pop.c new file mode 100644 index 00000000..18582494 --- /dev/null +++ b/arm9/lib/src/MATH_pop.c @@ -0,0 +1,12 @@ +#include "global.h" +#include "MATH_pop.h" + +ARM_FUNC u8 MATH_CountPopulation(u32 x) { + x -= (x >> 1) & 0x55555555; + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x += x >> 4; + x &= 0x0f0f0f0f; + x += x >> 8; + x += x >> 16; + return (u8)x; +} -- cgit v1.2.3