Slightly less clumsy check for compiler

This commit is contained in:
dingusdev 2024-02-21 07:14:21 -07:00
parent 2e3e65f3e7
commit 8e9123bdce
2 changed files with 2 additions and 8 deletions

View File

@ -37,12 +37,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
// Uncomment this to have a more graceful approach to illegal opcodes // Uncomment this to have a more graceful approach to illegal opcodes
//#define ILLEGAL_OP_SAFE 1 //#define ILLEGAL_OP_SAFE 1
// Uncomment this to use GCC built-in functions.
#define USE_GCC_BUILTINS 1
// Uncomment this to use Visual Studio built-in functions.
//#define USE_VS_BUILTINS 1
//#define CPU_PROFILING // enable CPU profiling //#define CPU_PROFILING // enable CPU profiling
/** type of compiler used during execution */ /** type of compiler used during execution */

View File

@ -546,9 +546,9 @@ void dppc_interpreter::ppc_cntlzw() {
uint32_t bit_check = ppc_result_d; uint32_t bit_check = ppc_result_d;
#ifdef USE_GCC_BUILTINS #ifdef __builtin_clz //for GCC and Clang users
uint32_t lead = !bit_check ? 32 : __builtin_clz(bit_check); uint32_t lead = !bit_check ? 32 : __builtin_clz(bit_check);
#elif defined USE_VS_BUILTINS #elif defined __lzcnt //for Visual C++ users
uint32_t lead = __lzcnt(bit_check); uint32_t lead = __lzcnt(bit_check);
#else #else
uint32_t lead, mask; uint32_t lead, mask;