From 880a18f124e6047126bca378fa88f3858431eac9 Mon Sep 17 00:00:00 2001 From: Jon Lipstate Date: Fri, 12 Jan 2024 22:28:38 -0800 Subject: [PATCH] fix shift direction --- core/sys/info/cpu_intel.odin | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/sys/info/cpu_intel.odin b/core/sys/info/cpu_intel.odin index 5a11863d4..1344c3d2a 100644 --- a/core/sys/info/cpu_intel.odin +++ b/core/sys/info/cpu_intel.odin @@ -37,11 +37,11 @@ cpu_name: Maybe(string) @(init, private) init_cpu_features :: proc "c" () { - is_set :: #force_inline proc "c" (hwc: u32, value: u32) -> bool { - return hwc&(1 << value) != 0 + is_set :: #force_inline proc "c" (bit: u32, value: u32) -> bool { + return (value>>bit) & 0x1 != 0 } - try_set :: #force_inline proc "c" (set: ^CPU_Features, feature: CPU_Feature, hwc: u32, value: u32) { - if is_set(hwc, value) { + try_set :: #force_inline proc "c" (set: ^CPU_Features, feature: CPU_Feature, bit: u32, value: u32) { + if is_set(bit, value) { set^ += {feature} } }