From: Oliver Kurth Date: Tue, 18 Dec 2018 21:19:47 +0000 (-0800) Subject: Backout previous change to vm_basic_asm.h; not applicable to open-vm-tools. X-Git-Tag: stable-11.0.0~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b5f6fa802d60aa8bb1855843b395c3851363cce;p=thirdparty%2Fopen-vm-tools.git Backout previous change to vm_basic_asm.h; not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_basic_asm.h b/open-vm-tools/lib/include/vm_basic_asm.h index 9486adb9e..f0f29b9b3 100644 --- a/open-vm-tools/lib/include/vm_basic_asm.h +++ b/open-vm-tools/lib/include/vm_basic_asm.h @@ -1240,101 +1240,6 @@ RoundUpPow2_32(uint32 value) } -/* - *----------------------------------------------------------------------------- - * - * PopulationCount32 -- - * - * Counts "1" bits in a uint32. - * - * Results: - * Returns the number of bits set to 1. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static INLINE unsigned -PopulationCount32(uint32 value) -{ - /* - * Attribution: - * This algorithm was copied from: - * http://www.aggregate.org/MAGIC#Population Count (Ones Count) - * - * A virtually identical version (but in assembly) appears in an - * AMD reference manual. - * - * No license appears in the original code, but the website - * header states: - * - * "None of the following coding tricks came from proprietary - * sources; further, we believe that each of the tricks we did - * not invent is essentially "standard engineering practice" in - * the specialized niche where it applies. Thus, although we - * have not conducted patent searches, etc., to confirm it, we - * believe that these are tricks that freely can be used for - * any purpose. Of course, The Aggregate accepts no - * responsibility for your use of these tricks; you must - * confirm that the trick does what you want and that you can - * use it as you intend. That said, we do intend to maintain - * this page by adding new algorithms and/or correcting - * existing entries. If you have any comments, please contact - * Professor Hank Dietz, http://aggregate.org/hankd/" - * - * "This document should be cited using something like the following - * bibtex entry:" (most recent retrieval date added) - * - * @techreport{magicalgorithms, - * author={Henry Gordon Dietz}, - * title={{The Aggregate Magic Algorithms}}, - * institution={University of Kentucky}, - * howpublished={Aggregate.Org online technical report}, - * URL={http://aggregate.org/MAGIC/}, - * urldate={2016-01-27} - * } - */ - value -= ((value >> 1) & 0x55555555); - value = (((value >> 2) & 0x33333333) + (value & 0x33333333)); - value = (((value >> 4) + value) & 0x0f0f0f0f); - value += (value >> 8); - value += (value >> 16); - return value & 0x0000003f; -} - - -/* - *----------------------------------------------------------------------------- - * - * PopulationCount64 -- - * - * Counts "1" bits in a uint64. - * - * Results: - * Returns the number of bits set to 1. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static INLINE unsigned -PopulationCount64(uint64 value) -{ - value -= (value >> 1) & 0x5555555555555555ULL; - value = ((value >> 2) & 0x3333333333333333ULL) + - (value & 0x3333333333333333ULL); - value = ((value >> 4) + value) & 0x0f0f0f0f0f0f0f0fULL; - value += value >> 8; - value += value >> 16; - value += value >> 32; - return value & 0xff; -} - - #if defined __cplusplus } // extern "C" #endif