summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/config/i386
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2002-10-10 04:40:18 +0000
committerkan <kan@FreeBSD.org>2002-10-10 04:40:18 +0000
commit92318bc515d223b2eeebb665f76e131dd2318b2b (patch)
treef505e08c93c8d3d8e51f5dac050b459cce4d4ae2 /contrib/gcc/config/i386
parent48f00f4c43af857e09b5f961c806a8811c504a3c (diff)
downloadFreeBSD-src-92318bc515d223b2eeebb665f76e131dd2318b2b.zip
FreeBSD-src-92318bc515d223b2eeebb665f76e131dd2318b2b.tar.gz
Gcc 3.2.1-prerelease from the FSF anoncvs repo gcc-3_2-branch on October 9th 2002 20:15 EST.
Diffstat (limited to 'contrib/gcc/config/i386')
-rw-r--r--contrib/gcc/config/i386/i386.c63
-rw-r--r--contrib/gcc/config/i386/i386.h23
-rw-r--r--contrib/gcc/config/i386/linux64.h19
-rw-r--r--contrib/gcc/config/i386/t-linux643
-rw-r--r--contrib/gcc/config/i386/winnt.c19
5 files changed, 74 insertions, 53 deletions
diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c
index f07ebad..5e48715 100644
--- a/contrib/gcc/config/i386/i386.c
+++ b/contrib/gcc/config/i386/i386.c
@@ -284,25 +284,25 @@ struct processor_costs athlon_cost = {
8, /* "large" insn */
9, /* MOVE_RATIO */
4, /* cost for loading QImode using movzbl */
- {4, 5, 4}, /* cost of loading integer registers
+ {3, 4, 3}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
- {2, 3, 2}, /* cost of storing integer registers */
+ {3, 4, 3}, /* cost of storing integer registers */
4, /* cost of reg,reg fld/fst */
- {6, 6, 20}, /* cost of loading fp registers
+ {4, 4, 12}, /* cost of loading fp registers
in SFmode, DFmode and XFmode */
- {4, 4, 16}, /* cost of loading integer registers */
+ {6, 6, 8}, /* cost of loading integer registers */
2, /* cost of moving MMX register */
- {2, 2}, /* cost of loading MMX registers
+ {4, 4}, /* cost of loading MMX registers
in SImode and DImode */
- {2, 2}, /* cost of storing MMX registers
+ {4, 4}, /* cost of storing MMX registers
in SImode and DImode */
2, /* cost of moving SSE register */
- {2, 2, 8}, /* cost of loading SSE registers
+ {4, 4, 6}, /* cost of loading SSE registers
in SImode, DImode and TImode */
- {2, 2, 8}, /* cost of storing SSE registers
+ {4, 4, 5}, /* cost of storing SSE registers
in SImode, DImode and TImode */
- 6, /* MMX or SSE register to integer */
+ 5, /* MMX or SSE register to integer */
64, /* size of prefetch block */
6, /* number of parallel prefetches */
};
@@ -1649,7 +1649,11 @@ classify_argument (mode, type, classes, bit_offset)
{
int bytes =
(mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
- int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
+ int words = (bytes + (bit_offset % 64) / 8 + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
+
+ /* Variable sized structures are always passed on the stack. */
+ if (mode == BLKmode && type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
+ return 0;
if (type && AGGREGATE_TYPE_P (type))
{
@@ -3206,7 +3210,7 @@ q_regs_operand (op, mode)
return 0;
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
- return QI_REG_P (op);
+ return ANY_QI_REG_P (op);
}
/* Return true if op is a NON_Q_REGS class register. */
@@ -6123,7 +6127,10 @@ print_operand_address (file, addr)
int scale;
if (! ix86_decompose_address (addr, &parts))
- abort ();
+ {
+ output_operand_lossage ("Wrong address expression or operand constraint");
+ return;
+ }
base = parts.base;
index = parts.index;
@@ -8237,7 +8244,7 @@ ix86_expand_int_movcc (operands)
clob = gen_rtx_CLOBBER (VOIDmode, clob);
tmp = gen_rtx_SET (VOIDmode, out, tmp);
- tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, tmp, clob));
+ tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, copy_rtx (tmp), clob));
emit_insn (tmp);
}
else
@@ -12355,17 +12362,33 @@ ix86_register_move_cost (mode, class1, class2)
enum reg_class class1, class2;
{
/* In case we require secondary memory, compute cost of the store followed
- by load. In case of copying from general_purpose_register we may emit
- multiple stores followed by single load causing memory size mismatch
- stall. Count this as arbitarily high cost of 20. */
+ by load. In order to avoid bad register allocation choices, we need
+ for this to be *at least* as high as the symmetric MEMORY_MOVE_COST. */
+
if (ix86_secondary_memory_needed (class1, class2, mode, 0))
{
- int add_cost = 0;
+ int cost = 1;
+
+ cost += MAX (MEMORY_MOVE_COST (mode, class1, 0),
+ MEMORY_MOVE_COST (mode, class1, 1));
+ cost += MAX (MEMORY_MOVE_COST (mode, class2, 0),
+ MEMORY_MOVE_COST (mode, class2, 1));
+
+ /* In case of copying from general_purpose_register we may emit multiple
+ stores followed by single load causing memory size mismatch stall.
+ Count this as arbitarily high cost of 20. */
if (CLASS_MAX_NREGS (class1, mode) > CLASS_MAX_NREGS (class2, mode))
- add_cost = 20;
- return (MEMORY_MOVE_COST (mode, class1, 0)
- + MEMORY_MOVE_COST (mode, class2, 1) + add_cost);
+ cost += 20;
+
+ /* In the case of FP/MMX moves, the registers actually overlap, and we
+ have to switch modes in order to treat them differently. */
+ if ((MMX_CLASS_P (class1) && MAYBE_FLOAT_CLASS_P (class2))
+ || (MMX_CLASS_P (class2) && MAYBE_FLOAT_CLASS_P (class1)))
+ cost += 20;
+
+ return cost;
}
+
/* Moves between SSE/MMX and integer unit are expensive. */
if (MMX_CLASS_P (class1) != MMX_CLASS_P (class2)
|| SSE_CLASS_P (class1) != SSE_CLASS_P (class2))
diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h
index 07502a2..58d2c433 100644
--- a/contrib/gcc/config/i386/i386.h
+++ b/contrib/gcc/config/i386/i386.h
@@ -584,9 +584,13 @@ extern int ix86_arch;
%{march=pentium-mmx:-D__i586 -D__i586__ -D__pentium -D__pentium__ \
-D__pentium__mmx__ \
%{!mcpu*:-D__tune_i586__ -D__tune_pentium__ -D__tune_pentium_mmx__}}\
-%{march=pentiumpro|march=i686:-D__i686 -D__i686__ \
+%{march=pentiumpro|march=i686|march=pentium2|march=pentium3:-D__i686 -D__i686__ \
-D__pentiumpro -D__pentiumpro__ \
%{!mcpu*:-D__tune_i686__ -D__tune_pentiumpro__ }}\
+%{march=march=pentium2|march=pentium3: -D__pentium2 -D__pentium2__\
+ %{!mcpu*:-D__tune_pentium2__ }}\
+%{march=pentium3: -D__pentium3 -D__pentium3__\
+ %{!mcpu*:-D__tune_pentium3__ }}\
%{march=k6:-D__k6 -D__k6__ %{!mcpu*:-D__tune_k6__ }}\
%{march=k6-2:-D__k6 -D__k6__ -D__k6_2__ \
%{!mcpu*:-D__tune_k6__ -D__tune_k6_2__ }}\
@@ -601,7 +605,7 @@ extern int ix86_arch;
%{m386|mcpu=i386:-D__tune_i386__ }\
%{m486|mcpu=i486:-D__tune_i486__ }\
%{mpentium|mcpu=pentium|mcpu=i586|mcpu=pentium-mmx:-D__tune_i586__ -D__tune_pentium__ }\
-%{mpentiumpro|mcpu=pentiumpro|mcpu=i686|cpu=pentium2|cpu=pentium3:-D__tune_i686__ \
+%{mpentiumpro|mcpu=pentiumpro|mcpu=i686|mcpu=pentium2|mcpu=pentium3:-D__tune_i686__ \
-D__tune_pentiumpro__ }\
%{mcpu=k6|mcpu=k6-2|mcpu=k6-3:-D__tune_k6__ }\
%{mcpu=athlon|mcpu=athlon-tbird|mcpu=athlon-4|mcpu=athlon-xp|mcpu=athlon-mp:\
@@ -609,17 +613,17 @@ extern int ix86_arch;
%{mcpu=athlon-4|mcpu=athlon-xp|mcpu=athlon-mp:\
-D__tune_athlon_sse__ }\
%{mcpu=pentium4:-D__tune_pentium4__ }\
-%{march=athlon-xp|march=athlon-mp|march=pentium3|march=pentium4:\
+%{march=athlon-xp|march=athlon-mp|march=pentium3|march=pentium4|msse|msse2:\
-D__SSE__ }\
%{march=pentium-mmx|march=k6|march=k6-2|march=k6-3\
|march=athlon|march=athlon-tbird|march=athlon-4|march=athlon-xp\
-|march=athlon-mp|march=pentium2|march=pentium3|march=pentium4: -D__MMX__ }\
+|march=athlon-mp|march=pentium2|march=pentium3|march=pentium4|mmx|msse|m3dnow: -D__MMX__ }\
%{march=k6-2|march=k6-3\
|march=athlon|march=athlon-tbird|march=athlon-4|march=athlon-xp\
-|march=athlon-mp: -D__3dNOW__ }\
+|march=athlon-mp|m3dnow: -D__3dNOW__ }\
%{march=athlon|march=athlon-tbird|march=athlon-4|march=athlon-xp\
|march=athlon-mp: -D__3dNOW_A__ }\
-%{march=pentium4: -D__SSE2__ }\
+%{march=pentium4|msse2: -D__SSE2__ }\
%{!march*:%{!mcpu*:%{!m386:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}}}"
#ifndef CPP_CPU_SPEC
@@ -756,8 +760,11 @@ extern int ix86_arch;
#define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN \
(ix86_preferred_stack_boundary > STACK_BOUNDARY && !TARGET_64BIT)
-/* Allocation boundary for the code of a function. */
-#define FUNCTION_BOUNDARY 16
+/* Minimum allocation boundary for the code of a function. */
+#define FUNCTION_BOUNDARY 8
+
+/* C++ stores the virtual bit in the lowest bit of function pointers. */
+#define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_pfn
/* Alignment of field after `int : 0' in a structure. */
diff --git a/contrib/gcc/config/i386/linux64.h b/contrib/gcc/config/i386/linux64.h
index 6158431..8a0bfbe 100644
--- a/contrib/gcc/config/i386/linux64.h
+++ b/contrib/gcc/config/i386/linux64.h
@@ -50,21 +50,14 @@ Boston, MA 02111-1307, USA. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
- "%{m32:%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} \
- crti.o%s %{static:crtbeginT.o%s}\
- %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}} \
- %{!m32:%{!shared: \
- %{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} \
- %{!p:%{profile:/usr/lib64/gcrt1.o%s} %{!profile:/usr/lib64/crt1.o%s}}}}\
- /usr/lib64/crti.o%s %{static:crtbeginT.o%s} \
- %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}}"
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} \
+ crti.o%s %{static:crtbeginT.o%s} \
+ %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "\
- %{m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s} \
- %{!m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s}"
+#define ENDFILE_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
#define MULTILIB_DEFAULTS { "m64" }
diff --git a/contrib/gcc/config/i386/t-linux64 b/contrib/gcc/config/i386/t-linux64
index 46a7caa..31b6ad4 100644
--- a/contrib/gcc/config/i386/t-linux64
+++ b/contrib/gcc/config/i386/t-linux64
@@ -6,10 +6,9 @@ SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
+MULTILIB_OSDIRNAMES = ../lib64 ../lib
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
-SHLIB_SLIBDIR_SUFFIXES = 64:64 32:
diff --git a/contrib/gcc/config/i386/winnt.c b/contrib/gcc/config/i386/winnt.c
index 9d955df..6928a8c 100644
--- a/contrib/gcc/config/i386/winnt.c
+++ b/contrib/gcc/config/i386/winnt.c
@@ -76,6 +76,15 @@ ix86_handle_dll_attribute (node, name, args, flags, no_add_attrs)
}
}
+ /* `extern' needn't be specified with dllimport.
+ Specify `extern' now and hope for the best. Sigh. */
+ else if (TREE_CODE (*node) == VAR_DECL
+ && is_attribute_p ("dllimport", name))
+ {
+ DECL_EXTERNAL (*node) = 1;
+ TREE_PUBLIC (*node) = 1;
+ }
+
return NULL_TREE;
}
@@ -300,16 +309,6 @@ i386_pe_mark_dllimport (decl)
return;
}
- /* `extern' needn't be specified with dllimport.
- Specify `extern' now and hope for the best. Sigh. */
- if (TREE_CODE (decl) == VAR_DECL
- /* ??? Is this test for vtables needed? */
- && !DECL_VIRTUAL_P (decl))
- {
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- }
-
newname = alloca (strlen (oldname) + 11);
sprintf (newname, "@i._imp__%s", oldname);
OpenPOWER on IntegriCloud