From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15851 invoked by alias); 8 Jan 2013 20:32:29 -0000 Received: (qmail 15841 invoked by uid 22791); 8 Jan 2013 20:32:28 -0000 X-SWARE-Spam-Status: No, hits=2.0 required=5.0 tests=AWL,BAYES_50,BOTNET,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FB_GET_MEDS,KHOP_THREADED,MIME_QP_LONG_LINE,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-a50.g.dreamhost.com) (208.113.200.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Jan 2013 20:32:21 +0000 Received: from homiemail-a50.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a50.g.dreamhost.com (Postfix) with ESMTP id 120CF6F8065; Tue, 8 Jan 2013 12:32:21 -0800 (PST) Received: from AMDP6 (81-234-195-35-no56.tbcn.telia.com [81.234.195.35]) (Authenticated sender: rdos@rdos.net) by homiemail-a50.g.dreamhost.com (Postfix) with ESMTPA id 579456F8057; Tue, 8 Jan 2013 12:32:19 -0800 (PST) Message-ID: <15368AFB015C4FB9B1FB9B080B43DBE8@AMDP6> From: "Leif Ekblad" To: "Leif Ekblad" , "Uros Bizjak" , Cc: "H.J. Lu" References: <4A4D1EB90016420C88D9C8DF7B633E73@AMDP6> Subject: Re: [PATCH] Adding target rdos to GCC Date: Tue, 08 Jan 2013 20:32:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0280_01CDEDE7.9EC39AE0" 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/msg00445.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0280_01CDEDE7.9EC39AE0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Content-length: 4767 After some new suggestions from Uros, I've made a new diff. 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 using TARGET_RDOS define. * gcc/config/i386/i386.h: Defined TARGET_RDOS macro. 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 DEFAULT_LARGE_SECTION_THRESHOLD. * gcc/config/i386/rdos.h: Common definitions for target rdos * gcc/config/i386/rdos64.h: Specific definitions for 64-bit rdos target. * gcc/config.gcc: Added rdos targets Tested on target rdos and rdos32. Leif Ekblad ----- Original Message ----- From: "Leif Ekblad" To: "Uros Bizjak" ; Cc: "H.J. Lu" Sent: Monday, January 07, 2013 11:13 PM Subject: Re: [PATCH] Adding target rdos to GCC > Hello Uros, > > I tried to use your suggestion and use DEFAULT_SECTION_THRESHOLD > in i386.opt, however this doesn't work for me. It seems the default is > always > 65536 regardless of what I define in rdos.h. Therefore, I kept the design > as it was before. > > Changing name to TARGET_RDOS seems reasonable, and this has been changed. > The location of the defines are also changed to the positions you > proposed. > > I added another include-file (rdos32.h) for the 32-bit target. Currently, > the > 32-bit target is supported with OpenWatcom. While I want to make sure > the header-files compile for both 32- and 64-bits, 32-bit support is not > my primary target right now. I just need a GCC that can build the 32-bit > version. > > 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 using TARGET_RDOS define. Provided a way to > define a default value for large-data-threshold. > * gcc/config/i386/i386.h: Defined TARGET_RDOS macro. 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 64-bit rdos target. > * gcc/config/i386/rdos32.h: Added new file for 32-bit rdos target. > * gcc/config.gcc: Added rdos targets > > Leif Ekblad > > > ----- Original Message ----- > From: "Uros Bizjak" > To: > Cc: "Leif Ekblad" ; "H.J. Lu" > Sent: Sunday, January 06, 2013 9:32 PM > Subject: Re: [PATCH] Adding target rdos to GCC > > >> Hello! >> >>> 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. >> >> *** gcc-4.8-20121230/gcc/config/i386/i386.c Thu Dec 27 02:58:06 2012 >> --- gcc-work/gcc/config/i386/i386.c Sun Jan 6 14:10:34 2013 >> >> + if (ix86_section_threshold == 0) >> + ix86_section_threshold = DEFAULT_SECTION_THRESHOLD; >> >> Please see attached patch on how to initialize an option. >> >> *** gcc-4.8-20121230/gcc/config/i386/i386.h Wed Dec 19 17:04:12 2012 >> --- gcc-work/gcc/config/i386/i386.h Sun Jan 6 13:24:26 2013 >> >> + #define TARGET_MEDIUM_PIC 0 >> >> You should just use TARGET_RDOS here (also, please see attached patch). >> >> + /* Default threshold for putting data in large sections with x86-64 >> + medium memory model */ >> + #define DEFAULT_SECTION_THRESHOLD 65536 >> >> Do not put this define in the middle of i386.h section that deals with >> alignment... >> >> *** gcc-4.8-20121230/gcc/config/i386/rdos.h Thu Jan 1 01:00:00 1970 >> --- gcc-work/gcc/config/i386/rdos.h Sun Jan 6 13:20:12 2013 >> >> + #undef REAL_PIC_OFFSET_TABLE_REGNUM >> + #define REAL_PIC_OFFSET_TABLE_REGNUM R15_REG >> >> Is this header also used for 32bit target? You should not use REX >> registers for 32bit targets. >> >> + #undef TARGET_MEDIUM_PIC >> + #define TARGET_MEDIUM_PIC 1 >> >> TARGET_RDOS >> >> + #define DEFAULT_SECTION_THRESHOLD 0x10 >> >> No hex numbers here. Also, you will need to #undef this first to >> override the default in i386.h. >> >> *** gcc-4.8-20121230/gcc/config.gcc Thu Nov 22 00:33:40 2012 >> --- gcc-work/gcc/config.gcc Fri Jan 4 21:08:46 2013 >> >> + i[34567]86-*-rdos*) >> + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h >> newlib-stdint.h" >> + ;; >> >> You forgot to include i386/rdos.h here (other headers too?). It is >> needed at least for TARGET_EXECUTABLE_SUFFIX define. >> >> Uros. >> > ------=_NextPart_000_0280_01CDEDE7.9EC39AE0 Content-Type: application/octet-stream; name="gcc-base.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gcc-base.diff" Content-length: 6684 diff -crN gcc-4.8-20121230/config/gthr.m4 gcc-work/config/gthr.m4=0A= *** gcc-4.8-20121230/config/gthr.m4 2012-10-15 15:10:30.000000000 +0200=0A= --- gcc-work/config/gthr.m4 2013-01-07 10:14:04.620667900 +0100=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 2012-12-27 02:58:06.000000000 += 0100=0A= --- gcc-work/gcc/config/i386/i386.c 2013-01-07 10:14:04.636667900 +0100=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_RDOS)=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= 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 2012-12-19 17:04:11.000000000 += 0100=0A= --- gcc-work/gcc/config/i386/i386.h 2013-01-07 10:43:07.612247200 +0100=0A= ***************=0A= *** 519,524 ****=0A= --- 519,527 ----=0A= #define MACHOPIC_INDIRECT 0=0A= #define MACHOPIC_PURE 0=0A= =20=20=0A= + /* For the RDOS */=0A= + #define TARGET_RDOS 0=0A= +=20=0A= /* For the Windows 64-bit ABI. */=0A= #define TARGET_64BIT_MS_ABI (TARGET_64BIT && ix86_cfun_abi () =3D=3D MS_A= BI)=0A= =20=20=0A= ***************=0A= *** 2081,2086 ****=0A= --- 2084,2093 ----=0A= asm (SECTION_OP "\n\t" \=0A= "call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n" \=0A= TEXT_SECTION_ASM_OP);=0A= +=20=0A= + /* Default threshold for putting data in large sections=0A= + with x86-64 medium memory model */=0A= + #define DEFAULT_LARGE_SECTION_THRESHOLD 65536=0A= =0C=0A= /* Which processor to tune code generation for. */=0A= =20=20=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 2012-12-19 17:04:11.000000000 = +0100=0A= --- gcc-work/gcc/config/i386/i386.md 2013-01-07 10:14:04.644667900 +0100=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 2012-11-16 08:17:30.000000000= +0100=0A= --- gcc-work/gcc/config/i386/i386.opt 2013-01-07 10:14:04.646667900 +0100= =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(DE= FAULT_LARGE_SECTION_THRESHOLD)=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 1970-01-01 01:00:00.000000000 += 0100=0A= --- gcc-work/gcc/config/i386/rdos.h 2013-01-07 10:37:24.281217700 +0100=0A= ***************=0A= *** 0 ****=0A= --- 1,15 ----=0A= +=20=0A= + /* RDOS uses .exe suffix */=0A= + #undef TARGET_EXECUTABLE_SUFFIX=0A= + #define TARGET_EXECUTABLE_SUFFIX ".exe"=0A= +=20=0A= + #undef TARGET_RDOS=0A= + #define TARGET_RDOS 1=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/i386/rdos64.h gcc-work/gcc/config/i38= 6/rdos64.h=0A= *** gcc-4.8-20121230/gcc/config/i386/rdos64.h 1970-01-01 01:00:00.000000000= +0100=0A= --- gcc-work/gcc/config/i386/rdos64.h 2013-01-07 10:38:29.596748600 +0100= =0A= ***************=0A= *** 0 ****=0A= --- 1,6 ----=0A= +=20=0A= + #undef REAL_PIC_OFFSET_TABLE_REGNUM=0A= + #define REAL_PIC_OFFSET_TABLE_REGNUM R15_REG=0A= +=20=0A= + #undef DEFAULT_LARGE_SECTION_THRESHOLD=0A= + #define DEFAULT_LARGE_SECTION_THRESHOLD 16=0A= diff -crN gcc-4.8-20121230/gcc/config.gcc gcc-work/gcc/config.gcc=0A= *** gcc-4.8-20121230/gcc/config.gcc 2012-11-22 00:33:40.000000000 +0100=0A= --- gcc-work/gcc/config.gcc 2013-01-07 10:36:47.446534600 +0100=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 i386/i386elf.h i386/rdos.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 i386/rdos64.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= ;;=0A= =0A= ------=_NextPart_000_0280_01CDEDE7.9EC39AE0--