1/* Definitions for LynxOS on i386.
2   Copyright (C) 1993-2015 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3.  If not see
18<http://www.gnu.org/licenses/>.  */
19
20#define TARGET_OS_CPP_BUILTINS()		\
21  do						\
22    {						\
23      builtin_define ("__LITTLE_ENDIAN__");	\
24      builtin_define ("__x86__");		\
25    }						\
26  while (0)
27
28/* The svr4 ABI for the i386 says that records and unions are returned
29   in memory.  */
30
31#define DEFAULT_PCC_STRUCT_RETURN 1
32
33/* BSS_SECTION_ASM_OP gets defined i386/unix.h.  */
34
35#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
36  asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
37
38/* LynxOS's GDB counts the floating point registers from 16.  */
39
40#undef DBX_REGISTER_NUMBER
41#define DBX_REGISTER_NUMBER(n)						\
42  (TARGET_64BIT ? dbx64_register_map[n]					\
43   : (n) == 0 ? 0							\
44   : (n) == 1 ? 2							\
45   : (n) == 2 ? 1							\
46   : (n) == 3 ? 3							\
47   : (n) == 4 ? 6							\
48   : (n) == 5 ? 7							\
49   : (n) == 6 ? 5							\
50   : (n) == 7 ? 4							\
51   : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (int) (n) + 8	\
52   : (-1))
53
54/* A C statement to output to the stdio stream FILE an assembler
55   command to advance the location counter to a multiple of 1<<LOG
56   bytes if it is within MAX_SKIP bytes.
57
58   This is used to align code labels according to Intel recommendations.  */
59
60#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
61#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)			\
62  do {									\
63    if ((LOG) != 0) {							\
64      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));	\
65      else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));	\
66    }									\
67  } while (0)
68#endif
69
70/* Undefine SUBTARGET_EXTRA_SPECS it is empty anyway.  We define it in
71   config/lynx.h.  */
72
73#undef SUBTARGET_EXTRA_SPECS
74
75/* Undefine the definition from att.h to enable our default.  */
76
77#undef ASM_OUTPUT_ALIGN
78
79/* Undefine the definition from elfos.h to enable our default.  */
80
81#undef PREFERRED_DEBUGGING_TYPE
82
83/* The file i386.c defines TARGET_HAVE_TLS unconditionally if
84   HAVE_AS_TLS is defined.  HAVE_AS_TLS is defined as gas support for
85   TLS is detected by configure.  We undefine it here.  */
86
87#undef HAVE_AS_TLS
88
89#define IX86_MAYBE_NO_LIBGCC_TFMODE
90