Messages in this thread | | | From | Rasmus Villemoes <> | Subject | [PATCH v3 0/6] make use of gcc 9's "asm inline()" | Date | Fri, 13 Sep 2019 00:19:21 +0200 |
| |
gcc 9+ (and gcc 8.3, 7.5) provides a way to override the otherwise crude heuristic that gcc uses to estimate the size of the code represented by an asm() statement. From the gcc docs
If you use 'asm inline' instead of just 'asm', then for inlining purposes the size of the asm is taken as the minimum size, ignoring how many instructions GCC thinks it is.
For compatibility with older compilers, we obviously want a
#if [understands asm inline] #define asm_inline asm inline #else #define asm_inline asm #endif
But since we #define the identifier inline to attach some attributes, we have to use an alternate spelling of that keyword. gcc provides both __inline__ and __inline, and we currently #define both to inline, so they all have the same semantics. We have to free up one of __inline__ and __inline, and the latter is by far the easiest.
The two x86 changes cause smaller code gen differences than I'd expect, but I think we do want the asm_inline thing available sooner or later, so this is just to get the ball rolling.
Changes since v1: __inline instead of __inline__, making the diffstat 400 lines smaller.
Changes since v2: Check support of "asm inline" in Kconfig rather than based on gcc version, since the feature was backported to gcc 7.x and gcc 8.x. That also automatically enables it if and when Clang grows support, though that compiler apparently does not have the same problems with overestimating sizes of asm()s that gcc has.
Patch 1 has already been picked up by Greg in staging-next, it's included here for completeness. I don't know how to route the rest, or if they should simply wait for 5.5 given how close we are to the merge window for 5.4.
Rasmus Villemoes (6): staging: rtl8723bs: replace __inline by inline lib/zstd/mem.h: replace __inline by inline compiler_types.h: don't #define __inline compiler-types.h: add asm_inline definition x86: alternative.h: use asm_inline for all alternative variants x86: bug.h: use asm_inline in _BUG_FLAGS definitions
arch/x86/include/asm/alternative.h | 14 +++++++------- arch/x86/include/asm/bug.h | 4 ++-- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++-- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723bs/include/drv_types.h | 6 +++--- .../staging/rtl8723bs/include/osdep_service.h | 10 +++++----- .../rtl8723bs/include/osdep_service_linux.h | 14 +++++++------- drivers/staging/rtl8723bs/include/rtw_mlme.h | 14 +++++++------- drivers/staging/rtl8723bs/include/rtw_recv.h | 16 ++++++++-------- drivers/staging/rtl8723bs/include/sta_info.h | 2 +- drivers/staging/rtl8723bs/include/wifi.h | 14 +++++++------- drivers/staging/rtl8723bs/include/wlan_bssdef.h | 2 +- include/linux/compiler_types.h | 17 ++++++++++++++++- init/Kconfig | 3 +++ lib/zstd/mem.h | 2 +- 15 files changed, 71 insertions(+), 53 deletions(-)
-- 2.20.1
| |