From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31697 invoked by alias); 15 Nov 2008 14:56:43 -0000 Received: (qmail 31635 invoked by uid 22791); 15 Nov 2008 14:56:42 -0000 X-Spam-Check-By: sourceware.org Received: from elasmtp-scoter.atl.sa.earthlink.net (HELO elasmtp-scoter.atl.sa.earthlink.net) (209.86.89.67) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 15 Nov 2008 14:56:01 +0000 Received: from [209.128.140.171] (helo=[10.0.1.201]) by elasmtp-scoter.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1L1MZ5-0006X7-Rf; Sat, 15 Nov 2008 09:55:59 -0500 Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <92BED2AD-18E9-4F97-A6D6-D9D9A615563E@alum.mit.edu> Cc: Alan Lehotsky Content-Transfer-Encoding: 7bit From: Alan Lehotsky Subject: selecting between two forms of an instruction Date: Sat, 15 Nov 2008 14:56:00 -0000 To: cgen@sourceware.org X-Mailer: Apple Mail (2.753.1) X-ELNK-Trace: 9e0cfd4f457cc6ab94f5150ab1c16ac0eafd45f126befae25cb50908d1fd179ade0bb839dd51e385350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2008-q4/txt/msg00012.txt.bz2 Working on a port for a machine with 16 bit and 32 bit fixed length instructions. The machine is somewhat like an ARM/Thumb architecture, but there is no mode switch. You use the 16 bit instructions if you have short displacements or only need to access a subset of all the registers. It occurs to me that I could ALWAYS generate 32 bit instructions in the assembler and let the linker relax 32 bitters to 16 bitters based on the actual requirements of the program. Is there any downside to this strategy? I've done this in the past for branching instructions and (on the IP2K) the insertion and deletion of bank switching instructions - but never so aggressively where nearly every instruction has a short form. -- Al