From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5189 invoked by alias); 21 Jan 2004 18:39:10 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5144 invoked from network); 21 Jan 2004 18:39:09 -0000 Received: from unknown (HELO frothingslosh.sfbay.redhat.com) (66.187.237.200) by sources.redhat.com with SMTP; 21 Jan 2004 18:39:09 -0000 Received: from frothingslosh.sfbay.redhat.com (localhost.localdomain [127.0.0.1]) by frothingslosh.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id i0LId8QA015138; Wed, 21 Jan 2004 10:39:08 -0800 Received: (from rth@localhost) by frothingslosh.sfbay.redhat.com (8.12.8/8.12.8/Submit) id i0LId8d4015136; Wed, 21 Jan 2004 10:39:08 -0800 X-Authentication-Warning: frothingslosh.sfbay.redhat.com: rth set sender to rth@redhat.com using -f Date: Wed, 21 Jan 2004 18:44:00 -0000 From: Richard Henderson To: Jan Hoogerbrugge Cc: gcc@gcc.gnu.org Subject: Re: Predicated execution / if-conversion? Message-ID: <20040121183908.GC14799@redhat.com> Mail-Followup-To: Richard Henderson , Jan Hoogerbrugge , gcc@gcc.gnu.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-SW-Source: 2004-01/txt/msg01672.txt.bz2 On Wed, Jan 21, 2004 at 04:33:33PM +0100, Jan Hoogerbrugge wrote: > Could somebody tell me how to start with modelling predicated > execution? With a few exceptions, all operations can be > predicated. Then your best model is ia64. You need to add ;; Predication. True iff this instruction can be predicated. (define_attr "predicable" "no,yes" (const_string "yes")) and then set the attribute to "no" for those exceptions. You also need to add ;; General predication pattern (define_cond_exec [(match_operator 0 "predicate_operator" [(match_operand:BI 1 "register_operand" "c") (const_int 0)])] "" "") > I noticed that the FRV port defines the IFCVT > macros. Is that necessary or only to model more complex cases? Complex cases. FRV has a reasonably restricted form of predication. > I noticed "%," and current_insn_predicate in the ia64 port. > How does this work? The insn scanner in final recognizes the (cond_exec (predicate) (regular-insn)) form, sets up current_insn_predicate with (predicate), and then calls the output pattern. This is a conveniece to make the output patterns easier to write. The "%," processing happens in ia64_print_operand. As for the rest of the output, that depends on your assembly syntax. IA-64 uses a prefix, and so is handed by the prefix in define_cond_exec; ARM uses a suffix, and so is handled by arm_print_operand with "%?". Hopefully your syntax isn't more horrible than one of those two alternatives. ;-) r~