Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751573AbbEATDQ (ORCPT ); Fri, 1 May 2015 15:03:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34040 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbbEATDP (ORCPT ); Fri, 1 May 2015 15:03:15 -0400 Message-ID: <5543CDC0.6010206@redhat.com> Date: Fri, 01 May 2015 15:02:24 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jakub Jelinek , Linus Torvalds , Richard Henderson CC: Peter Zijlstra , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Linux Kernel Mailing List , Borislav Petkov Subject: Re: [PATCH] x86: Optimize variable_test_bit() References: <20150501151630.GH5029@twins.programming.kicks-ass.net> <20150501163329.GU1751@tucnak.redhat.com> In-Reply-To: <20150501163329.GU1751@tucnak.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1941 Lines: 43 On 01/05/15 12:33 PM, Jakub Jelinek wrote: > On Fri, May 01, 2015 at 09:03:32AM -0700, Linus Torvalds wrote: >>> PPS. Jakub, I see gcc5.1 still hasn't got output operands for asm goto; >>> is this something we can get 'fixed' ? > CCing Richard as author of asm goto and Vlad as register allocator > maintainer. There are a few enhancement requests to support this, like > http://gcc.gnu.org/PR59615 and http://gcc.gnu.org/PR52381 , but indeed the > reason why no outputs are allowed is the register allocation issue. > Don't know if LRA would be better suited to handle that case, but it would > indeed be pretty hard. > > GCC RA is a major reason to prohibit output operands for asm goto. Reload pass was not designed to deal with output reloads for control flow insns. It is very hard to implement this feature there and implement it in a reliable way. Also nobody does any development for reload for long time. So I doubt that somebody would do this for reload. LRA is more suitable to implement the feature. In general, even outputs used on any branch can be permitted. Although critical edges can complicate the implementation as new BBs are created. But it is doable too. The only problem is that asm goto semantics in this case should be defineddepending on what local register allocator (reload or LRA) GCC for given target use. Currently LRA is used by x86/x86-64, ARM, AARCH64, s390, and MIPS. PPC, SH, and ARC are moving to LRA. All other targets are still reload based. So I could implement the output reloads in LRA, probably for the next GCC release. How to enable and mostly use it for multi-target code like the kernel is another question. -- 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/