Re: [PATCH] Kconfig: eradicate CC_HAS_ASM_GOTO

Nick Desaulniers
2022-08-19T18:46:10Z

On Fri, Aug 19, 2022 at 10:01 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h
> index 8a9eba191516..c82f1b334207 100644
> --- a/arch/x86/include/asm/rmwcc.h
> +++ b/arch/x86/include/asm/rmwcc.h
> @@ -11,9 +11,7 @@
>
> #define __CLOBBERS_MEM(clb...) "memory", ## clb
>
> -#if !defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(CONFIG_CC_HAS_ASM_GOTO)
> -
> -/* Use asm goto */
> +#ifndef __GCC_ASM_FLAG_OUTPUTS__
>
> #define __GEN_RMWcc(fullop, _var, cc, clobbers, ...) \
> ({ \
> @@ -27,21 +25,6 @@ cc_label: c = true; \
> c; \
> })
>
> -#else /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CONFIG_CC_HAS_ASM_GOTO) */
> -
> -/* Use flags output or a set instruction */
> -
> -#define __GEN_RMWcc(fullop, _var, cc, clobbers, ...) \
> -({ \
> - bool c; \
> - asm volatile (fullop CC_SET(cc) \
> - : [var] "+m" (_var), CC_OUT(cc) (c) \
> - : __VA_ARGS__ : clobbers); \
> - c; \
> -})
> -
> -#endif /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CONFIG_CC_HAS_ASM_GOTO) */
> -

^ probably don't want to remove the terminal endif. Will respin based
on feedback from Masahiro + Alexei.

--
Thanks,
~Nick Desaulniers