From: Leif Ekblad Date: Mon, 28 Jan 2013 20:42:55 +0000 (+0000) Subject: config.gcc (i[34567]86-*-rdos*, [...]): New targets. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a579c3b65d5571b3d10d2b7e22d4c1915cc6b1c;p=gcc.git config.gcc (i[34567]86-*-rdos*, [...]): New targets. * config.gcc (i[34567]86-*-rdos*, x86_64-*-rdos*): New targets. * config/i386/i386.h (TARGET_RDOS): New macro. (DEFAULT_LARGE_SECTION_THRESHOLD): New macro. * config/i386/i386.c (ix86_option_override_internal): For 64bit TARGET_RDOS, set ix86_cmodel to CM_MEDIUM_PIC and flag_pic to 1. * config/i386/i386.opt (mlarge-data-threshold): Initialize to DEFAULT_LARGE_SECTION_THRESHOLD. * config/i386/i386.md (R14_REG, R15_REG): New constants. * config/i386/rdos.h: New file. * config/i386/rdos64.h: New file. From-SVN: r195516 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 917986be8ad..2b2e540819e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2013-01-28 Leif Ekblad + + * config.gcc (i[34567]86-*-rdos*, x86_64-*-rdos*): New targets. + * config/i386/i386.h (TARGET_RDOS): New macro. + (DEFAULT_LARGE_SECTION_THRESHOLD): New macro. + * config/i386/i386.c (ix86_option_override_internal): For 64bit + TARGET_RDOS, set ix86_cmodel to CM_MEDIUM_PIC and flag_pic to 1. + * config/i386/i386.opt (mlarge-data-threshold): Initialize to + DEFAULT_LARGE_SECTION_THRESHOLD. + * config/i386/i386.md (R14_REG, R15_REG): New constants. + * config/i386/rdos.h: New file. + * config/i386/rdos64.h: New file. + 2013-01-28 Bernd Schmidt PR other/54814 diff --git a/gcc/config.gcc b/gcc/config.gcc index 53a1e4b3274..ca76fc8539d 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -738,6 +738,9 @@ case ${target} in use_gcc_stdint=wrap tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ;; +*-*-rdos*) + use_gcc_stdint=wrap + ;; *-*-solaris2*) # i?86-*-solaris2* needs to insert headers between cpu default and # Solaris 2 specific ones. @@ -1204,6 +1207,13 @@ i[34567]86-*-elf*) x86_64-*-elf*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h" ;; +i[34567]86-*-rdos*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h" + ;; +x86_64-*-rdos*) + tm_file="${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" + tmake_file="i386/t-i386elf t-svr4" + ;; i[34567]86-*-freebsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h" ;; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index fcfe78c9715..19a495d15da 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3235,10 +3235,12 @@ ix86_option_override_internal (bool main_args_p) DLL, and is essentially just as efficient as direct addressing. */ if (TARGET_64BIT && DEFAULT_ABI == MS_ABI) ix86_cmodel = CM_SMALL_PIC, flag_pic = 1; + else if (TARGET_64BIT && TARGET_RDOS) + ix86_cmodel = CM_MEDIUM_PIC, flag_pic = 1; else if (TARGET_64BIT) ix86_cmodel = flag_pic ? CM_SMALL_PIC : CM_SMALL; else - ix86_cmodel = CM_32; + ix86_cmodel = CM_32; } if (TARGET_MACHO && ix86_asm_dialect == ASM_INTEL) { diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index af293b428b3..a69862c549f 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -518,6 +518,9 @@ extern tree x86_mfence; #define MACHOPIC_INDIRECT 0 #define MACHOPIC_PURE 0 +/* For the RDOS */ +#define TARGET_RDOS 0 + /* For the Windows 64-bit ABI. */ #define TARGET_64BIT_MS_ABI (TARGET_64BIT && ix86_cfun_abi () == MS_ABI) @@ -2081,6 +2084,10 @@ do { \ asm (SECTION_OP "\n\t" \ "call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n" \ TEXT_SECTION_ASM_OP); + +/* Default threshold for putting data in large sections + with x86-64 medium memory model */ +#define DEFAULT_LARGE_SECTION_THRESHOLD 65536 /* Which processor to tune code generation for. */ diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 59b5b69b13b..24d1012d5ce 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -300,6 +300,8 @@ (R11_REG 40) (R12_REG 41) (R13_REG 42) + (R14_REG 43) + (R15_REG 44) (XMM8_REG 45) (XMM9_REG 46) (XMM10_REG 47) diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index df53c6a8de1..084a2486353 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -140,7 +140,7 @@ Target RejectNegative Joined UInteger Var(ix86_branch_cost) Branches are this expensive (1-5, arbitrary units) mlarge-data-threshold= -Target RejectNegative Joined UInteger Var(ix86_section_threshold) Init(65536) +Target RejectNegative Joined UInteger Var(ix86_section_threshold) Init(DEFAULT_LARGE_SECTION_THRESHOLD) Data greater than given threshold will go into .ldata section in x86-64 medium model mcmodel= diff --git a/gcc/config/i386/rdos.h b/gcc/config/i386/rdos.h new file mode 100644 index 00000000000..b67c1529037 --- /dev/null +++ b/gcc/config/i386/rdos.h @@ -0,0 +1,33 @@ +/* Definitions for RDOS on i386. + Copyright (C) 2013 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* RDOS uses .exe suffix */ +#undef TARGET_EXECUTABLE_SUFFIX +#define TARGET_EXECUTABLE_SUFFIX ".exe" + +#undef TARGET_RDOS +#define TARGET_RDOS 1 + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__RDOS__"); \ + builtin_assert ("system=rdos"); \ + } \ + while (0) diff --git a/gcc/config/i386/rdos64.h b/gcc/config/i386/rdos64.h new file mode 100644 index 00000000000..8522ad48c18 --- /dev/null +++ b/gcc/config/i386/rdos64.h @@ -0,0 +1,24 @@ +/* Definitions for RDOS on x86_64. + Copyright (C) 2013 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#undef REAL_PIC_OFFSET_TABLE_REGNUM +#define REAL_PIC_OFFSET_TABLE_REGNUM R15_REG + +#undef DEFAULT_LARGE_SECTION_THRESHOLD +#define DEFAULT_LARGE_SECTION_THRESHOLD 16