From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17192 invoked by alias); 21 Jul 2006 16:30:00 -0000 Received: (qmail 17183 invoked by uid 22791); 21 Jul 2006 16:29:59 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.12) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Jul 2006 16:29:56 +0000 Received: from brian.corp.google.com (brian.corp.google.com [172.24.0.122]) by smtp-out.google.com with ESMTP id k6LGTq3e017982; Fri, 21 Jul 2006 09:29:52 -0700 Received: from dhcp-172-18-108-229.corp.google.com.google.com (dhcp-172-18-108-229.corp.google.com [172.18.108.229]) (authenticated bits=0) by brian.corp.google.com with ESMTP id k6LGTlfj010204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 21 Jul 2006 09:29:47 -0700 To: "Petar Bajic" Cc: Subject: Re: adding movz to machine description References: <001c01c6acab$dac77e50$4900a8c0@niit.micronasnit.com> From: Ian Lance Taylor Date: Fri, 21 Jul 2006 16:30:00 -0000 In-Reply-To: <001c01c6acab$dac77e50$4900a8c0@niit.micronasnit.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-07/txt/msg00287.txt.bz2 "Petar Bajic" writes: > > It's not generated, like it's not in the asm code. Instead, movsi_insn is > > used and bad asm code is generated. > > > > for c code : > > if (in1 == 0) > > out = in2; > > return out; > > > > I expect asm to look like this > > lw r2,4(r30) ; in2 > > lw r16,(r30) ; in1 > > movz r1, r2, r16 > > > > instead, code looks like this > > > > lw r2,4(r30) > > lw r16,(r30) > > movz r1,r2,r16 > > movn r1,r16,r16 > > > > expand debug file is in attach, I don't see that movsicc_expand is used... > > (although this is my first time to look at expand files) > > movsicc_insn first appears in short.c.11.ce1 > > > > can you see why pattern is not matched with expand? Looking back at your earlier message, you had this: (define_expand "movsicc" [(set (match_operand:SI 0 "register_operand" "=d,d") (if_then_else:SI (eq:SI (match_operand:SI 2 "register_operand" "=d,d") (const_int 0)) (match_operand:SI 1 "register_operand" "=d,d") (match_dup 0)))] The match_dup suggests that the first and last operands must be the same, in which case "movz r1,r2,r16" is not permitted. It may be correct for the pattern to not be matched with expand. It's OK if the if-conversion pass picks it up, which seems to be what is happening for you. If the generated code you are getting is wrong, then problem is likely in the define_insn patterns somewhere. They don't correct represent what the instruction does, or they don't correctly implement it. Ian