From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12257 invoked by alias); 27 Jul 2005 18:59:05 -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 12242 invoked by uid 22791); 27 Jul 2005 18:59:00 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 27 Jul 2005 18:59:00 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j6RIwwN1029743; Wed, 27 Jul 2005 14:58:58 -0400 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j6RIwwV11826; Wed, 27 Jul 2005 14:58:58 -0400 Received: from greed.delorie.com (dj.cipe.redhat.com [10.0.0.222]) by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j6RIwwh31350; Wed, 27 Jul 2005 14:58:58 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.13.1/8.13.1) with ESMTP id j6RIwwdQ031267; Wed, 27 Jul 2005 14:58:58 -0400 Received: (from dj@localhost) by greed.delorie.com (8.13.1/8.13.1/Submit) id j6RIwq0F031264; Wed, 27 Jul 2005 14:58:52 -0400 Date: Wed, 27 Jul 2005 18:59:00 -0000 Message-Id: <200507271858.j6RIwq0F031264@greed.delorie.com> From: DJ Delorie To: glagnar@gmail.com CC: gcc@gcc.gnu.org In-reply-to: (message from glagnar on Wed, 27 Jul 2005 20:25:17 +0200) Subject: Re: Questions about the new M32C target References: X-SW-Source: 2005-07/txt/msg01145.txt.bz2 > 1. Does anyone know if or when there will be a libc supporting this > target, and which one that will be (newlib?)? newlib/libgloss patches are next on my list. There's a simulator and gdb port on the way too. I have a couple of hardware boards as well, which I'll use for testing and whatnot. > 2. After building the compiler, I can create object files but not > executables. ld claims there are linker scripts missing (the files ld > wants are r8c.ld, m16c.ld and m32c.ld, depending on CPU). Will these > be added to gcc or are you supposed to write your own? They'll be in libgloss. I just got the word on copyrights (BSD) and need to hook in the init-ram-from-rom stuff. > 3. There has been a project to add M16C support to gcc, but it was > apparently abandoned because the M16C architecture has two different > addressing modes, while gcc presumably does not support different > pointer sizes. See this discussion for details: > http://lists.gnu.org/archive/html/m16c-dev/2003-11/msg00001.html > > How has this issue been addressed in the current version? The problem is that gcc doesn't support two different pointer widths *in the same compilation*. So, I made it a command line option which to use. I started a couple of threads about single-pointer assumptions in gcc back when I discovered that. R8C and M16C modes (-mcpu=r8c, -mcpu=m16c) use 16 bit pointers. The M16C allows code to live outside the first 64k; the linker generates call thunks to accomodate requests for 16 bit pointers to them. M32CM and M32C modes (-mcpu=m32cm, -mcpu=m32c) use 24 bit pointers in a 32 bit word (PSImode), but a 16 bit "size_t". It's a little weird but results in the best overall code. The assembler has %dsp8() and %dsp16() modifiers for disp[a0] type addressing for when you know that the variable is in the first 256 or 64k bytes, but gcc does not currently use them. I'm hoping at some point in the future to add linker relaxing so that these will be used automatically.