From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31018 invoked by alias); 27 Mar 2009 08:56:53 -0000 Received: (qmail 31002 invoked by uid 22791); 27 Mar 2009 08:56:53 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mu-out-0910.google.com (HELO mu-out-0910.google.com) (209.85.134.188) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Mar 2009 08:56:47 +0000 Received: by mu-out-0910.google.com with SMTP id i10so376783mue.6 for ; Fri, 27 Mar 2009 01:56:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.229.12 with SMTP id g12mr314884mur.87.1238144204984; Fri, 27 Mar 2009 01:56:44 -0700 (PDT) Date: Fri, 27 Mar 2009 08:56:00 -0000 Message-ID: <8502af3c0903270156v63cc8edcw571e15442a8a23be@mail.gmail.com> Subject: movsi on 16-bit machine: how to? From: Florent DEFAY To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-03/txt/msg00349.txt.bz2 Hi, I am implementing movsi on a 16-bit machine. I did it this way: ;; ---- movsi (define_insn "movsi" [(set (match_operand:SI 0 "nonimmediate_operand" "=3Dr,m,r,r") (match_operand:SI 1 "general_operand" "r,r,m,i"))] "" "#" ) (define_split [(set (match_operand:SI 0 "nonimmediate_operand" "") (match_operand:SI 1 "general_operand" ""))] "reload_completed && !extra_constraint (operands[1], 'R')" [(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] { operands[2] =3D simplify_gen_subreg(HImode,operands[0],SImode,0); operands[4] =3D simplify_gen_subreg(HImode,operands[0],SImode,2); operands[3] =3D simplify_gen_subreg(HImode,operands[1],SImode,0); operands[5] =3D simplify_gen_subreg(HImode,operands[1],SImode,2); } ) And I tried many other code. But each time I have some " insn does not satisfy its constraints". ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c: In function =91__lshrsi3=92: ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c:435: error: insn does not satisfy its constraints: (insn 8 98 80 ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c:415 (set (mem/c/i:SI (reg:HI 0 r0) [0 +0 S4 A16]) (reg:SI 1 r1)) 6 {movsi} (nil)) I am looking for a great and simple example of movsi for 16-bit machine or movdi for 32-bit machine (because I think it is the same mechanism); or a basic method to do this. I will be grateful for any advice. Florent