From cdc619a8a62e9c4d5dafe5b7ed8380d3be37020a 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]); }