Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbbG0P7E (ORCPT ); Mon, 27 Jul 2015 11:59:04 -0400 Received: from mail-ob0-f175.google.com ([209.85.214.175]:34451 "EHLO mail-ob0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754730AbbG0P7A (ORCPT ); Mon, 27 Jul 2015 11:59:00 -0400 MIME-Version: 1.0 In-Reply-To: <20150727155443.GA20896@gmail.com> References: <1437869262-3211-1-git-send-email-uros_bizjak1@t-2.net> <20150727154035.GA18213@gmail.com> <20150727155443.GA20896@gmail.com> Date: Mon, 27 Jul 2015 17:59:00 +0200 Message-ID: Subject: Re: [PATCH] x86: Introduce ASM flags to bitops From: Uros Bizjak To: Ingo Molnar Cc: Uros Bizjak , linux-kernel@vger.kernel.org, "x86@kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2971 Lines: 76 On Mon, Jul 27, 2015 at 5:54 PM, Ingo Molnar wrote: > > * Uros Bizjak wrote: > >> On Mon, Jul 27, 2015 at 5:40 PM, Ingo Molnar wrote: >> > >> > * Uros Bizjak wrote: >> > >> >> From: Uros Bizjak >> >> >> >> This patch introduces GCC ASM flags to bitops. Instead of e.g. >> >> >> >> 136d7: 48 0f a3 3d 00 00 00 bt %rdi,0x0(%rip) >> >> 136de: 00 >> >> 136df: 19 ff sbb %edi,%edi >> >> 136e1: 85 ff test %edi,%edi >> >> 136e3: 0f 95 c0 setne %al >> >> >> >> following code is generated: >> >> >> >> 13767: 48 0f a3 3d 00 00 00 bt %rdi,0x0(%rip) >> >> 1376e: 00 >> >> 1376f: 0f 92 c0 setb %al >> >> >> >> Similar improvement can be seen in following code: >> >> >> >> 7a6c: 48 0f a3 11 bt %rdx,(%rcx) >> >> 7a70: 19 d2 sbb %edx,%edx >> >> 7a72: 85 d2 test %edx,%edx >> >> 7a74: 74 eb je 7a61 >> >> >> >> which becomes: >> >> >> >> 7a8c: 48 0f a3 11 bt %rdx,(%rcx) >> >> 7a90: 73 ef jae 7a81 >> >> >> >> Signed-off-by: Uros Bizjak >> >> --- >> >> arch/x86/include/asm/bitops.h | 26 ++++++++++++++++++++++++-- >> >> arch/x86/include/asm/percpu.h | 18 +++++++++++++++++- >> >> arch/x86/include/asm/signal.h | 6 ++++++ >> >> arch/x86/include/asm/sync_bitops.h | 18 ++++++++++++++++++ >> >> 4 files changed, 65 insertions(+), 3 deletions(-) >> > >> > Nothing in your patch seems to be setting __GCC_ASM_FLAG_OUTPUTS__, and the patch >> > does not seem to be mailed as part of a larger series ... >> > >> > So how is this supposed to work? >> >> GCC version 6+ will automatically define __GCC_ASM_FLAG_OUTPUTS__ when >> this feature is supported. Please see [1] for RFC GCC patch series and >> [2] for final committed patch. >> >> [1] https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00594.html >> [2] https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02087.html > > Ok, great. This information should be part of the changelog and such, as it's not > obvious. No problem, I'll add this information and send a v2 patch. > Does the GCC project treat this as an ABI kind of thing, i.e. can the kernel rely > on it from now on, without the GCC side semantics of this feature not ever > changing and breaking the kernel? Yes. It was discussed and agreed between GCC and kernel people (HPA) on GCC mailing list. Please see [3]. [3] https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00725.html Uros. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/