Ulrich Weigand
b54214fe22
rs6000.h (RS6000_SAVE_AREA): Handle ABI_ELFv2.
...
gcc/ChangeLog:
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.h (RS6000_SAVE_AREA): Handle ABI_ELFv2.
(RS6000_SAVE_TOC): Remove.
(RS6000_TOC_SAVE_SLOT): New macro.
* config/rs6000/rs6000.c (rs6000_parm_offset): New function.
(rs6000_parm_start): Use it.
(rs6000_function_arg_advance_1): Likewise.
(rs6000_emit_prologue): Use RS6000_TOC_SAVE_SLOT.
(rs6000_emit_epilogue): Likewise.
(rs6000_call_aix): Likewise.
(rs6000_output_function_prologue): Do not save/restore r11
around calling _mcount for ABI_ELFv2.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000-protos.h (rs6000_reg_parm_stack_space):
Add prototype.
* config/rs6000/rs6000.h (RS6000_REG_SAVE): Remove.
(REG_PARM_STACK_SPACE): Call rs6000_reg_parm_stack_space.
* config/rs6000/rs6000.c (rs6000_parm_needs_stack): New function.
(rs6000_function_parms_need_stack): Likewise.
(rs6000_reg_parm_stack_space): Likewise.
(rs6000_function_arg): Do not replace BLKmode by Pmode when
returning a register argument.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Michael Gschwind <mkg@us.ibm.com>
* config/rs6000/rs6000.h (FP_ARG_MAX_RETURN): New macro.
(ALTIVEC_ARG_MAX_RETURN): Likewise.
(FUNCTION_VALUE_REGNO_P): Use them.
* config/rs6000/rs6000.c (TARGET_RETURN_IN_MSB): Define.
(rs6000_return_in_msb): New function.
(rs6000_return_in_memory): Handle ELFv2 homogeneous aggregates.
Handle aggregates of up to 16 bytes for ELFv2.
(rs6000_function_value): Handle ELFv2 homogeneous aggregates.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Michael Gschwind <mkg@us.ibm.com>
* config/rs6000/rs6000.h (AGGR_ARG_NUM_REG): Define.
* config/rs6000/rs6000.c (rs6000_aggregate_candidate): New function.
(rs6000_discover_homogeneous_aggregate): Likewise.
(rs6000_function_arg_boundary): Handle homogeneous aggregates.
(rs6000_function_arg_advance_1): Likewise.
(rs6000_function_arg): Likewise.
(rs6000_arg_partial_bytes): Likewise.
(rs6000_psave_function_arg): Handle BLKmode arguments.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Michael Gschwind <mkg@us.ibm.com>
* config/rs6000/rs6000.h (AGGR_ARG_NUM_REG): Define.
* config/rs6000/rs6000.c (rs6000_aggregate_candidate): New function.
(rs6000_discover_homogeneous_aggregate): Likewise.
(rs6000_function_arg_boundary): Handle homogeneous aggregates.
(rs6000_function_arg_advance_1): Likewise.
(rs6000_function_arg): Likewise.
(rs6000_arg_partial_bytes): Likewise.
(rs6000_psave_function_arg): Handle BLKmode arguments.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* config/rs6000/rs6000.c (machine_function): New member
r2_setup_needed.
(rs6000_emit_prologue): Set r2_setup_needed if necessary.
(rs6000_output_mi_thunk): Set r2_setup_needed.
(rs6000_output_function_prologue): Output global entry point
prologue and local entry point marker if needed for ABI_ELFv2.
Output -mprofile-kernel code here.
(output_function_profiler): Do not output -mprofile-kernel
code here; moved to rs6000_output_function_prologue.
(rs6000_file_start): Output ".abiversion 2" for ABI_ELFv2.
(rs6000_emit_move): Do not handle dot symbols for ABI_ELFv2.
(rs6000_output_function_entry): Likewise.
(rs6000_assemble_integer): Likewise.
(rs6000_elf_encode_section_info): Likewise.
(rs6000_elf_declare_function_name): Do not create dot symbols
or .opd section for ABI_ELFv2.
(rs6000_trampoline_size): Update for ABI_ELFv2 trampolines.
(rs6000_trampoline_init): Likewise.
(rs6000_elf_file_end): Call file_end_indicate_exec_stack
for ABI_ELFv2.
(rs6000_call_aix): Handle ELFv2 indirect calls. Do not check
for function descriptors in ABI_ELFv2.
* config/rs6000/rs6000.md ("*call_indirect_aix<mode>"): Support
on ABI_AIX only, not ABI_ELFv2.
("*call_value_indirect_aix<mode>"): Likewise.
("*call_indirect_elfv2<mode>"): New pattern.
("*call_value_indirect_elfv2<mode>"): Likewise.
* config/rs6000/predicates.md ("symbol_ref_operand"): Do not
check for function descriptors in ABI_ELFv2.
("current_file_function_operand"): Likewise.
* config/rs6000/ppc-asm.h [__powerpc64__ && _CALL_ELF == 2]:
(toc): Undefine.
(FUNC_NAME): Define ELFv2 variant.
(JUMP_TARGET): Likewise.
(FUNC_START): Likewise.
(HIDDEN_FUNC): Likewise.
(FUNC_END): Likeiwse.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* config.gcc [powerpc*-*-* | rs6000-*-*]: Support --with-abi=elfv1
and --with-abi=elfv2.
* config/rs6000/option-defaults.h (OPTION_DEFAULT_SPECS): Add "abi".
* config/rs6000/rs6000.opt (mabi=elfv1): New option.
(mabi=elfv2): Likewise.
* config/rs6000/rs6000-opts.h (enum rs6000_abi): Add ABI_ELFv2.
* config/rs6000/linux64.h (DEFAULT_ABI): Do not hard-code to AIX_ABI
if !RS6000_BI_ARCH.
(ELFv2_ABI_CHECK): New macro.
(SUBSUBTARGET_OVERRIDE_OPTIONS): Use it to decide whether to set
rs6000_current_abi to ABI_AIX or ABI_ELFv2.
(GLIBC_DYNAMIC_LINKER64): Support ELFv2 ld.so version.
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Predefine
_CALL_ELF and __STRUCT_PARM_ALIGN__ if appropriate.
* config/rs6000/rs6000.c (rs6000_debug_reg_global): Handle ABI_ELFv2.
(debug_stack_info): Likewise.
(rs6000_file_start): Treat ABI_ELFv2 the same as ABI_AIX.
(rs6000_legitimize_tls_address): Likewise.
(rs6000_conditional_register_usage): Likewise.
(rs6000_emit_move): Likewise.
(init_cumulative_args): Likewise.
(rs6000_function_arg_advance_1): Likewise.
(rs6000_function_arg): Likewise.
(rs6000_arg_partial_bytes): Likewise.
(rs6000_output_function_entry): Likewise.
(rs6000_assemble_integer): Likewise.
(rs6000_savres_strategy): Likewise.
(rs6000_stack_info): Likewise.
(rs6000_function_ok_for_sibcall): Likewise.
(rs6000_emit_load_toc_table): Likewise.
(rs6000_savres_routine_name): Likewise.
(ptr_regno_for_savres): Likewise.
(rs6000_emit_prologue): Likewise.
(rs6000_emit_epilogue): Likewise.
(rs6000_output_function_epilogue): Likewise.
(output_profile_hook): Likewise.
(output_function_profiler): Likewise.
(rs6000_trampoline_size): Likewise.
(rs6000_trampoline_init): Likewise.
(rs6000_elf_output_toc_section_asm_op): Likewise.
(rs6000_elf_encode_section_info): Likewise.
(rs6000_elf_reloc_rw_mask): Likewise.
(rs6000_elf_declare_function_name): Likewise.
(rs6000_function_arg_boundary): Treat ABI_ELFv2 the same as ABI_AIX,
except that rs6000_compat_align_parm is always assumed false.
(rs6000_gimplify_va_arg): Likewise.
(rs6000_call_aix): Update comment.
(rs6000_sibcall_aix): Likewise.
* config/rs6000/rs6000.md ("tls_gd_aix<TLSmode:tls_abi_suffix>"):
Treat ABI_ELFv2 the same as ABI_AIX.
("*tls_gd_call_aix<TLSmode:tls_abi_suffix>"): Likewise.
("tls_ld_aix<TLSmode:tls_abi_suffix>"): Likewise.
("*tls_ld_call_aix<TLSmode:tls_abi_suffix>"): Likewise.
("load_toc_aix_si"): Likewise.
("load_toc_aix_di"): Likewise.
("call"): Likewise.
("call_value"): Likewise.
("*call_local_aix<mode>"): Likewise.
("*call_value_local_aix<mode>"): Likewise.
("*call_nonlocal_aix<mode>"): Likewise.
("*call_value_nonlocal_aix<mode>"): Likewise.
("*call_indirect_aix<mode>"): Likewise.
("*call_value_indirect_aix<mode>"): Likewise.
("sibcall"): Likewise.
("sibcall_value"): Likewise.
("*sibcall_aix<mode>"): Likewise.
("*sibcall_value_aix<mode>"): Likewise.
* config/rs6000/predicates.md ("symbol_ref_operand"): Likewise.
("current_file_function_operand"): Likewise.
gcc/testsuite/ChangeLog:
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gcc.target/powerpc/ppc64-abi-1.c (stack_frame_t): Remove
compiler and linker field if _CALL_ELF == 2.
* gcc.target/powerpc/ppc64-abi-2.c (stack_frame_t): Likewise.
* gcc.target/powerpc/ppc64-abi-dfp-1.c (stack_frame_t): Likewise.
* gcc.dg/stack-usage-1.c (SIZE): Update value for _CALL_ELF == 2.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gcc.target/powerpc/ppc64-abi-dfp-1.c (FUNC_START): New macro.
(WRAPPER): Use it.
* gcc.target/powerpc/no-r11-1.c: Skip on powerpc_elfv2.
* gcc.target/powerpc/no-r11-2.c: Skip on powerpc_elfv2.
* gcc.target/powerpc/no-r11-3.c: Skip on powerpc_elfv2.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* lib/target-supports.exp (check_effective_target_powerpc_elfv2):
New function.
* gcc.target/powerpc/pr57949-1.c: Disable for powerpc_elfv2.
* gcc.target/powerpc/pr57949-2.c: Likewise.
libgcc/ChangeLog:
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Alan Modra <amodra@gmail.com>
* config/rs6000/linux-unwind.h (TOC_SAVE_SLOT): Define.
(frob_update_context): Use it.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Alan Modra <amodra@gmail.com>
* config/rs6000/tramp.S [__powerpc64__ && _CALL_ELF == 2]:
(trampoline_initial): Provide ELFv2 variant.
(__trampoline_setup): Likewise.
* config/rs6000/linux-unwind.h (frob_update_context): Do not
check for AIX indirect function call sequence if _CALL_ELF == 2.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Alan Modra <amodra@gmail.com>
* config/rs6000/linux-unwind.h (get_regs): Do not support
old kernel versions if _CALL_ELF == 2.
(frob_update_context): Do not support PLT stub variants only
generated by old linkers if _CALL_ELF == 2.
libitm/ChangeLog:
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* config/powerpc/sjlj.S [__powerpc64__ && _CALL_ELF == 2]:
(FUNC): Define ELFv2 variant.
(END): Likewise.
(HIDDEN): Likewise.
(CALL): Likewise.
(BASE): Likewise.
(LR_SAVE): Likewise.
libstdc++/ChangeLog:
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* scripts/extract_symvers.in: Ignore <localentry: > fields
in readelf --symbols output.
Co-Authored-By: Alan Modra <amodra@gmail.com>
Co-Authored-By: Michael Gschwind <mkg@us.ibm.com>
From-SVN: r204808
2013-11-14 18:50:48 +00:00
Torvald Riegel
6fb471d812
libitm: Fix wrong initialization order introduced with r202101.
...
* config/posix/rwlock.cc: Fix initialization order.
From-SVN: r202116
2013-08-30 17:13:05 +00:00
Torvald Riegel
bec9ec3fc1
Add custom HTM fast path for RTM on x86_64.
...
* libitm_i.h (gtm_thread): Assign an asm name to serial_lock.
(htm_fastpath): Assign an asm name.
* libitm.h (_ITM_codeProperties): Add non-ABI flags used by custom
HTM fast paths.
(_ITM_actions): Likewise.
* config/x86/target.h (HTM_CUSTOM_FASTPATH): Enable custom fastpath on
x86_64.
* config/x86/sjlj.S (_ITM_beginTransaction): Add custom HTM fast path.
* config/posix/rwlock.h (gtm_rwlock): Update comments. Move summary
field to the start of the structure.
* config/linux/rwlock.h (gtm_rwlock): Update comments.
* beginend.cc (gtm_thread::begin_transaction): Add retry policy
handling for custom HTM fast paths.
From-SVN: r202101
2013-08-30 10:33:41 +00:00
Andreas Krebbel
aaaffb2a0d
2013-07-29 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
...
* config/s390/target.h (htm_begin, htm_commit, htm_abort)
(htm_transaction_active): Enable zEC12 instructions in the
assembler.
* configure.tgt: Remove -Wa,-march=zEC12 from XCFLAGS.
From-SVN: r201301
2013-07-29 08:03:38 +00:00
Andreas Krebbel
167f68ede4
s390.c: (s390_expand_builtin): Allow -mhtm to be enabled without -march=zEC12.
...
2013-07-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c: (s390_expand_builtin): Allow -mhtm to be
enabled without -march=zEC12.
* config/s390/s390.h (TARGET_HTM): Do not require EC12 machine
flags to be set.
2013-07-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* acinclude.m4: Add htm asm check for s390.
* configure.tgt: Add -mhtm and -Wa,-march=zEC12 to the options.
* configure: Regenerate.
* config/s390/target.h: Remove __HTM__ check.
(htm_available): Call getauxval to get hwcaps and check whether
HTM is available or not.
From-SVN: r201004
2013-07-17 11:15:24 +00:00
Peter Bergner
0258b6e466
acinclude.m4 (LIBITM_CHECK_AS_HTM): New.
...
libitm/
* acinclude.m4 (LIBITM_CHECK_AS_HTM): New.
* configure.ac: Use it.
(AC_CHECK_HEADERS): Check for sys/auxv.h.
(AC_CHECK_FUNCS): Check for getauxval.
* config.h.in, configure: Rebuild.
* configure.tgt (target_cpu): Add -mhtm to XCFLAGS.
* config/powerpc/target.h: Include sys/auxv.h and htmintrin.h.
(USE_HTM_FASTPATH): Define.
(_TBEGIN_STARTED, _TBEGIN_INDETERMINATE, _TBEGIN_PERSISTENT,
_HTM_RETRIES) New macros.
(htm_abort, htm_abort_should_retry, htm_available, htm_begin, htm_init,
htm_begin_success, htm_commit, htm_transaction_active): New functions.
gcc/
* config.gcc (powerpc*-*-*): Install htmintrin.h and htmxlintrin.h.
* config/rs6000/t-rs6000 (MD_INCLUDES): Add htm.md.
* config/rs6000/rs6000.opt: Add -mhtm option.
* config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Add OPTION_MASK_HTM.
(ISA_2_7_MASKS_SERVER): Add OPTION_MASK_HTM.
* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
__HTM__ if the HTM instructions are available.
* config/rs6000/predicates.md (u3bit_cint_operand, u10bit_cint_operand,
htm_spr_reg_operand): New define_predicates.
* config/rs6000/rs6000.md (define_attr "type"): Add htm.
(TFHAR_REGNO, TFIAR_REGNO, TEXASR_REGNO): New define_constants.
Include htm.md.
* config/rs6000/rs6000-builtin.def (BU_HTM_0, BU_HTM_1, BU_HTM_2,
BU_HTM_3, BU_HTM_SPR0, BU_HTM_SPR1): Add support macros for defining
HTM builtin functions.
* config/rs6000/rs6000.c (RS6000_BUILTIN_H): New macro.
(rs6000_reg_names, alt_reg_names): Add HTM SPR register names.
(rs6000_init_hard_regno_mode_ok): Add support for HTM instructions.
(rs6000_builtin_mask_calculate): Likewise.
(rs6000_option_override_internal): Likewise.
(bdesc_htm): Add new HTM builtin support.
(htm_spr_num): New function.
(htm_spr_regno): Likewise.
(rs6000_htm_spr_icode): Likewise.
(htm_expand_builtin): Likewise.
(htm_init_builtins): Likewise.
(rs6000_expand_builtin): Add support for HTM builtin functions.
(rs6000_init_builtins): Likewise.
(rs6000_invalid_builtin, rs6000_opt_mask): Add support for -mhtm option.
* config/rs6000/rs6000.h (ASM_CPU_SPEC): Add support for -mhtm.
(TARGET_HTM, MASK_HTM): Define macros.
(FIRST_PSEUDO_REGISTER): Adjust for new HTM SPR registers.
(FIXED_REGISTERS): Likewise.
(CALL_USED_REGISTERS): Likewise.
(CALL_REALLY_USED_REGISTERS): Likewise.
(REG_ALLOC_ORDER): Likewise.
(enum reg_class): Likewise.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(REGISTER_NAMES): Likewise.
(ADDITIONAL_REGISTER_NAMES): Likewise.
(RS6000_BTC_SPR, RS6000_BTC_VOID, RS6000_BTC_32BIT, RS6000_BTC_64BIT,
RS6000_BTC_MISC_MASK, RS6000_BTM_HTM): New macros.
(RS6000_BTM_COMMON): Add RS6000_BTM_HTM.
* config/rs6000/htm.md: New file.
* config/rs6000/htmintrin.h: New file.
* config/rs6000/htmxlintrin.h: New file.
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_powerpc_htm_ok): New
function to test if HTM is available.
* gcc.target/powerpc/htm-xl-intrin-1.c: New test.
* gcc.target/powerpc/htm-builtin-1.c: New test.
From-SVN: r200960
2013-07-15 12:23:49 -05:00
Andreas Krebbel
5a3fe9b607
s390.c: Rename UNSPEC_CCU_TO_INT to UNSPEC_STRCMPCC_TO_INT and UNSPEC_CCZ_TO_INT to...
...
2013-06-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c: Rename UNSPEC_CCU_TO_INT to
UNSPEC_STRCMPCC_TO_INT and UNSPEC_CCZ_TO_INT to UNSPEC_CC_TO_INT.
(struct machine_function): Add tbegin_p.
(s390_canonicalize_comparison): Fold CC mode compares to
conditional jump if possible.
(s390_emit_jump): Return the emitted jump.
(s390_branch_condition_mask, s390_branch_condition_mnemonic):
Handle CCRAWmode compares.
(s390_option_override): Default to -mhtm if available.
(s390_reg_clobbered_rtx): Handle floating point regs as well.
(s390_regs_ever_clobbered): Use s390_regs_ever_clobbered also for
FPRs instead of df_regs_ever_live_p.
(s390_optimize_nonescaping_tx): New function.
(s390_init_frame_layout): Extend clobbered_regs array to cover
FPRs as well.
(s390_emit_prologue): Call s390_optimize_nonescaping_tx.
(s390_expand_tbegin): New function.
(enum s390_builtin): New enum definition.
(code_for_builtin): New array definition.
(s390_init_builtins): New function.
(s390_expand_builtin): New function.
(TARGET_INIT_BUILTINS): Define.
(TARGET_EXPAND_BUILTIN): Define.
* common/config/s390/s390-common.c (processor_flags_table): Add
PF_TX.
* config/s390/predicates.md (s390_comparison): Handle CCRAWmode.
(s390_alc_comparison): Likewise.
* config/s390/s390-modes.def: Add CCRAWmode.
* config/s390/s390.h (processor_flags): Add PF_TX.
(TARGET_CPU_HTM): Define macro.
(TARGET_HTM): Define macro.
(TARGET_CPU_CPP_BUILTINS): Define __HTM__ for htm.
* config/s390/s390.md: Rename UNSPEC_CCU_TO_INT to
UNSPEC_STRCMPCC_TO_INT and UNSPEC_CCZ_TO_INT to UNSPEC_CC_TO_INT.
(UNSPECV_TBEGIN, UNSPECV_TBEGINC, UNSPECV_TEND, UNSPECV_TABORT)
(UNSPECV_ETND, UNSPECV_NTSTG, UNSPECV_PPA): New unspecv enum
values.
(TBEGIN_MASK, TBEGINC_MASK): New constants.
("*cc_to_int"): Move up.
("*mov<mode>cc", "*cjump_64", "*cjump_31"): Accept integer
constants other than 0.
("*ccraw_to_int"): New insn and splitter definition.
("tbegin", "tbegin_nofloat", "tbegin_retry")
("tbegin_retry_nofloat", "tbeginc", "tend", "tabort")
("tx_assist"): New expander.
("tbegin_1", "tbegin_nofloat_1", "*tbeginc_1", "*tend_1")
("*tabort_1", "etnd", "ntstg", "*ppa"): New insn definition.
* config/s390/s390.opt: Add -mhtm option.
* config/s390/s390-protos.h (s390_emit_jump): Add return type.
* config/s390/htmxlintrin.h: New file.
* config/s390/htmintrin.h: New file.
* config/s390/s390intrin.h: New file.
* doc/extend.texi: Document htm builtins.
* config.gcc: Add the new header files to extra_headers.
2013-06-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.target/s390/htm-1.c: New file.
* gcc.target/s390/htm-nofloat-1.c: New file.
* gcc.target/s390/htm-xl-intrin-1.c: New file.
2013-06-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/target.h: Include htmintrin.h.
(_HTM_ITM_RETRIES): New macro definition.
(htm_available, htm_init, htm_begin, htm_begin_success)
(htm_commit, htm_abort, htm_abort_should_retry): New functions.
From-SVN: r200454
2013-06-27 07:44:11 +00:00
Torvald Riegel
480c696bb0
libitm: Handle HTM fastpath in status query functions.
...
* query.cc (_ITM_inTransaction): Abort when using the HTM fastpath.
(_ITM_getTransactionId): Same.
* config/x86/target.h (htm_transaction_active): New.
From-SVN: r200251
2013-06-20 16:40:54 +00:00
Andreas Krebbel
aaec3fc814
sjlj.S: New file.
...
2013-04-23 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/sjlj.S: New file.
* config/s390/target.h: New file.
* configure.tgt: Set options for S/390.
From-SVN: r198190
2013-04-23 11:33:50 +00:00
Richard Sandiford
75f9527c9b
Update copyright in libitm.
...
From-SVN: r195697
2013-02-03 17:46:11 +00:00
Torvald Riegel
64fbcc74a3
Add HTM fastpath and use Intel RTM for it on x86.
...
* beginend.cc (htm_fastpath): New.
(gtm_thread::begin_transaction, _ITM_commitTransaction,
_ITM_commitTransactionEH): Add HTM fastpath handling.
* config/linux/rwlock.h (gtm_rwlock.is_write_locked): New.
* config/posix/rwlock.h (gtm_rwlock.is_write_locked): New.
* config/x86/target.h (htm_available, htm_init, htm_begin_success,
htm_begin, htm_commit, htm_abort, htm_abort_should_retry): New.
* configure.tgt: Add -mrtm to XCFLAGS.
* method-serial.cc (htm_mg, o_htm_mg, htm_dispatch, dispatch_htm): New.
(gtm_thread::serialirr_mode): Add HTM fastpath handling.
* libitm_i.h (htm_fastpath, dispatch_htm): Declare.
* retry.cc (parse_default_method): Add HTM method parsing.
(gtm_thread::number_of_threads_changed): Use HTM by default if
available.
From-SVN: r193369
2012-11-09 17:04:40 +00:00
Uros Bizjak
0c609a2144
target.h (struct gtm_jmpbuf): Merge x86_64 and ia32 declarations some more.
...
* config/x86/target.h (struct gtm_jmpbuf): Merge x86_64
and ia32 declarations some more.
* config/x86/sjlj.S (_ITM_beginTransaction): Move ret to common code.
From-SVN: r191955
2012-10-02 09:50:36 +02:00
Uros Bizjak
68a12ef35b
xmmintrin.h (_mm_sfence): Use __builtin_ia32_pause.
...
gcc/
2012-07-03 Uros Bizjak <ubizjak@gmail.com>
* config/i386/xmmintrin.h (_mm_sfence): Use __builtin_ia32_pause.
libgomp/
2012-07-03 Uros Bizjak <ubizjak@gmail.com>
* config/linux/x86/futex.h (cpu_relax): Use __builtin_ia32_pause.
* testsuite/libgomp.c/sort-1.c (busy_wait): Ditto.
libitm/
2012-07-03 Uros Bizjak <ubizjak@gmail.com>
* config/x86/target.h (cpu_relax): Use __builtin_ia32_pause.
From-SVN: r189194
2012-07-03 09:24:10 +02:00
H.J. Lu
0100e3b3e8
Use long long in gtm_jmpbuf for x86-64
...
2012-04-04 H.J. Lu <hongjiu.lu@intel.com>
PR libitm/52854
* config/x86/target.h (gtm_jmpbuf): Replace long with long long
for x86-64.
From-SVN: r186140
2012-04-04 08:49:23 -07:00
Torvald Riegel
0d23faac63
libitm: Fix lost wake-up in serial lock.
...
PR libitm/52526
* config/linux/rwlock.cc (GTM::gtm_rwlock::read_lock): Fix lost
wake-up.
From-SVN: r185358
2012-03-13 22:01:34 +00:00
Richard Henderson
72824d5e40
* config/x86/target.h (GTM_longjmp): Correct the .cfi corrections.
...
From-SVN: r184227
2012-02-14 11:46:46 -08:00
Uros Bizjak
1f319dbad6
target.h (GTM_longjmp): Correct .cfi directives.
...
* config/x86/target.h (GTM_longjmp): Correct .cfi directives.
From-SVN: r184220
2012-02-14 19:38:38 +01:00
Eric Botcazou
62513f7bed
target.h (cpu_relax): Read from CC register.
...
* config/sparc/target.h (cpu_relax): Read from CC register.
* config/sparc/sjlj.S (GTM_longjmp): Restore %fp atomically.
From-SVN: r184202
2012-02-14 09:22:26 +00:00
Uros Bizjak
d4a698d494
target.h (GTM_longjmp): Jump indirect from memory address.
...
* config/x86/target.h (GTM_longjmp): Jump indirect from memory address.
From-SVN: r184198
2012-02-14 08:50:38 +01:00
Eric Botcazou
f3f5e3c32e
configure.tgt (target_cpu): Handle sparc and sparc64 & sparcv9.
...
* configure.tgt (target_cpu): Handle sparc and sparc64 & sparcv9.
* config/sparc/cacheline.h: New file.
* config/sparc/target.h: Likewise.
* config/sparc/sjlj.S: Likewise.
* config/linux/sparc/futex_bits.h: Likewise.
From-SVN: r184177
2012-02-13 21:51:44 +00:00
Torvald Riegel
999bcff5bd
libitm: Fix wake-up of readers in futex-based serial lock.
...
libitm/
* config/linux/rwlock.cc (GTM::gtm_rwlock::write_unlock): Fix reader
wake-up.
From-SVN: r183488
2012-01-24 19:17:05 +00:00
Uros Bizjak
9848887afa
target.h (gtm_jmpbuf): Move rip to the end of structure.
...
* config/x86/target.h (gtm_jmpbuf) [__x86_64__]: Move rip to the
end of structure.
* config/x86/sjlj.S (_ITM_beginTransaction) [__x86_64__]: Update
offset values. Do not copy return address. Decrement stack
by 56 bytes only.
(GTM_longjump) [__x86_64__]: Update offset values.
From-SVN: r183467
2012-01-24 08:23:57 +01:00
Uros Bizjak
5752c591bc
re PR libitm/51830 (FAIL: libitm.c/mem(cpy|set)-1.c execution test)
...
PR libitm/51830
* builtin-types.def (BT_FN_UINT_UINT_VAR): New.
* gtm-builtins.def (BUILT_IN_TM_START): Declare as BT_FN_UINT_UINT_VAR.
libitm/ChangeLog:
PR libitm/51830
* config/x86/sjlj.S (_ITM_beginTransaction) [!__x86_64__]: Load
the first function argument to %eax.
From-SVN: r183435
2012-01-23 15:57:44 +01:00
Torvald Riegel
07b6642b93
libitm: Filter out undo writes that overlap with the libitm stack.
...
PR libitm/51855
* config/generic/tls.h (GTM::mask_stack_top): New.
(GTM::mask_stack_bottom): Declare.
* config/generic/tls.c (GTM::mask_stack_bottom): New.
* local.cc (gtm_undolog::rollback): Filter out any updates that
overlap the libitm stack. Add current transaction as parameter.
* libitm_i.h (GTM::gtm_undolog::rollback): Adapt.
* beginend.cc (GTM::gtm_thread::rollback): Adapt.
* testsuite/libitm.c/stackundo.c: New test.
From-SVN: r183172
2012-01-13 23:45:06 +00:00
Richard Henderson
a32e5e9357
libitm: PowerPC support.
...
* configure.tgt: Support powerpc-linux and powerpc-darwin.
* config/linux/powerpc/futex_bits.h: New file.
* config/powerpc/cacheline.h: New file.
* config/powerpc/sjlj.S: New file.
* config/powerpc/target.h: New file.
* config/generic/asmcfi.h (cfi_offset): New.
(cfi_restore, cfi_undefined): New.
From-SVN: r182930
2012-01-05 13:36:35 -08:00
Torvald Riegel
610e390135
libitm: Fix privatization safety during upgrades to serial mode.
...
libitm/
* beginend.cc (GTM::gtm_thread::restart): Add and handle
finish_serial_upgrade parameter.
* libitm.h (GTM::gtm_thread::restart): Adapt declaration.
* config/linux/rwlock.cc (GTM::gtm_rwlock::write_lock_generic):
Don't unset reader flag.
(GTM::gtm_rwlock::write_upgrade_finish): New.
* config/posix/rwlock.cc: Same.
* config/linux/rwlock.h (GTM::gtm_rwlock::write_upgrade_finish):
Declare.
* config/posix/rwlock.h: Same.
* method-serial.cc (GTM::gtm_thread::serialirr_mode): Unset reader
flag after commit or after rollback when restarting.
From-SVN: r182675
2011-12-24 01:42:35 +00:00
Torvald Riegel
799142bf74
libitm: Fixed conversion to C++11 atomics.
...
libitm/
* beginend.cc (GTM::gtm_thread::begin_transaction): Add comment.
(GTM::gtm_thread::try_commit): Changed memory order.
* config/linux/alpha/futex_bits.h (sys_futex0): Take atomic int
as parameter.
* config/linux/x86/futex_bits.h (sys_futex0): Same.
* config/linux/sh/futex_bits.h (sys_futex0): Same.
* config/linux/futex_bits.h (sys_futex0): Same.
* config/linux/futex.cc (futex_wait, futex_wake): Same.
* config/linux/futex.h (futex_wait, futex_wake): Same.
* config/linux/rwlock.h (gtm_rwlock::writers,
gtm_rwlock::writer_readers, gtm_rwlock::readers): Change to atomic
ints.
* config/linux/rwlock.cc (gtm_rwlock::read_lock,
gtm_rwlock::write_lock_generic, gtm_rwlock::read_unlock,
gtm_rwlock::write_unlock): Fix memory orders and fences.
* config/posix/rwlock.cc (gtm_rwlock::read_lock,
gtm_rwlock::write_lock_generic, gtm_rwlock::read_unlock,
gtm_rwlock::write_unlock): Same.
* config/linux/rwlock.h (gtm_rwlock::summary): Change to atomic int.
* method-gl.cc (gl_mg::init, gl_wt_dispatch::memtransfer_static,
gl_wt_dispatch::memset_static, gl_wt_dispatch::begin_or_restart):
Add comments.
(gl_wt_dispatch::pre_write, gl_wt_dispatch::validate,
gl_wt_dispatch::load, gl_wt_dispatch::store,
gl_wt_dispatch::try_commit, gl_wt_dispatch::rollback): Fix memory
orders and fences. Add comments.
From-SVN: r182674
2011-12-24 01:42:20 +00:00
Kaz Kojima
cc16324749
configure.tgt: Add sh* case.
...
* configure.tgt: Add sh* case.
* config/sh/target.h: New file.
* config/sh/sjlj.S: New file.
* config/linux/sh/futex_bits.h: New file.
From-SVN: r182429
2011-12-17 03:19:40 +00:00
Richard Henderson
aebac0ca06
arm-linux: Add libitm support.
...
* config/arm/hwcap.h, config/arm/hwcap.cc: New files.
* config/arm/sjlj.S, config/arm/target.h: New files.
* config/generic/asmcfi.h (cfi_adjust_cfa_offset): New.
(cfi_rel_offset): New.
* config/linux/futex_bits.h: New file.
* config/linux/futex.cc: Include futex_bits.h here...
* config/linux/futex.h: ... not here.
* Makefile.am (libitm_la_SOURCES) <ARCH_ARM>: Add hwcap.cc.
* configure.ac (ARCH_AM): New conditional.
* Makefile.in, configure: Rebuild.
* configure.tgt: Handle ARM.
From-SVN: r182355
2011-12-14 19:24:05 -08:00
Richard Henderson
5d9d05d349
rwlock.cc (gtm_rwlock::write_lock_generic): Fix signed/unsigned comparison werror.
...
* config/posix/rwlock.cc (gtm_rwlock::write_lock_generic): Fix
signed/unsigned comparison werror.
From-SVN: r182302
2011-12-13 12:10:36 -08:00
Richard Henderson
36cfbee133
libitm: Conversion to c++11 atomics.
...
* local_atomic: New file.
* libitm_i.h: Include it.
(gtm_thread::shared_state): Use atomic template.
* beginend.cc (GTM::gtm_clock): Use atomic template.
(global_tid): Use atomic template if 64-bit atomics available.
(gtm_thread::gtm_thread): Update shared_state access.
(gtm_thread::trycommit): Likewise.
(choose_code_path): Update global_tid access.
* method-gl.cc (gl_mg::orec): Use atomic template. Update all users.
* stmlock.h (GTM::gtm_clock): Use atomic template.
(gtm_get_clock, gtm_inc_clock): Update accesses.
* config/linux/rwlock.cc (gtm_rwlock::read_lock): Remove
redundant __sync_synchronize after atomic shared_state access.
* config/posix/rwlock.cc (gtm_rwlock::read_lock): Likewise.
(gtm_rwlock::write_lock_generic): Likewise.
(gtm_rwlock::read_unlock): Likewise.
* config/alpha/target.h (atomic_read_barrier): Remove.
(atomic_write_barrier): Remove.
* config/x86/target.h (atomic_read_barrier): Remove.
(atomic_write_barrier): Remove.
From-SVN: r182294
2011-12-13 11:11:25 -08:00
Richard Henderson
062f93f255
Swap the action and jmpbuf arguments to GTM_longjmp
...
On several ABIs, the first register parameter is the same as
the return value register. Moving the action parameter first
avoids the need for register shuffling on these targets.
* libitm_i.h (GTM_longjmp): Swap first and second arguments.
* beginend.c (_ITM_abortTransaction): Update to match.
(GTM::gtm_thread::restart): Likewise.
* config/alpha/sjlj.S (GTM_longjmp): Likewise.
* config/x86/sjlj.S (GTM_longjmp): Likewise.
From-SVN: r181863
2011-11-30 14:29:33 -08:00
Iain Sandoe
0b41ebef72
sjlj.S (CONCAT1, [...]): Respond to __USER_LABEL_PREFIX__ for targets that use it.
...
libitm:
* config/x86/sjlj.S (CONCAT1, CONCAT2, SYM): Respond to
__USER_LABEL_PREFIX__ for targets that use it.
TYPE, SIZE, HIDDEN): New macros to assist on non-elf targets.
(_ITM_beginTransaction): Use SYM, TYPE, SIZE macros to assist
in portability to non-elf targets.
(GTM_longjmp): LIkewise.
* libitm_i.h (begin_transaction): Apply __USER_LABEL_PREFIX__
where required.
From-SVN: r181612
2011-11-22 09:57:19 +00:00
Rainer Orth
59659b5967
Support libitm on Solaris 8 and 9/x86 with Sun as
...
* config/generic/asmcfi.h: Fix comment.
* config/x86/sjlj.S (_ITM_beginTransaction): Provide ELF PIC code
sequence without .hidden support, error for non-ELF targets.
(GTM_longjmp) [__ELF__]: Only use .hidden if
HAVE_ATTRIBUTE_VISIBILITY.
From-SVN: r181481
2011-11-18 16:15:59 +00:00
Rainer Orth
8851b42977
libitm port to Tru64 UNIX
...
* config/alpha/sjlj.S (_ITM_beginTransaction) [!__ELF__]: Don't use
.hidden.
(.note.GNU-stack): Only use if __linux__.
* alloc_cpp.cc [!__osf__] (_ZnaXRKSt9nothrow_t): Dummy function.
* testsuite/libitm.c/notx.c: Use dg-options "-pthread".
* testsuite/libitm.c/reentrant.c: Likewise.
* testsuite/libitm.c/simple-2.c: Likewise.
* testsuite/libitm.c/txrelease.c: Likewise.
* testsuite/libitm.c++/static_ctor.C: Likewise.
From-SVN: r181262
2011-11-10 17:15:33 +00:00
Richard Henderson
d4b179020b
libitm: Don't add -mavx if the assembler doesn't support avx.
...
* config/x86/x86_avx.cc: Remove #undef __AVX__ hack. Tidy comments.
* Makefile.am (x86_avx.lo): Only add -mavx if ARCH_X86_AVX.
* configure.ac (ARCH_X86_AVX): New conditional.
* Makefile.in, configure: Rebuild.
From-SVN: r181261
2011-11-10 09:09:04 -08:00
Richard Henderson
430616e7a7
libitm: Work around assembler missing AVX insns.
...
From-SVN: r181246
2011-11-09 16:29:38 -08:00
Richard Henderson
79b1edb6b5
libitm: Remove unused code.
...
In particular, unused code that's presenting portability problems.
From-SVN: r181241
2011-11-09 14:54:55 -08:00
Richard Henderson
8ee9fac21e
libitm: Avoid non-portable x86 branch prediction mnemonic.
...
From-SVN: r181233
2011-11-09 11:51:49 -08:00
Richard Henderson
9bdc63433a
libitm: de-ELF-ize x86/sjlj.S.
...
* config/x86/sjlj.S: Protect elf directives with __ELF__.
Protect .note.GNU-stack with __linux__.
From-SVN: r181229
2011-11-09 10:38:21 -08:00
Richard Henderson
4bdd090f8e
libitm: Configure for gas cfi pseudo ops.
...
* asmcfi.m4: New file.
* configure.ac (GCC_AS_CFI_PSEUDO_OP): Test it.
* configure, aclocal.m4, config.h.in: Rebuild.
* config/generic/asmcfi.h: New file.
* config/x86/sjlj.S: Use it.
From-SVN: r181224
2011-11-09 10:09:53 -08:00
Rainer Orth
e28a3d8bf2
Fix Solaris/x86 libitm build
...
* configure.tgt: Handle i386 like i[456]86.
* config/generic/tls.h [!HAVE_ARCH_GTM_THREAD] (gtm_thr): Don't
take address.
* config/generic/tls.cc [!HAVE_ARCH_GTM_THREAD ||
!HAVE_ARCH_GTM_THREAD_DISP] (_gtm_thr_tls): New variable.
From-SVN: r181163
2011-11-08 14:58:57 +00:00
Aldy Hernandez
0a35513e4e
Merge from transactional-memory branch.
...
From-SVN: r181154
2011-11-08 11:13:41 +00:00