From b7091df79654ebb73fbd6b43da987ff07106fd51 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 22 Mar 2022 23:10:09 -0700 Subject: [PATCH] kern: on second thought, gcc built ins are for chumps --- libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp index 55e030bdb..58945e6f2 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp @@ -70,7 +70,7 @@ namespace ams::kern { static constexpr inline u64 ConvertVirtualCoreMaskToPhysical(u64 v_core_mask) { u64 p_core_mask = 0; while (v_core_mask != 0) { - const u64 next = __builtin_ctzll(v_core_mask); + const u64 next = util::CountTrailingZeros(v_core_mask); v_core_mask &= ~(static_cast(1) << next); p_core_mask |= (static_cast(1) << cpu::VirtualToPhysicalCoreMap[next]); }