diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b39f17df7c6..a9366438aa6 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -62,7 +62,6 @@ source "arch/x86/core/Kconfig" config CPU_ATOM # Hidden bool - select CMOV select CPU_HAS_FPU select ARCH_HAS_STACK_PROTECTION if X86_MMU select ARCH_HAS_USERSPACE if X86_MMU @@ -80,7 +79,6 @@ config CPU_MINUTEIA config CPU_APOLLO_LAKE # Hidden bool - select CMOV select CPU_HAS_FPU select ARCH_HAS_STACK_PROTECTION if X86_MMU select ARCH_HAS_USERSPACE if X86_MMU @@ -265,12 +263,6 @@ config REBOOT_RST_CNT endchoice -config CMOV - bool - help - This option signifies the use of an Intel CPU that supports - the CMOV instruction. - config CACHE_LINE_SIZE_DETECT bool "Detect cache line size at runtime" default y diff --git a/include/arch/x86/ffs.h b/include/arch/x86/ffs.h index dd3d2245cf5..0575b772991 100644 --- a/include/arch/x86/ffs.h +++ b/include/arch/x86/ffs.h @@ -47,15 +47,9 @@ static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) __asm__ volatile ( -#if defined(CONFIG_CMOV) +#ifdef CONFIG_CPU_MINUTEIA - "bsfl %1, %0;\n\t" - "cmovzl %2, %0;\n\t" - : "=r" (bitpos) - : "rm" (op), "r" (-1) - : "cc" - -#else + /* Minute IA doesn't support cmov */ "bsfl %1, %0;\n\t" "jnz 1f;\n\t" @@ -64,8 +58,15 @@ static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) : "=r" (bitpos) : "rm" (op) : "cc" +#else -#endif /* CONFIG_CMOV */ + "bsfl %1, %0;\n\t" + "cmovzl %2, %0;\n\t" + : "=r" (bitpos) + : "rm" (op), "r" (-1) + : "cc" + +#endif /* CONFIG_CPU_MINUTEIA */ ); return (bitpos + 1); @@ -97,14 +98,9 @@ static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) __asm__ volatile ( -#if defined(CONFIG_CMOV) +#ifdef CONFIG_CPU_MINUTEIA - "bsrl %1, %0;\n\t" - "cmovzl %2, %0;\n\t" - : "=r" (bitpos) - : "rm" (op), "r" (-1) - -#else + /* again, Minute IA doesn't support cmov */ "bsrl %1, %0;\n\t" "jnz 1f;\n\t" @@ -114,7 +110,14 @@ static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) : "rm" (op) : "cc" -#endif /* CONFIG_CMOV */ +#else + + "bsrl %1, %0;\n\t" + "cmovzl %2, %0;\n\t" + : "=r" (bitpos) + : "rm" (op), "r" (-1) + +#endif /* CONFIG_CPU_MINUTEIA */ ); return (bitpos + 1);