From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27546 invoked by alias); 23 Aug 2010 18:06:39 -0000 Received: (qmail 27534 invoked by uid 22791); 23 Aug 2010 18:06:38 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_05,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Aug 2010 18:06:01 +0000 Received: by yxk30 with SMTP id 30so2370631yxk.20 for ; Mon, 23 Aug 2010 11:05:59 -0700 (PDT) Received: by 10.150.202.9 with SMTP id z9mr5519930ybf.211.1282586759306; Mon, 23 Aug 2010 11:05:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.161.198 with HTTP; Mon, 23 Aug 2010 11:05:39 -0700 (PDT) From: Mohamed Shafi Date: Mon, 23 Aug 2010 18:25:00 -0000 Message-ID: Subject: Need help in deciding the instruction set for a new target. To: GCC Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg00338.txt.bz2 Hello all, I am trying to do a port on GCC 4.5. The target has a memory resolution of 32bits i.e. char is 32bits in the target (addr 0 selects 1st 32bit and addr 1 selects 2nd 32bit). It has only word (32bit) access. In terms of address resolution this target is similar to c4x which became obsolete in GCC 4.2. There are two ways to implement this port. One is to have BITS_PER_UNIT =3D=3D32, like c4x and other is to have a normal C like char =3D=3D 8, short =3D=3D 16, and int =3D=3D 32. We are thi= nking about having BITS_PER_UNIT =3D=3D 32. Yes I know the support for such a target is bit rotten in GCC. I am currently trying to removing it. In the mean time, we are in the process of finalizing the instructions. The current instruction set has support for 32bit immediate data only in move operations. i.e. move src1GP, #imm32 For all other operations like div, sub, add, compare, modulus, load, store the support is only for 16bit immediate. For all these instruction there is separate flavor for sign and zero extension. i.e. mod.s32 srcdstGP, #imm16 // 32%imm16 signed modulus mod.u32 srcdstGP, #imm16 // 32%imm16 unsigned modulus cmp.s32 src1GP, #imm16 // signed register to 16-bit immediate compare cmp.u32 src1GP, #imm16 // unsigned register to 16-bit immediate compare sub.s32 srcdstGP, #imm16 // signed 16-bit register to immediate subtract sub.u32 srcdstGP, #imm16 // unsigned 16-bit register to immediate subtract I want to know if it is good to have both sign and zero extension for 16bit immediate. Will it be of any use with a configuration where char =3D=3D short =3D=3D i= nt =3D=3D 32bit? Will I be able to support these kinds of instructions in a GCC port? Or will it good to have a separate sign and zero extension instruction, which the current instruction set doesn=92t have. Do I need a separate sign and zero ext instructions along with the above instructions? It would be of great help if you could guide me in deciding these instructi= ons. Regards, Shafi