aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorLeif Ekblad <leif@rdos.net>2013-01-28 20:42:55 +0000
committerUros Bizjak <uros@gcc.gnu.org>2013-01-28 21:42:55 +0100
commit5a579c3b65d5571b3d10d2b7e22d4c1915cc6b1c (patch)
treec3f559b64cf44eaeefcf685c815fe50c2af35c64 /gcc/config
parent51e44392b3084a2bb00aa185f42f538a61c7befe (diff)
downloadgcc-5a579c3b65d5571b3d10d2b7e22d4c1915cc6b1c.zip
gcc-5a579c3b65d5571b3d10d2b7e22d4c1915cc6b1c.tar.gz
gcc-5a579c3b65d5571b3d10d2b7e22d4c1915cc6b1c.tar.bz2
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
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/config/i386/i386.h7
-rw-r--r--gcc/config/i386/i386.md2
-rw-r--r--gcc/config/i386/i386.opt2
-rw-r--r--gcc/config/i386/rdos.h33
-rw-r--r--gcc/config/i386/rdos64.h24
6 files changed, 70 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fcfe78c..19a495d 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 af293b4..a69862c 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 59b5b69..24d1012 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 df53c6a..084a248 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 0000000..b67c152
--- /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
+<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
index 0000000..8522ad4
--- /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
+<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