* alpha.c (call_operand): Any reg is valid for WinNT.
[official-gcc.git] / gcc / config / alpha / win-nt.h
blob768256e574ccc91456d5432292712558d22579b4
1 /* Definitions of target machine for GNU compiler, for DEC Alpha
2 running Windows/NT.
3 Copyright (C) 1995, 1996 Free Software Foundation, Inc.
4 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* Names to predefine in the preprocessor for this target machine. */
25 #undef CPP_PREDEFINES
26 #define CPP_PREDEFINES "-DWIN32 -D_WIN32 -DWINNT -D__STDC__=0 -DALMOST_STDC\
27 -D_M_ALPHA -D_ALPHA_ -D__alpha -D__alpha__\
28 -D_LONGLONG -D__unaligned= -D__stdcall= \
29 -Asystem(winnt) -Acpu(alpha) -Amachine(alpha)"
31 #undef ASM_SPEC
32 #undef ASM_FINAL_SPEC
33 #define ASM_SPEC "-nopp -nologo %{g:-Zi}"
35 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
36 #undef POINTER_SIZE
37 #define POINTER_SIZE 32
38 #define POINTERS_EXTEND_UNSIGNED 0
40 /* "long" is 32 bits. */
41 #undef LONG_TYPE_SIZE
42 #define LONG_TYPE_SIZE 32
44 #undef WCHAR_TYPE
45 #define WCHAR_TYPE "short unsigned int"
46 #undef WCHAR_TYPE_SIZE
47 #define WCHAR_TYPE_SIZE 16
49 /* We can't do any debugging. */
50 #undef SDB_DEBUGGING_INFO
51 #undef DBX_DEBUGGING_INFO
52 #undef MIPS_DEBUGGING_INFO
54 #include "winnt/win-nt.h"
56 #undef ASM_FILE_START
57 #define ASM_FILE_START(FILE) \
58 { \
59 alpha_write_verstamp (FILE); \
60 fprintf (FILE, "\t.set noreorder\n"); \
61 fprintf (FILE, "\t.set volatile\n"); \
62 fprintf (FILE, "\t.set noat\n"); \
63 fprintf (FILE, "\t.globl\t__fltused\n"); \
64 ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
67 #undef LIB_SPEC
68 #define LIB_SPEC "%{mwindows:-subsystem windows -e _WinMainCRTStartup \
69 USER32.LIB%s GDI32.LIB%s COMDLG32.LIB%s WINSPOOL.LIB%s} \
70 %{!mwindows:-subsystem console -e _mainCRTStartup} \
71 %{mcrtmt:LIBCMT.LIB%s KERNEL32.LIB%s} %{!mcrtmt:LIBC.LIB%s KERNEL32.LIB%s} \
72 %{v}"
75 /* Output assembler code for a block containing the constant parts
76 of a trampoline, leaving space for the variable parts.
78 The trampoline should set the static chain pointer to value placed
79 into the trampoline and should branch to the specified routine. */
81 #undef TRAMPOLINE_TEMPLATE
82 #define TRAMPOLINE_TEMPLATE(FILE) \
83 { \
84 fprintf (FILE, "\tbr $27,$LTRAMPP\n"); \
85 fprintf (FILE, "$LTRAMPP:\n\tldl $1,12($27)\n"); \
86 fprintf (FILE, "\tldl $27,16($27)\n"); \
87 fprintf (FILE, "\tjmp $31,($27),0\n"); \
88 fprintf (FILE, "\t.long 0,0\n"); \
91 /* Length in units of the trampoline for entering a nested function. */
93 #undef TRAMPOLINE_SIZE
94 #define TRAMPOLINE_SIZE 24
96 /* Emit RTL insns to initialize the variable parts of a trampoline.
97 FNADDR is an RTX for the address of the function's pure code.
98 CXT is an RTX for the static chain value for the function.
100 This differs from the standard version in that:
102 We are not passed the current address in any register, and so have to
103 load it ourselves.
105 We do not initialize the "hint" field because it only has an 8k
106 range and so the target is in range of something on the stack.
107 Omitting the hint saves a bogus branch-prediction cache line load.
109 Always have an executable stack -- no need for a system call.
112 #undef INITIALIZE_TRAMPOLINE
113 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
115 rtx _addr, _val; \
117 _addr = memory_address (Pmode, plus_constant ((TRAMP), 16)); \
118 _val = force_reg(Pmode, (FNADDR)); \
119 emit_move_insn (gen_rtx (MEM, SImode, _addr), \
120 gen_rtx (SUBREG, SImode, _val, 0)); \
121 _addr = memory_address (Pmode, plus_constant ((TRAMP), 20)); \
122 _val = force_reg(Pmode, (CXT)); \
123 emit_move_insn (gen_rtx (MEM, SImode, _addr), \
124 gen_rtx (SUBREG, SImode, _val, 0)); \
126 emit_insn (gen_rtx (UNSPEC_VOLATILE, VOIDmode, \
127 gen_rtvec (1, const0_rtx), 0)); \