From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16555 invoked by alias); 28 Sep 2002 00:19:49 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 16547 invoked from network); 28 Sep 2002 00:19:48 -0000 Received: from unknown (HELO mel-rto2.wanadoo.fr) (193.252.19.254) by sources.redhat.com with SMTP; 28 Sep 2002 00:19:48 -0000 Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto2.wanadoo.fr (6.5.007) id 3D89D999004E09D7 for cgen@sources.redhat.com; Sat, 28 Sep 2002 02:19:47 +0200 Received: from michaelclap (81.48.123.241) by mel-rta9.wanadoo.fr (6.5.007) id 3D80120400996F83 for cgen@sources.redhat.com; Sat, 28 Sep 2002 02:19:47 +0200 Message-ID: <001901c26684$c08ce2d0$8001a8c0@wanadoo.fr> From: "Michael Chapman" To: Subject: Different length variants of the same instruction Date: Fri, 27 Sep 2002 17:19:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-SW-Source: 2002-q3/txt/msg00081.txt.bz2 I can't figure out how to get the assembler to work with different lengths of the same instruction e.g. mov r1, #imm4 (16 bit instruction for immediate values 0-15) and mov r1, #imm16 (32 bit instruction for immediate values 0-65535) If I simply have the following description (dni mov-rd-imm4 "mov rd,#imm4" () "mov $rd,$hash$imm4" (+ (f-opcode #x10) rd imm4) (set rd imm4) () ) (dni mov-rd-imm16 "mov rd,#imm16" () "mov $rd,$hash$imm16" (+ (f-opcode #x60) rd (f-rsvd-rs 0) imm16) (set rd imm16) () ) I.e. the imm4 variant before the imm16 variant then I can write mov r1, #0x1234 to get a 32 bit instruction. However if I try mov r1, #(l2-l1) where l1 and l2 are instruction labels, it always tries to assemble this with the imm4 variant - even if the value of the expression is too big. Why? I have a similiar problem with conditional branches which come in two lengths as well. I have experimented with RELAX and RELAXABLE with no sucess. Can someone explain things? Thanks, Mike Chapman