From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92038 invoked by alias); 20 Jul 2015 09:20:48 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 91957 invoked by uid 55); 20 Jul 2015 09:20:44 -0000 From: "gcc.hall at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug inline-asm/49611] Inline asm should support input/output of flags Date: Mon, 20 Jul 2015 09:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: inline-asm X-Bugzilla-Version: 4.5.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: gcc.hall at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01703.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49611 --- Comment #17 from Jeremy --- Did you mean "stc" rather than "setc" ??? But yes, it looks like its working well. On 20 July 2015 at 10:05, gccbugzilla at limegreensocks dot com < gcc-bugzilla@gcc.gnu.org> wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49611 > > --- Comment #16 from David --- > I've tried it now and it seems to do good things. This code: > > int main(int argc, char *argv[]) > { > char x; > > asm("setc" : "=@ccc"(x)); > > if (!x) > return 6; > else > return argc; > } > > produces this output (-O3): > > movl $6, %eax > /APP > # 6 "./r.cpp" 1 > setc > # 0 "" 2 > /NO_APP > cmovc %ebx, %eax > addq $32, %rsp > popq %rbx > ret > > Although a minor variation (change "return argc" to "return 7") ends up > doing > setc+cmpb, so it's not a perfect solution. > > Still, if I were Richard, I'd be closing this bug. If someone has > optimization > issues with his solution, that's a new bug. > > -- > You are receiving this mail because: > You are on the CC list for the bug. >