config.gcc (i[34567]86-*-rdos*, [...]): New targets.
authorLeif Ekblad <leif@rdos.net>
Mon, 28 Jan 2013 20:42:55 +0000 (20:42 +0000)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 28 Jan 2013 20:42:55 +0000 (21:42 +0100)
* 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

gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/config/i386/i386.opt
gcc/config/i386/rdos.h [new file with mode: 0644]
gcc/config/i386/rdos64.h [new file with mode: 0644]

index 917986be8ad37c1b4002e1ae01e7e6711d3ef952..2b2e540819e16789870a486f52260d609c4113a9 100644 (file)
@@ -1,3 +1,16 @@
+2013-01-28  Leif Ekblad  <leif@rdos.net>
+
+       * 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  <bernds@codesourcery.com>
 
        PR other/54814
index 53a1e4b3274cdbf3af0968e1b0b701379f9b758c..ca76fc8539d8fe02d8da9f356492bf86b16572f9 100644 (file)
@@ -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"
        ;;
index fcfe78c97151855035692d5215919e8f1d063ddb..19a495d15da860e1d33c27fd50fec132c7ac9f56 100644 (file)
@@ -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)
     {
index af293b428b36f123599fd66b7248a396f26b50e0..a69862c549f4a56725c2ec5116a99883c32db0e7 100644 (file)
@@ -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
 \f
 /* Which processor to tune code generation for.  */
 
index 59b5b69b13b11db37a967a8bf9738b65cbfb67e4..24d1012d5ce02d9b967b87341bed1965301782ff 100644 (file)
    (R11_REG                    40)
    (R12_REG                    41)
    (R13_REG                    42)
+   (R14_REG                    43)
+   (R15_REG                    44)
    (XMM8_REG                   45)
    (XMM9_REG                   46)
    (XMM10_REG                  47)
index df53c6a8de12b564ffb10161e9a0ac074e262753..084a248635344c59166442cc7531a13e60f13075 100644 (file)
@@ -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 (file)
index 0000000..b67c152
--- /dev/null
@@ -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
+<http://www.gnu.org/licenses/>.  */
+
+/* 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 (file)
index 0000000..8522ad4
--- /dev/null
@@ -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
+<http://www.gnu.org/licenses/>.  */
+
+#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