* varasm.c (assemble_real): Use REAL_VALUE_TO_x and assemble_integer
[official-gcc.git] / gcc / config / clipper / clix.h
blobcae454b8b01f17fe51875123b0fd8049bd692c86
1 /* Definitions of target machine for GNU compiler. Clipper/Clix version.
2 Copyright (C) 1988, 1993, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Names to predefine in the preprocessor for this target machine. */
23 #define CPP_PREDEFINES "-Dclipper -Dunix -Asystem=unix -Asystem=svr3 -Acpu=clipper -Amachine=clipper"
25 #undef STARTFILE_SPEC
26 #define STARTFILE_SPEC \
27 "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s"
29 #undef ENDFILE_SPEC
30 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
32 #undef LIB_SPEC
34 #define TARGET_MEM_FUNCTIONS
36 #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
37 do { \
38 const unsigned char *s = (const unsigned char *)(PTR);\
39 size_t i, limit = (LEN); \
40 for (i = 0; i < limit; s++, i++) \
41 { \
42 if ((i % 8) == 0) \
43 fputs ("\n\t.byte\t", (FILE)); \
44 fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
45 } \
46 fputs ("\n", (FILE)); \
47 } while (0)
49 /* This is how to output an assembler line
50 that says to advance the location counter
51 to a multiple of 2**LOG bytes. */
53 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
54 fprintf(FILE, "\t.align %d\n", 1 << (LOG))
57 #define BSS_SECTION_ASM_OP "\t.bss"
58 #undef INIT_SECTION_ASM_OP
59 #define INIT_SECTION_ASM_OP "\t.section .init,\"x\""
62 /* Define a few machine-specific details of the implementation of
63 constructors.
65 The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN
66 and CTOR_LIST_END to contribute to the .init section an instruction to
67 push a word containing 0 (or some equivalent of that).
69 TARGET_ASM_CONSTRUCTOR should be defined to push the address of the
70 constructor. */
72 #define CTOR_LIST_BEGIN \
73 asm (INIT_SECTION_ASM_OP); \
74 asm ("subq $8,sp"); \
75 asm ("loadq $0,r0"); \
76 asm ("storw r0,(sp)")
78 /* don't need end marker */
80 #undef CTOR_LIST_END
82 /* fini psect is 8 aligned */
84 #define DTOR_LIST_BEGIN \
85 asm (DTORS_SECTION_ASM_OP); \
86 func_ptr __DTOR_LIST__[2] = { (func_ptr) (-1), 0 };
88 #undef TARGET_ASM_CONSTRUCTOR
89 #define TARGET_ASM_CONSTRUCTOR clix_asm_out_constructor
90 #undef TARGET_ASM_DESTRUCTOR
91 #define TARGET_ASM_DESTRUCTOR clix_asm_out_destructor
93 /* On clix crt1.o first calls init code and then sets environ and a valid
94 chrclass. Unfortunately stdio routines bomb with unset chrclass.
95 Therefore we set chrclass prior to calling global constructors. */
97 #undef DO_GLOBAL_CTORS_BODY
98 #define DO_GLOBAL_CTORS_BODY \
99 do { \
100 func_ptr *p, *beg = alloca (0); \
101 _setchrclass (0); \
102 for (p = beg; *p; p+=2) \
104 while (p != beg) \
105 { p-= 2; (*p) (); } \
106 } while (0)
109 #undef DO_GLOBAL_DTORS_BODY
110 #define DO_GLOBAL_DTORS_BODY \
111 func_ptr *f = &__DTOR_LIST__[2]; /* 0,1 contains -1,0 */ \
112 int n = 0; \
113 while (*f) \
115 f+= 2; /* skip over alignment 0 */ \
116 n++; \
118 f -= 2; \
119 while (--n >= 0) \
121 (*f) (); \
122 f-= 2; /* skip over alignment 0 */ \