From patchwork Thu Oct 20 16:10:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Lee X-Patchwork-Id: 120832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 2CD7BB702E for ; Fri, 21 Oct 2011 03:10:47 +1100 (EST) Received: (qmail 17912 invoked by alias); 20 Oct 2011 16:10:43 -0000 Received: (qmail 17878 invoked by uid 22791); 20 Oct 2011 16:10:40 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_EG X-Spam-Check-By: sourceware.org Received: from usmamail.tilera.com (HELO USMAMAIL.TILERA.COM) (206.83.70.75) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Oct 2011 16:10:24 +0000 Received: from [127.0.0.1] (10.9.0.23) by USMAExch2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server (TLS) id 14.0.694.0; Thu, 20 Oct 2011 12:10:22 -0400 Message-ID: <4EA047EC.8020407@tilera.com> Date: Thu, 20 Oct 2011 12:10:20 -0400 From: Walter Lee User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: "Joseph S. Myers" CC: Subject: Re: [PATCH] New port for TILEPro and TILE-Gx 3/7: gcc port References: <4E996398.2000507@tilera.com> <4E9964C9.7080105@tilera.com> In-Reply-To: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi Joseph, Thanks for the feedback. I am attaching a gcc patch that addresses most of the comments. Here are replies to a few of the comments: > > +#undef SYSROOT_SUFFIX_SPEC > > +#define SYSROOT_SUFFIX_SPEC "%{mbme:/usr/lib/bme;mnewlib:/usr/lib/newlib}" > > + > > +#undef SYSROOT_HEADERS_SUFFIX_SPEC > > +#define SYSROOT_HEADERS_SUFFIX_SPEC SYSROOT_SUFFIX_SPEC > > These specs seem rather unusual. Typically such specs would be generated > depending on what multilibs were being built (see t-sysroot-suffix), and > since a subdirectory sysroot itself contains directories such as usr/lib > and usr/include, you would not expect a /usr/lib path within those specs. I've reverted the SYSROOT changes to support -mbme and -mnewlib for now. > > +#undef MCOUNT_NAME > > +#define MCOUNT_NAME "mcount" > > For a new target it seems much better to define your ABI to use a name in > the reserved namespace for this - that is, starting with two underscores. I've changed it to use "_mcount" with one underscore. That seems to be what glibc support by default, and it's consistent with x86, and we'd prefer to be consistent with x86 whenever possible. > > +/* For __clear_cache in libgcc2.c. */ > > +#ifdef IN_LIBGCC2 > > + > > +#include > > Where does this header come from? Linux kernel, glibc, somewhere else? > In general you want to condition header includes on inhibit_libc to > facilitate bootstrapping (including building a partial static libgcc) > before the libc headers are installed, since configuring glibc to install > its headers requires a working compiler to run configure tests. We plan to include this as part of the Linux kernel, as the kernel itself depends on it. > > diff -r -u -p -N /home/packages/gcc-4.7.0-179959/gcc/config/tilegx/mul_tables.c ./gcc/config/tilegx/mul_tables.c > > --- /home/packages/gcc-4.7.0-179959/gcc/config/tilegx/mul_tables.c 1969-12-31 19:00:00.000000000 -0500 > > +++ ./gcc/config/tilegx/mul_tables.c 2011-10-14 18:14:11.524757000 -0400 > > @@ -0,0 +1,19853 @@ > > Are you really sure that this 19853-line file is source code - "the > preferred form of the work for making modifications to it"? How was it > written? I've included the source code from which the tables are generated, and I've updated the makefiles with rules to generate the tables. The script takes a minute to run, so I'd prefer not to generate it for every build, so I've kept the generated taables as part of the patch and updated the gcc_update script accordingly. > You should also verify that if you build the compiler using a current > trunk compiler as your starting point, it passes a > --enable-werror-always build as both C and C++ I've verified this condition using the config-list.mk script. Thanks, Walter * config.gcc: Handle tilegx and tilepro. * configure.ac (gcc_cv_as_dwarf2_debug_line): Enable test for tilegx and tilepro. Add HAVE_AS_TLS check for tilegx and tilepro. * configure: Regenerate. * doc/contrib.texi: Add Mat Hostetter and self. * doc/extend.texi (TILE-Gx Built-in Functions): New node. Document instruction intrinsics and network accessing intrinsics. (TILEPro Built-in Functions): New node. Document instruction intrinsics and network accessing intrinsics. * doc/install.texi (Specific, tilegx-*-linux*): Document it. (Specific, tilepro-*-linux*): Likewise. * doc/invoke.texi (TILE-Gx Options): New section. (TILEPro Options): New section. * doc/md.texi (TILE-Gx): New section. (TILEPro): New section. * common/config/tilegx/tilegx-common.c: New file. * common/config/tilepro/tilepro-common.c: New file. * config/tilegx/constraints.md: New file. * config/tilegx/linux.h: New file. * config/tilegx/mul-tables.c: New file. * config/tilegx/predicates.md: New file. * config/tilegx/sync.md: New file. * config/tilegx/t-tilegx: New file. * config/tilegx/tilegx-builtins.h: New file. * config/tilegx/tilegx-c.c: New file. * config/tilegx/tilegx-generic.md: New file. * config/tilegx/tilegx-modes.def: New file. * config/tilegx/tilegx-multiply.h: New file. * config/tilegx/tilegx-protos.h: New file. * config/tilegx/tilegx.c: New file. * config/tilegx/tilegx.h: New file. * config/tilegx/tilegx.md: New file. * config/tilegx/tilegx.opt: New file. * config/tilepro/constraints.md: New file. * config/tilepro/gen-mul-tables.cc: New file. * config/tilepro/linux.h: New file. * config/tilepro/mul-tables.c: New file. * config/tilepro/predicates.md: New file. * config/tilepro/t-tilepro: New file. * config/tilepro/tilepro-builtins.h: New file. * config/tilepro/tilepro-c.c: New file. * config/tilepro/tilepro-generic.md: New file. * config/tilepro/tilepro-modes.def: New file. * config/tilepro/tilepro-multiply.h: New file. * config/tilepro/tilepro-protos.h: New file. * config/tilepro/tilepro.c: New file. * config/tilepro/tilepro.h: New file. * config/tilepro/tilepro.md: New file. * config/tilepro/tilepro.opt: New file. The gcc testsuite change is the same as before. * testsuite/gcc.dg/20020312-2.c: Add a condition for __tile__. diff -r -u -p -N /home/packages/gcc-4.7.0-180241/gcc/testsuite/gcc.dg/20020312-2.c ./gcc/testsuite/gcc.dg/20020312-2.c --- /home/packages/gcc-4.7.0-180241/gcc/testsuite/gcc.dg/20020312-2.c 2011-10-14 00:57:27.000000000 -0400 +++ ./gcc/testsuite/gcc.dg/20020312-2.c 2011-10-20 10:23:51.377473000 -0400 @@ -64,6 +64,8 @@ extern void abort (void); # define PIC_REG "12" #elif defined(__sparc__) # define PIC_REG "l7" +#elif defined(__tile__) +# define PIC_REG "r51" #elif defined(__TMS320C6X__) # define PIC_REG "B14" #elif defined(__v850)