From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20642 invoked by alias); 6 Jan 2013 17:08:02 -0000 Received: (qmail 20582 invoked by uid 22791); 6 Jan 2013 17:07:59 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from caibbdcaaaaf.dreamhost.com (HELO homiemail-a59.g.dreamhost.com) (208.113.200.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 06 Jan 2013 17:07:53 +0000 Received: from homiemail-a59.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a59.g.dreamhost.com (Postfix) with ESMTP id ABD2456405C; Sun, 6 Jan 2013 09:07:52 -0800 (PST) Received: from AMDP6 (81-234-195-35-no56.tbcn.telia.com [81.234.195.35]) (Authenticated sender: rdos@rdos.net) by homiemail-a59.g.dreamhost.com (Postfix) with ESMTPA id BACF4564057; Sun, 6 Jan 2013 09:07:50 -0800 (PST) Message-ID: From: "Leif Ekblad" To: "H.J. Lu" Cc: "GCC Patches" References: Subject: Re: [PATCH] Adding target rdos to GCC Date: Sun, 06 Jan 2013 17:08:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0206_01CDEC38.C93FD5A0" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00259.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0206_01CDEC38.C93FD5A0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Content-length: 2130 Updated patches with the suggestions below, except that the initial value is 0 (which is not meaningful). I also added a setting in rdos target file to use r15 for PIC instead of rbx. New change log: * config/gthr.m4: Added rdos thread header. * gcc/config/i386/i386.c: Provided a way to define a default setting for medium memory model and PIC. Provided a way to define a default value for large-data-threshold. * gcc/config/i386/i386.h: Defined default value for medium memory model & PIC. Defined default value for large-data-threshold. * gcc/config/i386/i386.md: Added r14 and r15 register names. * gcc/config/i386/i386.opt: Changed initial value for large-data-threshold to 0 to allow detection of modification. * gcc/config/i386/rdos.h: Added new file for rdos target definition. * gcc/config.gcc: Added rdos target Tested for target rdos and rdos32. Regards, Leif Ekblad ----- Original Message ----- From: "H.J. Lu" To: "Leif Ekblad" Cc: "GCC Patches" Sent: Friday, January 04, 2013 11:32 PM Subject: Re: [PATCH] Adding target rdos to GCC > On Fri, Jan 4, 2013 at 2:22 PM, Leif Ekblad wrote: >> Change log: >> * config/gthr.m4: Added rdos thread header. >> * gcc/config/i386/i386.c: Provided a way to define a default setting for >> medium memory model and PIC. Provided a way to define a default value for >> large-data-threshold. >> * gcc/config/i386/i386.h: Defined default value for medium memory model & >> PIC. >> * gcc/config/i386/rdos.h: Added new file for rdos target definition. >> * gcc/config.gcc: Added rdos target >> >> The change to gthr.m4 requires rebuilding the configure scripts. >> >> Tested with target rdos and rdos32. Is this ok for trunk? >> >> Regards, >> Leif Ekblad > > + #ifdef TARGET_SECTION_THRESHOLD > + ix86_section_threshold = TARGET_SECTION_THRESHOLD; > + #endif > > You should > > 1. Add DEFAULT_SECTION_THRESHOLD and set it to > 65536. > 2. Change the init value of ix86_section_threshold to -1. > 3. Set ix86_section_threshold to DEFAULT_SECTION_THRESHOLD > if it is -1. > > > -- > H.J. ------=_NextPart_000_0206_01CDEC38.C93FD5A0 Content-Type: application/octet-stream; name="gcc.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gcc.diff" Content-length: 6663 diff -crN gcc-4.8-20121230/config/gthr.m4 gcc-work/config/gthr.m4=0A= *** gcc-4.8-20121230/config/gthr.m4 Mon Oct 15 15:10:30 2012=0A= --- gcc-work/config/gthr.m4 Fri Jan 4 21:08:46 2013=0A= ***************=0A= *** 21,26 ****=0A= --- 21,27 ----=0A= tpf) thread_header=3Dconfig/s390/gthr-tpf.h ;;=0A= vxworks) thread_header=3Dconfig/gthr-vxworks.h ;;=0A= win32) thread_header=3Dconfig/i386/gthr-win32.h ;;=0A= + rdos) thread_header=3Dconfig/i386/gthr-rdos.h ;;=0A= esac=0A= AC_SUBST(thread_header)=0A= ])=0A= diff -crN gcc-4.8-20121230/gcc/config/i386/i386.c gcc-work/gcc/config/i386/= i386.c=0A= *** gcc-4.8-20121230/gcc/config/i386/i386.c Thu Dec 27 02:58:06 2012=0A= --- gcc-work/gcc/config/i386/i386.c Sun Jan 6 14:10:34 2013=0A= ***************=0A= *** 3239,3244 ****=0A= --- 3239,3246 ----=0A= DLL, and is essentially just as efficient as direct addressing. */=0A= if (TARGET_64BIT && DEFAULT_ABI =3D=3D MS_ABI)=0A= ix86_cmodel =3D CM_SMALL_PIC, flag_pic =3D 1;=0A= + else if (TARGET_64BIT && TARGET_MEDIUM_PIC)=0A= + ix86_cmodel =3D CM_MEDIUM_PIC, flag_pic =3D 1;=0A= else if (TARGET_64BIT)=0A= ix86_cmodel =3D flag_pic ? CM_SMALL_PIC : CM_SMALL;=0A= else=0A= ***************=0A= *** 3919,3924 ****=0A= --- 3921,3929 ----=0A= && !(target_flags_explicit & MASK_LONG_DOUBLE_64))=0A= target_flags |=3D MASK_LONG_DOUBLE_64;=0A= =20=20=0A= + if (ix86_section_threshold =3D=3D 0)=0A= + ix86_section_threshold =3D DEFAULT_SECTION_THRESHOLD;=0A= +=20=0A= /* Save the initial options in case the user does function specific=0A= options. */=0A= if (main_args_p)=0A= diff -crN gcc-4.8-20121230/gcc/config/i386/i386.h gcc-work/gcc/config/i386/= i386.h=0A= *** gcc-4.8-20121230/gcc/config/i386/i386.h Wed Dec 19 17:04:12 2012=0A= --- gcc-work/gcc/config/i386/i386.h Sun Jan 6 13:24:26 2013=0A= ***************=0A= *** 86,91 ****=0A= --- 86,93 ----=0A= #define TARGET_LP64 TARGET_ABI_64=0A= #define TARGET_X32 TARGET_ABI_X32=0A= =20=20=0A= + #define TARGET_MEDIUM_PIC 0=0A= +=20=0A= /* SSE4.1 defines round instructions */=0A= #define OPTION_MASK_ISA_ROUND OPTION_MASK_ISA_SSE4_1=0A= #define TARGET_ISA_ROUND ((ix86_isa_flags & OPTION_MASK_ISA_ROUND) !=3D 0= )=0A= ***************=0A= *** 790,795 ****=0A= --- 792,801 ----=0A= it is the part of the ABI. We shouldn't change it with -mavx. */=0A= #define ATTRIBUTE_ALIGNED_VALUE 128=0A= =20=20=0A= + /* Default threshold for putting data in large sections with x86-64=0A= + medium memory model */=0A= + #define DEFAULT_SECTION_THRESHOLD 65536=0A= +=20=0A= /* Decide whether a variable of mode MODE should be 128 bit aligned. */= =0A= #define ALIGN_MODE_128(MODE) \=0A= ((MODE) =3D=3D XFmode || SSE_REG_MODE_P (MODE))=0A= diff -crN gcc-4.8-20121230/gcc/config/i386/i386.md gcc-work/gcc/config/i386= /i386.md=0A= *** gcc-4.8-20121230/gcc/config/i386/i386.md Wed Dec 19 17:04:12 2012=0A= --- gcc-work/gcc/config/i386/i386.md Sun Jan 6 13:17:36 2013=0A= ***************=0A= *** 301,306 ****=0A= --- 301,308 ----=0A= (R11_REG 40)=0A= (R12_REG 41)=0A= (R13_REG 42)=0A= + (R14_REG 43)=0A= + (R15_REG 44)=0A= (XMM8_REG 45)=0A= (XMM9_REG 46)=0A= (XMM10_REG 47)=0A= diff -crN gcc-4.8-20121230/gcc/config/i386/i386.opt gcc-work/gcc/config/i38= 6/i386.opt=0A= *** gcc-4.8-20121230/gcc/config/i386/i386.opt Fri Nov 16 08:17:30 2012=0A= --- gcc-work/gcc/config/i386/i386.opt Sun Jan 6 14:09:06 2013=0A= ***************=0A= *** 141,147 ****=0A= Branches are this expensive (1-5, arbitrary units)=0A= =20=20=0A= mlarge-data-threshold=3D=0A= ! Target RejectNegative Joined UInteger Var(ix86_section_threshold) Init(65= 536)=0A= Data greater than given threshold will go into .ldata section in x86-64 m= edium model=0A= =20=20=0A= mcmodel=3D=0A= --- 141,147 ----=0A= Branches are this expensive (1-5, arbitrary units)=0A= =20=20=0A= mlarge-data-threshold=3D=0A= ! Target RejectNegative Joined UInteger Var(ix86_section_threshold) Init(0)= =0A= Data greater than given threshold will go into .ldata section in x86-64 m= edium model=0A= =20=20=0A= mcmodel=3D=0A= diff -crN gcc-4.8-20121230/gcc/config/i386/rdos.h gcc-work/gcc/config/i386/= rdos.h=0A= *** gcc-4.8-20121230/gcc/config/i386/rdos.h Thu Jan 1 01:00:00 1970=0A= --- gcc-work/gcc/config/i386/rdos.h Sun Jan 6 13:20:12 2013=0A= ***************=0A= *** 0 ****=0A= --- 1,22 ----=0A= +=20=0A= + /* RDOS uses .exe suffix */=0A= + #undef TARGET_EXECUTABLE_SUFFIX=0A= + #define TARGET_EXECUTABLE_SUFFIX ".exe"=0A= +=20=0A= + #undef REAL_PIC_OFFSET_TABLE_REGNUM=0A= + #define REAL_PIC_OFFSET_TABLE_REGNUM R15_REG=0A= +=20=0A= + #undef TARGET_MEDIUM_PIC=0A= + #define TARGET_MEDIUM_PIC 1=0A= + #define DEFAULT_SECTION_THRESHOLD 0x10=0A= +=20=0A= + #define TARGET_OS_CPP_BUILTINS() \=0A= + do \=0A= + { \=0A= + builtin_define ("__RDOS__"); \=0A= + builtin_assert ("system=3Drdos"); \=0A= + } \=0A= + while (0)=0A= +=20=0A= + /* RDOS headers are C++-aware (and often use C++). */=0A= + #define NO_IMPLICIT_EXTERN_C=0A= diff -crN gcc-4.8-20121230/gcc/config.gcc gcc-work/gcc/config.gcc=0A= *** gcc-4.8-20121230/gcc/config.gcc Thu Nov 22 00:33:40 2012=0A= --- gcc-work/gcc/config.gcc Fri Jan 4 21:08:46 2013=0A= ***************=0A= *** 739,744 ****=0A= --- 739,750 ----=0A= use_gcc_stdint=3Dwrap=0A= tm_defines=3D"$tm_defines DEFAULT_LIBC=3DLIBC_UCLIBC SINGLE_LIBC"=0A= ;;=0A= + *-*-rdos*)=0A= + case ${enable_threads} in=0A= + "" | yes | rdos) thread_file=3D'rdos' ;;=0A= + esac=0A= + use_gcc_stdint=3Dwrap=0A= + ;;=0A= *-*-solaris2*)=0A= # i?86-*-solaris2* needs to insert headers between cpu default and=0A= # Solaris 2 specific ones.=0A= ***************=0A= *** 1205,1210 ****=0A= --- 1211,1223 ----=0A= x86_64-*-elf*)=0A= tm_file=3D"${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-std= int.h i386/i386elf.h i386/x86-64.h"=0A= ;;=0A= + i[34567]86-*-rdos*)=0A= + tm_file=3D"${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-= stdint.h"=0A= + ;;=0A= + x86_64-*-rdos*)=0A= + tm_file=3D"${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-= stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h"=0A= + tmake_file=3D"i386/t-i386elf t-svr4"=0A= + ;;=0A= i[34567]86-*-freebsd*)=0A= tm_file=3D"${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_= file} i386/freebsd.h"=0A= ;;= ------=_NextPart_000_0206_01CDEC38.C93FD5A0--