From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13291 invoked by alias); 3 Nov 2004 06:43:03 -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 13282 invoked from network); 3 Nov 2004 06:43:01 -0000 Received: from unknown (HELO balaji) (61.16.238.202) by sourceware.org with SMTP; 3 Nov 2004 06:43:01 -0000 Message-ID: <41887D89.4020109@acmet.com> Date: Wed, 03 Nov 2004 06:43:00 -0000 From: Balaji S Organization: Acme Technologies Pvt. Ltd. User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) MIME-Version: 1.0 To: gcc@gcc.gnu.org Subject: Porting question: define_expand Vs define_split Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00110.txt.bz2 Hi all, I am porting GCC to a new architecture using stormy16 as base. In my architecture there is no instruction for /neg/ operation. So i planned to handle it using /sub/. I am able to accomplish this job by using either define_expand or define_split without knowing its internals as follows: (define_expand "neghi2" [(set (match_operand:HI 0 "register_operand" "") (const_int 0)) (set (match_dup 0) (minus:HI (match_dup 0) (match_operand:HI 1 "register_operand" "")))] "" "") (define_insn_and_split "neghi2" [(set (match_operand:HI 0 "register_operand" "=r") (neg:HI (match_operand:HI 1 "register_operand" "0")))] "" "#" "reload_completed" [(set (match_dup 0) (const_int 0)) (set (match_dup 0) (minus:HI (match_dup 0) (match_dup 1)))] "") I do not know whether the above m/c descriptions are correct. Please correct me if any mistakes. Moreover, i would like to know, when to use /define_expand/ and when to use /define_split/. Thanks in advance, Balaji S