]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/rs6000/linux.h
Cast to unsigned short/char first for _mm_extract_epi16/_mm_extract_epi8.
[thirdparty/gcc.git] / gcc / config / rs6000 / linux.h
CommitLineData
9a57586f 1/* Definitions of target machine for GNU compiler,
88cad84b 2 for PowerPC machines running Linux.
602ea4d3 3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2f83c7d6 4 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
9a57586f
MM
5 Contributed by Michael Meissner (meissner@cygnus.com).
6
5de601cf 7 This file is part of GCC.
9a57586f 8
5de601cf
NC
9 GCC is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published
2f83c7d6 11 by the Free Software Foundation; either version 3, or (at your
5de601cf 12 option) any later version.
9a57586f 13
5de601cf
NC
14 GCC is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
9a57586f 18
5de601cf 19 You should have received a copy of the GNU General Public License
2f83c7d6
NC
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
9a57586f 22
bd227acc
FS
23#undef MD_EXEC_PREFIX
24#undef MD_STARTFILE_PREFIX
25
bf276e5c
AM
26/* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
27 process. */
28#define OS_MISSING_POWERPC64 1
29
71625f3d
AM
30/* We use glibc _mcount for profiling. */
31#define NO_PROFILE_COUNTERS 1
32
47089d42
MK
33#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
34
bf276e5c
AM
35/* glibc has float and long double forms of math functions. */
36#undef TARGET_C99_FUNCTIONS
7bd85ce0 37#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
bf276e5c 38
006339cd
RG
39/* Whether we have sincos that follows the GNU extension. */
40#undef TARGET_HAS_SINCOS
41#define TARGET_HAS_SINCOS (OPTION_GLIBC)
42
5de601cf 43#undef TARGET_OS_CPP_BUILTINS
c4ad648e
AM
44#define TARGET_OS_CPP_BUILTINS() \
45 do \
46 { \
47 builtin_define_std ("PPC"); \
48 builtin_define_std ("powerpc"); \
49 builtin_assert ("cpu=powerpc"); \
50 builtin_assert ("machine=powerpc"); \
51 TARGET_OS_SYSV_CPP_BUILTINS (); \
52 } \
7990b46f 53 while (0)
9a57586f 54
373107aa
FS
55#undef CPP_OS_DEFAULT_SPEC
56#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
57
437558e8
FS
58/* The GNU C++ standard library currently requires _GNU_SOURCE being
59 defined on glibc-based systems. This temporary hack accomplishes this,
60 it should go away as soon as libstdc++-v3 has a real fix. */
5de601cf 61#undef CPLUSPLUS_CPP_SPEC
437558e8
FS
62#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
63
5de601cf 64#undef LINK_SHLIB_SPEC
362c63a5 65#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
9a57586f
MM
66
67#undef LIB_DEFAULT_SPEC
0bc25b2b 68#define LIB_DEFAULT_SPEC "%(lib_linux)"
9a57586f
MM
69
70#undef STARTFILE_DEFAULT_SPEC
0bc25b2b 71#define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
9a57586f
MM
72
73#undef ENDFILE_DEFAULT_SPEC
0bc25b2b 74#define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
9a57586f 75
362c63a5
GK
76#undef LINK_START_DEFAULT_SPEC
77#define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
78
79#undef LINK_OS_DEFAULT_SPEC
80#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
81
42df2193
JJ
82#define LINK_GCC_C_SEQUENCE_SPEC \
83 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
84
8efcd34f
AM
85/* Use --as-needed -lgcc_s for eh support. */
86#ifdef HAVE_LD_AS_NEEDED
87#define USE_LD_AS_NEEDED 1
88#endif
89
5de601cf 90#undef TARGET_VERSION
956d6950 91#define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
3807773b 92
832ea3b3 93/* Override rs6000.h definition. */
5de601cf 94#undef ASM_APP_ON
832ea3b3
FS
95#define ASM_APP_ON "#APP\n"
96
97/* Override rs6000.h definition. */
5de601cf 98#undef ASM_APP_OFF
832ea3b3
FS
99#define ASM_APP_OFF "#NO_APP\n"
100
6fa3f289
ZW
101/* For backward compatibility, we must continue to use the AIX
102 structure return convention. */
5de601cf 103#undef DRAFT_V4_STRUCT_RET
6fa3f289
ZW
104#define DRAFT_V4_STRUCT_RET 1
105
9739c90c
JJ
106/* We are 32-bit all the time, so optimize a little. */
107#undef TARGET_64BIT
108#define TARGET_64BIT 0
109
84dcde01
AM
110/* We don't need to generate entries in .fixup, except when
111 -mrelocatable or -mrelocatable-lib is given. */
9739c90c 112#undef RELOCATABLE_NEEDS_FIXUP
84dcde01
AM
113#define RELOCATABLE_NEEDS_FIXUP \
114 (target_flags & target_flags_explicit & MASK_RELOCATABLE)
9739c90c 115
a5fe455b 116#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
3edc56a9 117
4969c0d8 118#define TARGET_POSIX_IO
c2cd64b5 119
8662eb14 120#define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
77008252
JJ
121
122#ifdef TARGET_LIBC_PROVIDES_SSP
123/* ppc32 glibc provides __stack_chk_guard in -0x7008(2). */
124#define TARGET_THREAD_SSP_OFFSET -0x7008
125#endif
602ea4d3
JJ
126
127#define POWERPC_LINUX
ed965309
JJ
128
129/* ppc linux has 128-bit long double support in glibc 2.4 and later. */
130#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
131#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
132#endif