From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17809 invoked by alias); 14 May 2003 13:18:49 -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 17693 invoked from network); 14 May 2003 13:18:47 -0000 Received: from unknown (HELO hotmail.com) (207.68.163.64) by sources.redhat.com with SMTP; 14 May 2003 13:18:47 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 14 May 2003 06:18:46 -0700 Received: from 193.67.187.140 by sea1fd.sea1.hotmail.msn.com with HTTP; Wed, 14 May 2003 13:18:45 GMT X-Originating-IP: [193.67.187.140] X-Originating-Email: [fcook377@hotmail.com] From: "Fred Cook" To: gcc@gcc.gnu.org Bcc: Subject: Different addressing modes for loads and stores? Date: Wed, 14 May 2003 13:18:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 14 May 2003 13:18:46.0169 (UTC) FILETIME=[59550890:01C31A1B] X-SW-Source: 2003-05/txt/msg01405.txt.bz2 Hi, How to deal with load and store instructions that have different addressing modes? This is not unusual so there must be a solution. What I did is specifying the following pattern in the .md file for word loads and stores: (define_insn "movsi" [(set (match_operand:SI 0 "nonimmediate_operand" "=r,m") (match_operand:SI 1 "general_operand" "m,r"))] "" "@ load %1 -> %0 store %0 %1" ) My loads support base+offset and base+register addressing while stores only have base+offset addressing. My GO_IF_LEGITIMATE_ADDRESS macro accepts both addressing modes. Now the question is how to prevent that the base+register mode is used for stores. For that changed the movsi pattern to: (define_insn "movsi" [(set (match_operand:SI 0 "nonimmediate_operand" "=r,S") (match_operand:SI 1 "general_operand" "m,r"))] "" "@ load %1 -> %0 store %0 %1" ) and I used the EXTRA_CONSTRAINT macro to accept only base+offset if the letter argument is 'S'. However, this does not lead to what I wanted to achieve. "=r,Sm" or "=r,mS" also does not work. Any idea how to solve this problem? Thanks, Fred. _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus