Skip to content
Permalink
Browse files

arch/x86/Kconfig: remove CONFIG_CMOV

The only we support cores that don't have CMOV insns are the MINUTEIAs,
so we simply check for that rather this using a layer of indirection.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
  • Loading branch information...
Charles E. Youse authored and nashif committed Jun 11, 2019
1 parent c2c85a2 commit 8013277cd68a6f8ac1b09f6fe5089f9ea3b39787
Showing with 20 additions and 25 deletions.
  1. +0 −8 arch/x86/Kconfig
  2. +20 −17 include/arch/x86/ffs.h
@@ -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
@@ -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

"bsfl %1, %0;\n\t"
"cmovzl %2, %0;\n\t"
: "=r" (bitpos)
: "rm" (op), "r" (-1)
: "cc"

#endif /* CONFIG_CMOV */
#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);

0 comments on commit 8013277

Please sign in to comment.
You can’t perform that action at this time.