1 /* Definitions of target machine for GNU compiler, for DEC Alpha
3 Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
6 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
8 Donn Terry, Softway Systems, Inc.
10 This file contains the code-generation stuff common to the 32-bit
11 versions of the DEC/Compaq Alpha architecture. It is shared by
12 Interix and NT/Win32 ports. It should not contain compile-time
13 or run-time dependent environment values (such as compiler options
14 or anything containing a file or pathname.)
16 This file is part of GNU CC.
18 GNU CC is free software; you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation; either version 2, or (at your option)
23 GNU CC is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
28 You should have received a copy of the GNU General Public License
29 along with GNU CC; see the file COPYING. If not, write to
30 the Free Software Foundation, 59 Temple Place - Suite 330,
31 Boston, MA 02111-1307, USA. */
33 #undef TARGET_WINDOWS_NT
34 #define TARGET_WINDOWS_NT 1
36 /* WinNT (and thus Interix) use unsigned int */
37 #define SIZE_TYPE "unsigned int"
39 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
41 #define POINTER_SIZE 32
42 #define POINTERS_EXTEND_UNSIGNED 0
44 /* We don't change Pmode to the "obvious" SI mode... the above appears
45 to affect the in-memory size; we want the registers to stay DImode
46 to match the md file */
48 /* "long" is 32 bits. */
50 #define LONG_TYPE_SIZE 32
53 /* Output assembler code for a block containing the constant parts
54 of a trampoline, leaving space for the variable parts.
56 The trampoline should set the static chain pointer to value placed
57 into the trampoline and should branch to the specified routine. */
59 #undef TRAMPOLINE_TEMPLATE
60 #define TRAMPOLINE_TEMPLATE(FILE) \
62 fprintf (FILE, "\tbr $27,$LTRAMPP\n"); \
63 fprintf (FILE, "$LTRAMPP:\n\tldl $1,12($27)\n"); \
64 fprintf (FILE, "\tldl $27,16($27)\n"); \
65 fprintf (FILE, "\tjmp $31,($27),0\n"); \
66 fprintf (FILE, "\t.long 0,0\n"); \
69 /* Length in units of the trampoline for entering a nested function. */
71 #undef TRAMPOLINE_SIZE
72 #define TRAMPOLINE_SIZE 24
74 /* Emit RTL insns to initialize the variable parts of a trampoline.
75 FNADDR is an RTX for the address of the function's pure code.
76 CXT is an RTX for the static chain value for the function. */
78 #undef INITIALIZE_TRAMPOLINE
79 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
80 alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 20, 16, 12)
82 /* Output code to add DELTA to the first argument, and then jump to FUNCTION.
83 Used for C++ multiple inheritance. */
85 #undef ASM_OUTPUT_MI_THUNK
86 #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
88 char *op, *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
91 /* Mark end of prologue. */ \
92 output_end_prologue (FILE); \
94 /* Rely on the assembler to macro expand a large delta. */ \
95 reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
96 fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
99 if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
101 fprintf (FILE, "\t%s $31,", op); \
102 assemble_name (FILE, fn_name); \
103 fputc ('\n', FILE); \