From 4689ef9033a8447cf4387bbffa9dae4029ca45cd 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 --- libmesosphere/include/mesosphere/kern_select_cpu.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmesosphere/include/mesosphere/kern_select_cpu.hpp b/libmesosphere/include/mesosphere/kern_select_cpu.hpp index 55e030bd..58945e6f 100644 --- a/libmesosphere/include/mesosphere/kern_select_cpu.hpp +++ b/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]); }