summaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/rs6000.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 15:23:42 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 15:23:42 +0000
commit527d5be80ac0adb6cf6f825297c1cb1e598ae5e2 (patch)
treede85908a357b1e8e25a4356a59ac8686963b75dc /gcc/config/rs6000/rs6000.c
parent6e421549b152ea400e48cccdda0cb520ebdf2366 (diff)
downloadgcc-527d5be80ac0adb6cf6f825297c1cb1e598ae5e2.tar.gz
* config/i386/linux.h (NO_PROFILE_COUNTERS): Define to 1.
* config/i386/freebsd.h (NO_PROFILE_COUNTERS): Likewise. * config/i386/netbsd-elf.h (NO_PROFILE_COUNTERS): Likewise. * config/xtensa/xtensa.h (NO_PROFILE_COUTNERS): Likewise. * config/darwin.h (NO_PROFILE_COUNTERS): Likewise. * final.c (NO_PROFILE_COUNTERS): Define to 0 if not defined. (profile_function): Allow NO_PROFILE_COUNTERS to be non-constant. * config/rs6000/rs6000.c (output_profile_hook): Likewise. * configure.in (powerpc*-*, s390*-*): Set tls_as_opt. Pass it to $gcc_cv_as. * configure: Rebuilt. * config/rs6000/rs6000.c (rs6000_abi_name): Remove initializer. (print_operand): Allow TARGET_AIX to be non-constant. (rs6000_aix_emit_builtin_unwind_init, rs6000_emit_eh_toc_restore): Define unconditionally. (rs6000_elf_declare_function_name): New function. * config/rs6000/rs6000.md (eh_return): Allow TARGET_AIX to be non-constant. * config/rs6000/linux64.h [!RS6000_BI_ARCH] (TARGET_64BIT): Define to 1. (DEFAULT_ARCH64_P, RS6000_BI_ARCH_P): Define. [IN_LIBGCC2] (TARGET_64BIT): Define based on whether __powerpc64__ is defined. (TARGET_AIX): Define to 1 if TARGET_64BIT. (PROCESSOR_DEFAULT): Remove. (TARGET_RELOCATABLE, RS6000_ABI_NAME, INVALID_64BIT, INVALID_32BIT, SUBSUBTARGET_OVERRIDE_OPTIONS): Define. [RS6000_BI_ARCH] (OVERRIDE_OPTIONS, ASM_FILE_START): Define. (ASM_DEFAULT_SPEC, ASM_SPEC, LINK_OS_LINUX_SPEC): Define for both -m32 and -m64. (MULTILIB_DEFAULTS): Define. (SUBSUBTARGET_EXTRA_SPECS): Define. (ASM_SPEC32, ASM_SPEC64, ASM_SPEC_COMMON): Define. (TARGET_TOC): Define only if !RS6000_BI_ARCH. (TARGET_NO_TOC): Remove. [!RS6000_BI_ARCH] (TARGET_RELOCATABLE, TARGET_EABI, TARGET_PROTOTYPE): Define to 0. (NO_PROFILE_COUNTERS): Define to TARGET_64BIT. (PROFILE_HOOK): Only call output_profile_hook if TARGET_64BIT. (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Adjust to work properly if !TARGET_64BIT. (USER_LABEL_PREFIX): Remove. (JUMP_TABLES_IN_TEXT_SECTION): Define to TARGET_64BIT. (SETUP_FRAME_ADDRESSES): Only call rs6000_aix_emit_builtin_unwind_init if TARGET_64BIT. (TARGET_OS_CPP_BUILTINS): Handle both -m32 and -m64. (LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Define. (STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Remove. (TOC_SECTION_ASM_OP): Define depending on TARGET_64BIT. (MINIMAL_TOC_SECTION_ASM_OP): Likewise. (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Define depending on TARGET_64BIT. (RS6000_CALL_GLUE): Likewise. (SAVE_FP_PREFIX, SAVE_FP_SUFFIX, RESTORE_FP_PREFIX, RESTORE_FP_SUFFIX): Likewise. (ASM_DECLARE_FUNCTION_NAME): Remove. (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Only output dot before function name if TARGET_64BIT. (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Handle both TARGET_64BIT and !TARGET_64BIT. (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Remove undefs. (ASM_PREFERRED_EH_DATA_FORMAT): Take TARGET_64BIT into account. (DRAFT_V4_STRUCT_RET): Define. (SIGNAL_FRAMESIZE): New enum value. (MD_FALLBACK_FRAME_STATE_FOR): Define. * config/rs6000/default64.h: New file. * config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -m32 and -m64 options. (SUBTARGET_OVERRIDE_OPTIONS): If rs6000_abi_name is NULL, set it to RS6000_ABI_NAME. Only disallow mixing of -fPIC with -mcall-aixdesc if !TARGET_64BIT. [!RS6000_BI_ARCH] (SUBSUBTARGET_OVERRIDE_OPTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use rs6000_elf_declare_function_name function. (TARGET_OS_SYSV_CPP_BUILTINS): Define. (TARGET_OS_CPP_BUILTINS): Use it. (CPP_SYSV_SPEC): Remove. (CPP_SPEC): Remove cpp_sysv. (SUBTARGET_EXTRA_SPECS): Remove cpp_sysv. Add SUBSUBTARGET_EXTRA_SPECS. (SUBSUBTARGET_EXTRA_SPECS): Define. * config/rs6000/biarch64.h: New file. * config/rs6000/rs6000-protos.h (rs6000_elf_declare_function_name): New prototype. * config/rs6000/x-linux64: New file. * config/rs6000/t-linux64: Build -m64, -m32 and -m32 -msoft-float multilibs. * config/rs6000/eabi-ci.asm: Protect with #ifndef __powerpc64__. * config/rs6000/eabi-cn.asm: Likewise. * config/rs6000/tramp.asm: Likewise. * config/rs6000/sol-ci.asm: Likewise. * config/rs6000/sol-cn.asm: Likewise. * config/rs6000/linux.h (TARGET_64BIT): Define to 0. (TARGET_OS_CPP_BUILTINS): Use TARGET_OS_SYSV_CPP_BUILTINS. * config/rs6000/ppc-asm.h: Move __powerpc64__ section before _CALL_AIXDESC section. * config.gcc (powerpc64-*-linux*): Configure a bi-arch compiler, defaulting to -m64 unless --with-cpu= is one of the 32-bit CPUs or default32. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67442 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000/rs6000.c')
-rw-r--r--gcc/config/rs6000/rs6000.c114
1 files changed, 94 insertions, 20 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 2b9a76124e3..d37014f0a5d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -124,7 +124,7 @@ int rs6000_pic_labelno;
#ifdef USING_ELFOS_H
/* Which abi to adhere to */
-const char *rs6000_abi_name = RS6000_ABI_NAME;
+const char *rs6000_abi_name;
/* Semantics of the small data area */
enum rs6000_sdata_type rs6000_sdata = SDATA_DATA;
@@ -8661,11 +8661,10 @@ print_operand (file, x, code)
break;
}
}
-#if TARGET_AIX
- RS6000_OUTPUT_BASENAME (file, XSTR (x, 0));
-#else
- assemble_name (file, XSTR (x, 0));
-#endif
+ if (TARGET_AIX)
+ RS6000_OUTPUT_BASENAME (file, XSTR (x, 0));
+ else
+ assemble_name (file, XSTR (x, 0));
return;
case 'Z':
@@ -10566,7 +10565,6 @@ create_TOC_reference (symbol)
gen_rtx_SYMBOL_REF (Pmode, toc_label_name))));
}
-#if TARGET_AIX
/* __throw will restore its own return address to be the same as the
return address of the function that the throw is being made to.
This is unfortunate, because we want to check the original
@@ -10694,7 +10692,6 @@ rs6000_emit_eh_toc_restore (stacksize)
emit_note (NULL, NOTE_INSN_LOOP_END);
emit_label (loop_exit);
}
-#endif /* TARGET_AIX */
/* This ties together stack memory (MEM with an alias set of
rs6000_sr_alias_set) and the change to the stack pointer. */
@@ -12885,20 +12882,24 @@ output_profile_hook (labelno)
if (DEFAULT_ABI == ABI_AIX)
{
-#ifdef NO_PROFILE_COUNTERS
- emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0);
-#else
- char buf[30];
- const char *label_name;
- rtx fun;
+#ifndef NO_PROFILE_COUNTERS
+# define NO_PROFILE_COUNTERS 0
+#endif
+ if (NO_PROFILE_COUNTERS)
+ emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0);
+ else
+ {
+ char buf[30];
+ const char *label_name;
+ rtx fun;
- ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
- label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf));
- fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
+ label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf));
+ fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
- emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
- fun, Pmode);
-#endif
+ emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
+ fun, Pmode);
+ }
}
else if (DEFAULT_ABI == ABI_DARWIN)
{
@@ -13934,6 +13935,79 @@ rs6000_elf_asm_out_destructor (symbol, priority)
else
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
}
+
+void
+rs6000_elf_declare_function_name (file, name, decl)
+ FILE *file;
+ const char *name;
+ tree decl;
+{
+ if (TARGET_64BIT)
+ {
+ fputs ("\t.section\t\".opd\",\"aw\"\n\t.align 3\n", file);
+ ASM_OUTPUT_LABEL (file, name);
+ fputs (DOUBLE_INT_ASM_OP, file);
+ putc ('.', file);
+ assemble_name (file, name);
+ fputs (",.TOC.@tocbase,0\n\t.previous\n\t.size\t", file);
+ assemble_name (file, name);
+ fputs (",24\n\t.type\t.", file);
+ assemble_name (file, name);
+ fputs (",@function\n", file);
+ if (TREE_PUBLIC (decl) && ! DECL_WEAK (decl))
+ {
+ fputs ("\t.globl\t.", file);
+ assemble_name (file, name);
+ putc ('\n', file);
+ }
+ ASM_DECLARE_RESULT (file, DECL_RESULT (decl));
+ putc ('.', file);
+ ASM_OUTPUT_LABEL (file, name);
+ return;
+ }
+
+ if (TARGET_RELOCATABLE
+ && (get_pool_size () != 0 || current_function_profile)
+ && uses_TOC())
+ {
+ char buf[256];
+
+ (*targetm.asm_out.internal_label) (file, "LCL", rs6000_pic_labelno);
+
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1);
+ fprintf (file, "\t.long ");
+ assemble_name (file, buf);
+ putc ('-', file);
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);
+ assemble_name (file, buf);
+ putc ('\n', file);
+ }
+
+ ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function");
+ ASM_DECLARE_RESULT (file, DECL_RESULT (decl));
+
+ if (DEFAULT_ABI == ABI_AIX)
+ {
+ const char *desc_name, *orig_name;
+
+ orig_name = (*targetm.strip_name_encoding) (name);
+ desc_name = orig_name;
+ while (*desc_name == '.')
+ desc_name++;
+
+ if (TREE_PUBLIC (decl))
+ fprintf (file, "\t.globl %s\n", desc_name);
+
+ fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
+ fprintf (file, "%s:\n", desc_name);
+ fprintf (file, "\t.long %s\n", orig_name);
+ fputs ("\t.long _GLOBAL_OFFSET_TABLE_\n", file);
+ if (DEFAULT_ABI == ABI_AIX)
+ fputs ("\t.long 0\n", file);
+ fprintf (file, "\t.previous\n");
+ }
+ ASM_OUTPUT_LABEL (file, name);
+}
#endif
#if TARGET_XCOFF