1132718Skan/* Definitions of target machine for GCC, for SPARC running Solaris 2 2169689Skan Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 3169689Skan 2006 Free Software Foundation, Inc. 450397Sobrien Contributed by Ron Guilmette (rfg@netcom.com). 550397Sobrien Additional changes by David V. Henkel-Wallace (gumby@cygnus.com). 650397Sobrien 7132718SkanThis file is part of GCC. 850397Sobrien 9132718SkanGCC is free software; you can redistribute it and/or modify 1050397Sobrienit under the terms of the GNU General Public License as published by 1150397Sobrienthe Free Software Foundation; either version 2, or (at your option) 1250397Sobrienany later version. 1350397Sobrien 14132718SkanGCC is distributed in the hope that it will be useful, 1550397Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of 1650397SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1750397SobrienGNU General Public License for more details. 1850397Sobrien 1950397SobrienYou should have received a copy of the GNU General Public License 20132718Skanalong with GCC; see the file COPYING. If not, write to 21169689Skanthe Free Software Foundation, 51 Franklin Street, Fifth Floor, 22169689SkanBoston, MA 02110-1301, USA. */ 2350397Sobrien 2450397Sobrien/* Supposedly the same as vanilla sparc svr4, except for the stuff below: */ 2550397Sobrien 2650397Sobrien/* This is here rather than in sparc.h because it's not known what 2750397Sobrien other assemblers will accept. */ 28102780Skan 2950397Sobrien#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 3050397Sobrien#undef ASM_CPU_DEFAULT_SPEC 3150397Sobrien#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plus" 3250397Sobrien#endif 33102780Skan 3450397Sobrien#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc 3550397Sobrien#undef ASM_CPU_DEFAULT_SPEC 3650397Sobrien#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa" 3750397Sobrien#endif 38102780Skan 39132718Skan#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 40132718Skan#undef ASM_CPU_DEFAULT_SPEC 41132718Skan#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb" 42132718Skan#endif 43132718Skan 44169689Skan#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara 45169689Skan#undef ASM_CPU_DEFAULT_SPEC 46169689Skan#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb" 47169689Skan#endif 48169689Skan 4950397Sobrien#undef ASM_CPU_SPEC 5050397Sobrien#define ASM_CPU_SPEC "\ 51102780Skan%{mcpu=v9:-xarch=v8plus} \ 5250397Sobrien%{mcpu=ultrasparc:-xarch=v8plusa} \ 53132718Skan%{mcpu=ultrasparc3:-xarch=v8plusb} \ 54169689Skan%{mcpu=niagara:-xarch=v8plusb} \ 5550397Sobrien%{!mcpu*:%(asm_cpu_default)} \ 5650397Sobrien" 5750397Sobrien 58117395Skan#undef SUBTARGET_EXTRA_SPECS 59117395Skan#define SUBTARGET_EXTRA_SPECS \ 60117395Skan { "startfile_arch", STARTFILE_ARCH_SPEC }, \ 61117395Skan { "link_arch", LINK_ARCH_SPEC } 62117395Skan 6350397Sobrien/* However it appears that Solaris 2.0 uses the same reg numbering as 6490075Sobrien the old BSD-style system did. */ 6550397Sobrien 6690075Sobrien/* The Solaris 2 assembler uses .skip, not .zero, so put this back. */ 6750397Sobrien#undef ASM_OUTPUT_SKIP 6850397Sobrien#define ASM_OUTPUT_SKIP(FILE,SIZE) \ 69132718Skan fprintf (FILE, "\t.skip %u\n", (int)(SIZE)) 7050397Sobrien 7196263Sobrien#undef LOCAL_LABEL_PREFIX 7296263Sobrien#define LOCAL_LABEL_PREFIX "." 7396263Sobrien 7450397Sobrien/* This is how to store into the string LABEL 7550397Sobrien the symbol_ref name of an internal numbered label where 7650397Sobrien PREFIX is the class of label and NUM is the number within the class. 7750397Sobrien This is suitable for output with `assemble_name'. */ 7850397Sobrien 7950397Sobrien#undef ASM_GENERATE_INTERNAL_LABEL 8050397Sobrien#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ 81161651Skan sprintf ((LABEL), "*.L%s%lu", (PREFIX), (unsigned long)(NUM)) 8250397Sobrien 83132718Skan/* The native TLS-enabled assembler requires the directive #tls_object 84132718Skan to be put on objects in TLS sections (as of v7.1). This is not 85132718Skan required by the GNU assembler but supported on SPARC. */ 86132718Skan#undef ASM_DECLARE_OBJECT_NAME 87132718Skan#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ 88132718Skan do \ 89132718Skan { \ 90132718Skan HOST_WIDE_INT size; \ 91132718Skan \ 92169689Skan if (DECL_THREAD_LOCAL_P (DECL)) \ 93132718Skan ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "tls_object"); \ 94132718Skan else \ 95132718Skan ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ 96132718Skan \ 97132718Skan size_directive_output = 0; \ 98132718Skan if (!flag_inhibit_size_directive \ 99132718Skan && (DECL) && DECL_SIZE (DECL)) \ 100132718Skan { \ 101132718Skan size_directive_output = 1; \ 102132718Skan size = int_size_in_bytes (TREE_TYPE (DECL)); \ 103132718Skan ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \ 104132718Skan } \ 105132718Skan \ 106132718Skan ASM_OUTPUT_LABEL (FILE, NAME); \ 107132718Skan } \ 108132718Skan while (0) 109132718Skan 110169689Skan/* The Solaris assembler cannot grok .stabd directives. */ 111169689Skan#undef NO_DBX_BNSYM_ENSYM 112169689Skan#define NO_DBX_BNSYM_ENSYM 1 11350397Sobrien 11450397Sobrien 11550397Sobrien#undef ENDFILE_SPEC 11696263Sobrien#define ENDFILE_SPEC \ 11796263Sobrien "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ 11896263Sobrien crtend.o%s crtn.o%s" 11950397Sobrien 12090075Sobrien/* Select a format to encode pointers in exception handling data. CODE 12190075Sobrien is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is 12290075Sobrien true if the symbol may be affected by dynamic relocations. 12390075Sobrien 12490075Sobrien Some Solaris dynamic linkers don't handle unaligned section relative 12590075Sobrien relocs properly, so force them to be aligned. */ 12690075Sobrien#ifndef HAVE_AS_SPARC_UA_PCREL 12790075Sobrien#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ 12890075Sobrien ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr) 12990075Sobrien#endif 130132718Skan 13150397Sobrien 132117395Skan/* Define for support of TFmode long double. 133117395Skan SPARC ABI says that long double is 4 words. */ 13450397Sobrien#define LONG_DOUBLE_TYPE_SIZE 128 13550397Sobrien 13650397Sobrien/* But indicate that it isn't supported by the hardware. */ 13750397Sobrien#define WIDEST_HARDWARE_FP_SIZE 64 13850397Sobrien 139102780Skan/* Solaris's _Qp_* library routine implementation clobbers the output 140102780Skan memory before the inputs are fully consumed. */ 141102780Skan 142102780Skan#undef TARGET_BUGGY_QP_LIB 143102780Skan#define TARGET_BUGGY_QP_LIB 1 144102780Skan 145132718Skan#undef SUN_CONVERSION_LIBFUNCS 146132718Skan#define SUN_CONVERSION_LIBFUNCS 1 14750397Sobrien 148132718Skan#undef DITF_CONVERSION_LIBFUNCS 149132718Skan#define DITF_CONVERSION_LIBFUNCS 1 150132718Skan 151132718Skan#undef SUN_INTEGER_MULTIPLY_64 152132718Skan#define SUN_INTEGER_MULTIPLY_64 1 153132718Skan 15450397Sobrien/* Solaris allows 64 bit out and global registers in 32 bit mode. 15550397Sobrien sparc_override_options will disable V8+ if not generating V9 code. */ 15650397Sobrien#undef TARGET_DEFAULT 157169689Skan#define TARGET_DEFAULT (MASK_V8PLUS + MASK_APP_REGS + MASK_FPU \ 158169689Skan + MASK_LONG_DOUBLE_128) 159169689Skan 160169689Skan/* Solaris-specific #pragmas are implemented on top of attributes. Hook in 161169689Skan the bits from config/sol2.c. */ 162169689Skan#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes 163169689Skan#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE 164169689Skan 165169689Skan/* Output a simple call for .init/.fini. */ 166169689Skan#define ASM_OUTPUT_CALL(FILE, FN) \ 167169689Skan do \ 168169689Skan { \ 169169689Skan fprintf (FILE, "\tcall\t"); \ 170169689Skan print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \ 171169689Skan fprintf (FILE, "\n\tnop\n"); \ 172169689Skan } \ 173169689Skan while (0) 174