Commit ccf8e764 by Richard Henderson Committed by Richard Henderson

cygming.h (DWARF2_DEBUGGING_INFO): Enable by default for 64-bit.

gcc/
	* config/i386/cygming.h (DWARF2_DEBUGGING_INFO): Enable by
	default for 64-bit.
	(PREFERRED_DEBUGGING_TYPE): Prefer dwarf2 for 64-bit.
	(TARGET_64BIT_MS_ABI): New.
	(DBX_REGISTER_NUMBER): Handle 64-bit.
	(SIZE_TYPE, PTRDIFF_TYPE): Use long long for 64-bit.
	(LONG_TYPE_SIZE): Force to 32.
	(REG_PARM_STACK_SPACE): New.
	(OUTGOING_REG_PARM_STACK_SPACE): New.
	(REGPARM_MAX, SSE_REGPARM_MAX): New.
	(HANDLE_PRAGMA_PUSH_POP_MACRO): New.
	(STACK_BOUNDARY): Use 128 for 64-bit.
	* config/i386/cygwin.asm: Use push/ret to preserve call stack.
	Add 64-bit implementation.
	* config/i386/gthr-win32.c (__gthr_win32_key_create): Mark dtor
	argument unused.
	* config/i386/i386.c (x86_64_ms_abi_int_parameter_registers): New.
	(override_options): Set ix86_cmodel for TARGET_64BIT_MS_ABI.
	Warn for -mregparm, -mrtd in 64-bit mode; force ix86_regparm
	for 64-bit; use TARGET_SUBTARGET64_DEFAULT.
	(ix86_handle_cconv_attribute): Don't warn when ignoring if
	TARGET_64BIT_MS_ABI.
	(ix86_function_arg_regno_p): Handle TARGET_64BIT_MS_ABI.
	(ix86_pass_by_reference): Likewise.
	(ix86_function_value_regno_p): Likewise.
	(ix86_build_builtin_va_list): Likewise.
	(ix86_va_start, ix86_gimplify_va_arg): Likewise.
	(function_arg_advance_ms_64): New.
	(function_arg_advance): Call it.
	(function_arg_ms_64): New.
	(function_arg): Call it.
	(function_value_ms_64): New.
	(ix86_function_value_1): Call it.
	(return_in_memory_ms_64): New.
	(ix86_return_in_memory): Call it.
	(setup_incoming_varargs_ms_64): New.
	(ix86_setup_incoming_varargs): Call it.
	(ix86_expand_prologue): Handle 64-bit stack probing.
	(legitimize_pic_address): Handle TARGET_64BIT_MS_ABI.
	(output_pic_addr_const): Likewise.
	(x86_this_parameter): Likewise.
	(x86_output_mi_thunk): Likewise.
	(x86_function_profiler): Likewise.
	(TARGET_STRICT_ARGUMENT_NAMING): New.
	* config/i386/i386.h (TARGET_SUBTARGET64_DEFAULT): New.
	(TARGET_64BIT_MS_ABI): New.
	(CONDITIONAL_REGISTER_USAGE): Handle TARGET_64BIT_MS_ABI.
	* config/i386/i386.md (allocate_stack_worker): Remove.
	(allocate_stack_worker_32): Rename from allocate_stack_worker_1;
	describe the clobber of eax without a match_scratch.
	(allocate_stack_worker_postreload): Remove.
	(allocate_stack_worker_64): Rename from allocate_stack_worker_rex64;
	describe the clobbers of rax, r10, r11 properly; use __chkstk symbol.
	(allocate_stack_worker_rex64_postreload): Remove.
	(allocate_stack): Handle 64-bit.
	* config/i386/i386elf (TARGET_SUBTARGET_DEFAULT): Remove.
	* config/i386/mingw32.h (TARGET_VERSION): Set correctly for 64-bit.
	(EXTRA_OS_CPP_BUILTINS): Handle 64-bit.
	(STANDARD_INCLUDE_DIR): Handle TARGET_64BIT_DEFAULT.
	(STANDARD_STARTFILE_PREFIX_1): Likewise.
	* config/i386/unix.h (TARGET_SUBTARGET64_DEFAULT): New.
	* config.build (x86_64-*-mingw*): New host.
	* config.host (x86_64-*-mingw*): New host.
	* config.gcc (x86_64-*-mingw*): New target.
	* gthr-win32.h (__gthread_key_create): Mark dtor unused.
libgcc/
	* config.host (x86_64-*-mingw*): New target.

Co-Authored-By: Kai Tietz <kai.tietz@onevision.com>

From-SVN: r123372
parent 8318b0d9
2007-03-30 Richard Henderson <rth@redhat.com>
* tree-ssa-loop-ivopts.c: Include target.h.
(produce_memory_decl_rtl): Pass the rtx through encode_section_info.
(get_address_cost): Force SYMBOL_FLAG_LOCAL set.
(force_expr_to_var_cost): Use produce_memory_decl_rtl.
* Makefile.in (tree-ssa-loop-ivopts.o): Depend on TARGET_H.
2007-03-30 Richard Henderson <rth@redhat.com>
Kai Tietz <kai.tietz@onevision.com>
* config/i386/cygming.h (DWARF2_DEBUGGING_INFO): Enable by
default for 64-bit.
(PREFERRED_DEBUGGING_TYPE): Prefer dwarf2 for 64-bit.
(TARGET_64BIT_MS_ABI): New.
(DBX_REGISTER_NUMBER): Handle 64-bit.
(SIZE_TYPE, PTRDIFF_TYPE): Use long long for 64-bit.
(LONG_TYPE_SIZE): Force to 32.
(REG_PARM_STACK_SPACE): New.
(OUTGOING_REG_PARM_STACK_SPACE): New.
(REGPARM_MAX, SSE_REGPARM_MAX): New.
(HANDLE_PRAGMA_PUSH_POP_MACRO): New.
(STACK_BOUNDARY): Use 128 for 64-bit.
* config/i386/cygwin.asm: Use push/ret to preserve call stack.
Add 64-bit implementation.
* config/i386/gthr-win32.c (__gthr_win32_key_create): Mark dtor
argument unused.
* config/i386/i386.c (x86_64_ms_abi_int_parameter_registers): New.
(override_options): Set ix86_cmodel for TARGET_64BIT_MS_ABI.
Warn for -mregparm, -mrtd in 64-bit mode; force ix86_regparm
for 64-bit; use TARGET_SUBTARGET64_DEFAULT.
(ix86_handle_cconv_attribute): Don't warn when ignoring if
TARGET_64BIT_MS_ABI.
(ix86_function_arg_regno_p): Handle TARGET_64BIT_MS_ABI.
(ix86_pass_by_reference): Likewise.
(ix86_function_value_regno_p): Likewise.
(ix86_build_builtin_va_list): Likewise.
(ix86_va_start, ix86_gimplify_va_arg): Likewise.
(function_arg_advance_ms_64): New.
(function_arg_advance): Call it.
(function_arg_ms_64): New.
(function_arg): Call it.
(function_value_ms_64): New.
(ix86_function_value_1): Call it.
(return_in_memory_ms_64): New.
(ix86_return_in_memory): Call it.
(setup_incoming_varargs_ms_64): New.
(ix86_setup_incoming_varargs): Call it.
(ix86_expand_prologue): Handle 64-bit stack probing.
(legitimize_pic_address): Handle TARGET_64BIT_MS_ABI.
(output_pic_addr_const): Likewise.
(x86_this_parameter): Likewise.
(x86_output_mi_thunk): Likewise.
(x86_function_profiler): Likewise.
(TARGET_STRICT_ARGUMENT_NAMING): New.
* config/i386/i386.h (TARGET_SUBTARGET64_DEFAULT): New.
(TARGET_64BIT_MS_ABI): New.
(CONDITIONAL_REGISTER_USAGE): Handle TARGET_64BIT_MS_ABI.
* config/i386/i386.md (allocate_stack_worker): Remove.
(allocate_stack_worker_32): Rename from allocate_stack_worker_1;
describe the clobber of eax without a match_scratch.
(allocate_stack_worker_postreload): Remove.
(allocate_stack_worker_64): Rename from allocate_stack_worker_rex64;
describe the clobbers of rax, r10, r11 properly; use __chkstk symbol.
(allocate_stack_worker_rex64_postreload): Remove.
(allocate_stack): Handle 64-bit.
* config/i386/i386elf (TARGET_SUBTARGET_DEFAULT): Remove.
* config/i386/mingw32.h (TARGET_VERSION): Set correctly for 64-bit.
(EXTRA_OS_CPP_BUILTINS): Handle 64-bit.
(STANDARD_INCLUDE_DIR): Handle TARGET_64BIT_DEFAULT.
(STANDARD_STARTFILE_PREFIX_1): Likewise.
* config/i386/unix.h (TARGET_SUBTARGET64_DEFAULT): New.
* config.build (x86_64-*-mingw*): New host.
* config.host (x86_64-*-mingw*): New host.
* config.gcc (x86_64-*-mingw*): New target.
* gthr-win32.h (__gthread_key_create): Mark dtor unused.
2007-03-30 Richard Henderson <rth@redhat.com>
Kai Tietz <kai.tietz@onevision.com>
* c-pragma.c (struct def_pragma_macro_value): New.
......
......@@ -77,7 +77,7 @@ case $build in
build_xm_file=i386/xm-cygwin.h
build_exeext=.exe
;;
i[34567]86-*-mingw32*)
i[34567]86-*-mingw32* | x86_64-*-mingw*)
build_xm_file=i386/xm-mingw32.h
build_exeext=.exe
;;
......
......@@ -1343,7 +1343,7 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
thread_file='posix'
fi
;;
i[34567]86-*-mingw32*)
i[34567]86-*-mingw32* | x86_64-*-mingw32*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h"
xm_file=i386/xm-mingw32.h
tmake_file="i386/t-cygming i386/t-mingw32"
......
......@@ -168,7 +168,7 @@ case ${host} in
host_xmake_file="${host_xmake_file} i386/x-cygwin"
host_exeext=.exe
;;
i[34567]86-*-mingw32*)
i[34567]86-*-mingw32* | x86_64-*-mingw*)
host_xm_file=i386/xm-mingw32.h
host_xmake_file="${host_xmake_file} i386/x-mingw32"
host_exeext=.exe
......
......@@ -21,18 +21,35 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#if TARGET_64BIT_DEFAULT
#ifndef DWARF2_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO 1
#endif
#ifndef DWARF2_UNWIND_INFO
#define DWARF2_UNWIND_INFO 1
#endif
#endif
#define DBX_DEBUGGING_INFO 1
#define SDB_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
#if TARGET_64BIT_DEFAULT
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
#else
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#endif
#undef TARGET_64BIT_MS_ABI
#define TARGET_64BIT_MS_ABI TARGET_64BIT
#ifdef HAVE_GAS_PE_SECREL32_RELOC
#define DWARF2_DEBUGGING_INFO 1
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) (write_symbols == DWARF2_DEBUG \
? svr4_dbx_register_map[n] \
: dbx_register_map[n])
#define DBX_REGISTER_NUMBER(n) \
(TARGET_64BIT ? dbx64_register_map[n] \
: (write_symbols == DWARF2_DEBUG \
? svr4_dbx_register_map[n] : dbx_register_map[n]))
/* Use section relative relocations for debugging offsets. Unlike
other targets that fake this by putting the section VMA at 0, PE
......@@ -97,14 +114,32 @@ Boston, MA 02110-1301, USA. */
#undef MATH_LIBRARY
#define MATH_LIBRARY ""
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
#define SIZE_TYPE (TARGET_64BIT ? "long long unsigned int" : "unsigned int")
#define PTRDIFF_TYPE (TARGET_64BIT ? "long long int" : "int")
#define WCHAR_TYPE_SIZE 16
#define WCHAR_TYPE "short unsigned int"
/* Windows64 continues to use a 32-bit long type. */
#undef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE 32
#undef REG_PARM_STACK_SPACE
#define REG_PARM_STACK_SPACE(FNDECL) (TARGET_64BIT_MS_ABI ? 32 : 0)
#undef OUTGOING_REG_PARM_STACK_SPACE
#define OUTGOING_REG_PARM_STACK_SPACE (TARGET_64BIT_MS_ABI ? 1 : 0)
#undef REGPARM_MAX
#define REGPARM_MAX (TARGET_64BIT_MS_ABI ? 4 : 3)
#undef SSE_REGPARM_MAX
#define SSE_REGPARM_MAX (TARGET_64BIT_MS_ABI ? 4 : TARGET_SSE ? 3 : 0)
/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
/* Enable push_macro & pop_macro */
#define HANDLE_PRAGMA_PUSH_POP_MACRO 1
union tree_node;
#define TREE union tree_node *
......@@ -166,19 +201,21 @@ do { \
} while (0)
/* Emit code to check the stack when allocating more that 4000
/* Emit code to check the stack when allocating more than 4000
bytes in one go. */
#define CHECK_STACK_LIMIT 4000
#undef STACK_BOUNDARY
#define STACK_BOUNDARY (TARGET_64BIT_MS_ABI ? 128 : BITS_PER_WORD)
/* By default, target has a 80387, uses IEEE compatible arithmetic,
returns float values in the 387 and needs stack probes.
We also align doubles to 64-bits for MSVC default compatibility. */
#undef TARGET_SUBTARGET_DEFAULT
#define TARGET_SUBTARGET_DEFAULT \
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_STACK_PROBE \
| MASK_ALIGN_DOUBLE)
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS \
| MASK_STACK_PROBE | MASK_ALIGN_DOUBLE)
/* This is how to output an assembler line
that says to advance the location counter
......@@ -245,7 +282,9 @@ do { \
/* DWARF2 Unwinding doesn't work with exception handling yet. To make
it work, we need to build a libgcc_s.dll, and dcrt0.o should be
changed to call __register_frame_info/__deregister_frame_info. */
#ifndef DWARF2_UNWIND_INFO
#define DWARF2_UNWIND_INFO 0
#endif
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
......@@ -346,8 +385,8 @@ do { \
#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL))
#define SUBTARGET_ATTRIBUTE_TABLE \
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \
{ "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute }
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
/* mcount() does not need a counter variable. */
#undef NO_PROFILE_COUNTERS
......
......@@ -42,27 +42,66 @@
.global ___chkstk
.global __alloca
#ifndef _WIN64
___chkstk:
__alloca:
pushl %ecx /* save temp */
movl %esp,%ecx /* get sp */
addl $0x8,%ecx /* and point to return addr */
pushl %ecx /* save temp */
leal 8(%esp), %ecx /* point past return addr */
cmpl $0x1000, %eax /* > 4k ?*/
jb Ldone
probe: cmpl $0x1000,%eax /* > 4k ?*/
jb done
Lprobe:
subl $0x1000, %ecx /* yes, move pointer down 4k*/
orl $0x0, (%ecx) /* probe there */
subl $0x1000, %eax /* decrement count */
cmpl $0x1000, %eax
ja Lprobe /* and do it again */
subl $0x1000,%ecx /* yes, move pointer down 4k*/
orl $0x0,(%ecx) /* probe there */
subl $0x1000,%eax /* decrement count */
jmp probe /* and do it again */
Ldone:
subl %eax, %ecx
orl $0x0, (%ecx) /* less than 4k, just peek here */
done: subl %eax,%ecx
orl $0x0,(%ecx) /* less that 4k, just peek here */
movl %esp, %eax /* save old stack pointer */
movl %ecx, %esp /* decrement stack */
movl (%eax), %ecx /* recover saved temp */
movl 4(%eax), %eax /* recover return address */
movl %esp,%eax
movl %ecx,%esp /* decrement stack */
/* Push the return value back. Doing this instead of just
jumping to %eax preserves the cached call-return stack
used by most modern processors. */
pushl %eax
ret
#else
/* __alloca is a normal function call, which uses %rcx as the argument. */
__alloca:
movq %rcx, %rax
/* FALLTHRU */
/* ___chkstk is a *special* function call, which uses %rax as the argument.
We avoid clobbering the 4 integer argument registers, %rcx, %rdx,
%r8 and %r9, which leaves us with %rax, %r10, and %r11 to use. */
___chkstk:
popq %r11 /* pop return address */
movq %rsp, %r10 /* get sp */
cmpq $0x1000, %rax /* > 4k ?*/
jb Ldone
movl (%eax),%ecx /* recover saved temp */
movl 4(%eax),%eax /* get return address */
jmp *%eax
Lprobe:
subq $0x1000, %r10 /* yes, move pointer down 4k*/
orl $0x0, (%r10) /* probe there */
subq $0x1000, %rax /* decrement count */
cmpq $0x1000, %rax
ja Lprobe /* and do it again */
Ldone:
subq %rax, %r10
orl $0x0, (%r10) /* less than 4k, just peek here */
movq %r10, %rsp /* decrement stack */
/* Push the return value back. Doing this instead of just
jumping to %r11 preserves the cached call-return stack
used by most modern processors. */
pushq %r11
ret
#endif
#endif
......@@ -102,7 +102,8 @@ __gthr_win32_once (__gthread_once_t *once, void (*func) (void))
C++ EH. Mingw uses a thread-support DLL to work-around this problem. */
int
__gthr_win32_key_create (__gthread_key_t *key, void (*dtor) (void *))
__gthr_win32_key_create (__gthread_key_t *key,
void (*dtor) (void *) __attribute__((unused)))
{
int status = 0;
DWORD tls_index = TlsAlloc ();
......
......@@ -20,6 +20,21 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* The purpose of this file is to define the characteristics of the i386,
independent of assembler syntax or operating system.
Three other files build on this one to describe a specific assembler syntax:
bsd386.h, att386.h, and sun386.h.
The actual tm.h file for a particular system should include
this file, and then the file for the appropriate assembler syntax.
Many macros that specify assembler syntax are omitted entirely from
this file because they really belong in the files for particular
assemblers. These include RP, IP, LPREFIX, PUT_OP_SIZE, USE_STAR,
ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE, PRINT_B_I_S, and many
that start with ASM_ or end in ASM_OP. */
#include "config/vxworks-dummy.h"
/* Algorithm to expand string function with. */
......@@ -34,7 +49,9 @@ enum stringop_alg
loop,
unrolled_loop
};
#define NAX_STRINGOP_ALGS 4
/* Specify what algorithm to use for stringops on known size.
When size is unknown, the UNKNOWN_SIZE alg is used. When size is
known at compile time or estimated via feedback, the SIZE array
......@@ -43,8 +60,7 @@ enum stringop_alg
For example initializer:
{{256, loop}, {-1, rep_prefix_4_byte}}
will use loop for blocks smaller or equal to 256 bytes, rep prefix will
be used otherwise.
*/
be used otherwise. */
struct stringop_algs
{
const enum stringop_alg unknown_size;
......@@ -54,21 +70,6 @@ struct stringop_algs
} size [NAX_STRINGOP_ALGS];
};
/* The purpose of this file is to define the characteristics of the i386,
independent of assembler syntax or operating system.
Three other files build on this one to describe a specific assembler syntax:
bsd386.h, att386.h, and sun386.h.
The actual tm.h file for a particular system should include
this file, and then the file for the appropriate assembler syntax.
Many macros that specify assembler syntax are omitted entirely from
this file because they really belong in the files for particular
assemblers. These include RP, IP, LPREFIX, PUT_OP_SIZE, USE_STAR,
ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE, PRINT_B_I_S, and many
that start with ASM_ or end in ASM_OP. */
/* Define the specific costs for a given cpu */
struct processor_costs {
......@@ -372,11 +373,17 @@ extern int x86_prefetch_sse;
the frame pointer in leaf functions. */
#define TARGET_DEFAULT 0
/* Extra bits to force on w/ 64-bit mode. */
#define TARGET_SUBTARGET64_DEFAULT 0
/* This is not really a target flag, but is done this way so that
it's analogous to similar code for Mach-O on PowerPC. darwin.h
redefines this to 1. */
#define TARGET_MACHO 0
/* Likewise, for the Windows 64-bit ABI. */
#define TARGET_64BIT_MS_ABI 0
/* Subtargets may reset this to 1 in order to enable 96-bit long double
with the rounding mode forced to 53 bits. */
#define TARGET_96_ROUND_53_LONG_DOUBLE 0
......@@ -998,6 +1005,11 @@ do { \
for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++) \
reg_names[i] = ""; \
} \
if (TARGET_64BIT_MS_ABI) \
{ \
call_used_regs[4 /*RSI*/] = 0; \
call_used_regs[5 /*RDI*/] = 0; \
} \
} while (0)
/* Return number of consecutive hard regs needed starting at reg REGNO
......
......@@ -19611,86 +19611,56 @@
[(set_attr "type" "alu,lea")
(set_attr "mode" "DI")])
(define_expand "allocate_stack_worker"
[(match_operand:SI 0 "register_operand" "")]
"TARGET_STACK_PROBE"
{
if (reload_completed)
{
if (TARGET_64BIT)
emit_insn (gen_allocate_stack_worker_rex64_postreload (operands[0]));
else
emit_insn (gen_allocate_stack_worker_postreload (operands[0]));
}
else
{
if (TARGET_64BIT)
emit_insn (gen_allocate_stack_worker_rex64 (operands[0]));
else
emit_insn (gen_allocate_stack_worker_1 (operands[0]));
}
DONE;
})
(define_insn "allocate_stack_worker_1"
[(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "a")]
UNSPECV_STACK_PROBE)
(define_insn "allocate_stack_worker_32"
[(set (match_operand:SI 0 "register_operand" "+a")
(unspec_volatile:SI [(match_dup 0)] UNSPECV_STACK_PROBE))
(set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (match_dup 0)))
(clobber (match_scratch:SI 1 "=0"))
(clobber (reg:CC FLAGS_REG))]
"!TARGET_64BIT && TARGET_STACK_PROBE"
"call\t__alloca"
[(set_attr "type" "multi")
(set_attr "length" "5")])
(define_expand "allocate_stack_worker_postreload"
[(parallel [(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "a")]
UNSPECV_STACK_PROBE)
(set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (match_dup 0)))
(clobber (match_dup 0))
(clobber (reg:CC FLAGS_REG))])]
""
"")
(define_insn "allocate_stack_worker_rex64"
[(unspec_volatile:DI [(match_operand:DI 0 "register_operand" "a")]
UNSPECV_STACK_PROBE)
(define_insn "allocate_stack_worker_64"
[(set (match_operand:DI 0 "register_operand" "=a")
(unspec_volatile:DI [(match_dup 0)] UNSPECV_STACK_PROBE))
(set (reg:DI SP_REG) (minus:DI (reg:DI SP_REG) (match_dup 0)))
(clobber (match_scratch:DI 1 "=0"))
(clobber (reg:DI R10_REG))
(clobber (reg:DI R11_REG))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_STACK_PROBE"
"call\t__alloca"
"call\t___chkstk"
[(set_attr "type" "multi")
(set_attr "length" "5")])
(define_expand "allocate_stack_worker_rex64_postreload"
[(parallel [(unspec_volatile:DI [(match_operand:DI 0 "register_operand" "a")]
UNSPECV_STACK_PROBE)
(set (reg:DI SP_REG) (minus:DI (reg:DI SP_REG) (match_dup 0)))
(clobber (match_dup 0))
(clobber (reg:CC FLAGS_REG))])]
""
"")
(define_expand "allocate_stack"
[(parallel [(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (reg:SI SP_REG)
(match_operand:SI 1 "general_operand" "")))
(clobber (reg:CC FLAGS_REG))])
(parallel [(set (reg:SI SP_REG)
(minus:SI (reg:SI SP_REG) (match_dup 1)))
(clobber (reg:CC FLAGS_REG))])]
[(match_operand 0 "register_operand" "")
(match_operand 1 "general_operand" "")]
"TARGET_STACK_PROBE"
{
#ifdef CHECK_STACK_LIMIT
if (CONST_INT_P (operands[1])
rtx x;
#ifndef CHECK_STACK_LIMIT
#define CHECK_STACK_LIMIT 0
#endif
if (CHECK_STACK_LIMIT && CONST_INT_P (operands[1])
&& INTVAL (operands[1]) < CHECK_STACK_LIMIT)
emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
operands[1]));
{
x = expand_simple_binop (Pmode, MINUS, stack_pointer_rtx, operands[1],
stack_pointer_rtx, 0, OPTAB_DIRECT);
if (x != stack_pointer_rtx)
emit_move_insn (stack_pointer_rtx, x);
}
else
#endif
emit_insn (gen_allocate_stack_worker (copy_to_mode_reg (SImode,
operands[1])));
{
x = copy_to_mode_reg (Pmode, operands[1]);
if (TARGET_64BIT)
x = gen_allocate_stack_worker_64 (x);
else
x = gen_allocate_stack_worker_32 (x);
emit_insn (x);
}
emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
DONE;
......
......@@ -27,11 +27,6 @@ Boston, MA 02110-1301, USA. */
#define TARGET_VERSION fprintf (stderr, " (i386 bare ELF target)");
/* By default, target has a 80387, uses IEEE compatible arithmetic,
and returns float values in the 387. */
#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
/* The ELF ABI for the i386 says that records and unions are returned
in memory. */
......
......@@ -21,7 +21,11 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (x86 MinGW)");
#if TARGET_64BIT_DEFAULT
#define TARGET_VERSION fprintf (stderr,"(x86_64 MinGW");
#else
#define TARGET_VERSION fprintf (stderr," (x86 MinGW)");
#endif
/* See i386/crtdll.h for an alternative definition. */
#define EXTRA_OS_CPP_BUILTINS() \
......@@ -32,13 +36,28 @@ Boston, MA 02110-1301, USA. */
builtin_define ("_WIN32"); \
builtin_define_std ("WIN32"); \
builtin_define_std ("WINNT"); \
if (TARGET_64BIT_MS_ABI) \
{ \
builtin_define ("__MINGW64__"); \
builtin_define_with_value("_INTEGRAL_MAX_BITS","64",0); \
builtin_define_std ("WIN64"); \
builtin_define_std ("_WIN64"); \
} \
else \
{ \
builtin_define_with_value("_INTEGRAL_MAX_BITS","32",0); \
} \
} \
while (0)
/* Override the standard choice of /usr/include as the default prefix
to try when searching for header files. */
#undef STANDARD_INCLUDE_DIR
#if TARGET_64BIT_DEFAULT
#define STANDARD_INCLUDE_DIR "/mingw/include64"
#else
#define STANDARD_INCLUDE_DIR "/mingw/include"
#endif
#undef STANDARD_INCLUDE_COMPONENT
#define STANDARD_INCLUDE_COMPONENT "MINGW"
......@@ -71,8 +90,12 @@ Boston, MA 02110-1301, USA. */
/* Override startfile prefix defaults. */
#ifndef STANDARD_STARTFILE_PREFIX_1
#if TARGET_64BIT_DEFAULT
#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib64/"
#else
#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/"
#endif
#endif
#ifndef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_2 ""
#endif
......
......@@ -61,5 +61,10 @@ Boston, MA 02110-1301, USA. */
/* By default, target has a 80387, uses IEEE compatible arithmetic,
and returns float values in the 387. */
#define TARGET_SUBTARGET_DEFAULT \
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
/* By default, 64-bit mode uses 128-bit long double. */
#undef TARGET_SUBTARGET64_DEFAULT
#define TARGET_SUBTARGET64_DEFAULT \
MASK_128BIT_LONG_DOUBLE
......@@ -562,7 +562,8 @@ __gthread_once (__gthread_once_t *once, void (*func) (void))
leaks, especially in threaded applications making extensive use of
C++ EH. Mingw uses a thread-support DLL to work-around this problem. */
static inline int
__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
__gthread_key_create (__gthread_key_t *key,
void (*dtor) (void *) __attribute__((unused)))
{
int status = 0;
DWORD tls_index = TlsAlloc ();
......
2007-02-30 Kai Tietz <kai.tietz@onevision.com>
* config.host (x86_64-*-mingw*): New target.
2007-03-23 Michael Meissner <michael.meissner@amd.com>
H.J. Lu <hongjiu.lu@intel.com>
......
......@@ -364,7 +364,7 @@ i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
;;
i[34567]86-*-pe | i[34567]86-*-cygwin*)
;;
i[34567]86-*-mingw32*)
i[34567]86-*-mingw32* | x86_64-*-mingw*)
;;
i[34567]86-*-uwin*)
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment