Commit Graph

66303 Commits

Author SHA1 Message Date
Alexander Monakov 0c6b03b515 OpenMP/PTX privatization in SIMD regions
* config/nvptx/nvptx-protos.h (nvptx_output_simt_enter): Declare.
	(nvptx_output_simt_exit): Declare.
	* config/nvptx/nvptx.c (nvptx_init_unisimt_predicate): Use
	cfun->machine->unisimt_location.  Handle NULL unisimt_predicate.
	(init_softstack_frame): Move initialization of crtl->is_leaf to...
	(nvptx_declare_function_name): ...here.  Emit declaration of local
	memory space buffer for omp_simt_enter insn.
	(nvptx_output_unisimt_switch): New.
	(nvptx_output_softstack_switch): New.
	(nvptx_output_simt_enter): New.
	(nvptx_output_simt_exit): New.
	* config/nvptx/nvptx.h (struct machine_function): New fields
	has_simtreg, unisimt_location, simt_stack_size, simt_stack_align.
	* config/nvptx/nvptx.md (UNSPECV_SIMT_ENTER): New unspec.
	(UNSPECV_SIMT_EXIT): Ditto.
	(omp_simt_enter_insn): New insn.
	(omp_simt_enter): New expansion.
	(omp_simt_exit): New insn.
	* config/nvptx/nvptx.opt (msoft-stack-reserve-local): New option.

	* internal-fn.c (expand_GOMP_SIMT_ENTER): New.
	(expand_GOMP_SIMT_ENTER_ALLOC): New.
	(expand_GOMP_SIMT_EXIT): New.
	* internal-fn.def (GOMP_SIMT_ENTER): New internal function.
	(GOMP_SIMT_ENTER_ALLOC): Ditto.
	(GOMP_SIMT_EXIT): Ditto.
	* target-insns.def (omp_simt_enter): New insn.
	(omp_simt_exit): Ditto.
	* omp-low.c (struct omplow_simd_context): New fields simt_eargs,
	simt_dlist.
	(lower_rec_simd_input_clauses): Implement SIMT privatization.
	(lower_rec_input_clauses): Likewise.
	(lower_lastprivate_clauses): Handle SIMT privatization.

	* omp-offload.c: Include langhooks.h, tree-nested.h, stor-layout.h.
	(ompdevlow_adjust_simt_enter): New.
	(find_simtpriv_var_op): New.
	(execute_omp_device_lower): Handle IFN_GOMP_SIMT_ENTER,
	IFN_GOMP_SIMT_ENTER_ALLOC, IFN_GOMP_SIMT_EXIT.

	* tree-inline.h (struct copy_body_data): New field dst_simt_vars.
	* tree-inline.c (expand_call_inline): Handle SIMT privatization.
	(copy_decl_for_dup_finish): Ditto.

	* tree-ssa.c (execute_update_addresses_taken): Handle GOMP_SIMT_ENTER.

From-SVN: r246550
2017-03-28 20:24:57 +03:00
Uros Bizjak 189d9d3a8f * ChangeLog: Fix my ChangeLog entry.
From-SVN: r246545
2017-03-28 18:53:50 +02:00
Uros Bizjak 34fac449e1 re PR target/53383 (Allow -mpreferred-stack-boundary=3 on x86-64)
PR target/53383
	* config/i386/i386.c (ix86_option_override_internal): Always
	allow -mincoming-stack-boundary=3 for 64-bit targets.

testsuite/ChangeLog:

	PR target/53383
	* gcc.target/i386/pr53383-1.c (dg-options): Remove -mno-sse.
	* gcc.target/i386/pr53383-2.c (dg-options): Ditto.
	* gcc.target/i386/pr53383-3.c (dg-options): Ditto.

From-SVN: r246543
2017-03-28 18:51:00 +02:00
Bin Cheng 9d384e80bd tree-vect-loop.c (optimize_mask_stores): Add bb to the right loop.
* tree-vect-loop.c (optimize_mask_stores): Add bb to the right
	loop.

From-SVN: r246541
2017-03-28 15:35:56 +00:00
Bin Cheng 3e907b9056 tree-vect-loop-manip.c (slpeel_add_loop_guard): New param and mark new edge's irreducible flag accordign to it.
* tree-vect-loop-manip.c (slpeel_add_loop_guard): New param and
	mark new edge's irreducible flag accordign to it.
	(vect_do_peeling): Check loop preheader edge's irreducible flag
	and pass it to function slpeel_add_loop_guard.
	gcc/testsuite
	* gcc.c-torture/compile/irreducible-loop.c: New.

From-SVN: r246540
2017-03-28 15:32:29 +00:00
Richard Sandiford 522818b971 re PR tree-optimization/80218 (tree-call-cdce does not update block frequencies)
gcc/
	PR tree-optimization/80218
	* tree-call-cdce.c (shrink_wrap_one_built_in_call_with_conds):
	Update block frequencies and counts.

gcc/testsuite/
	PR tree-optimization/80218
	* gcc.dg/pr80218.c: New test.

From-SVN: r246538
2017-03-28 09:14:36 -06:00
Richard Biener ea7d7da886 re PR ipa/78644 (ICE: SIGSEGV in is_gimple_reg_type with -Og -fipa-cp)
2017-03-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/78644
	* tree-ssa-ccp.c (evaluate_stmt): When we may not use the value
	of a simplification result we may not use it at all.

	* gcc.dg/pr78644-1.c: New testcase.
	* gcc.dg/pr78644-2.c: Likewise.

From-SVN: r246534
2017-03-28 13:57:43 +00:00
Martin Liska c5ad243343 Handle PHI nodes w/o a argument (PR ipa/80205).
2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80205
	* g++.dg/ipa/pr80205.C: New test.
2017-03-28  Richard Biener  <rguenther@suse.de>

	PR ipa/80205
	* tree-inline.c (copy_phis_for_bb): Do not create PHI node
	without arguments, generate default definition of a SSA name.

From-SVN: r246530
2017-03-28 11:37:22 +00:00
Richard Biener 737f500a0b re PR middle-end/80222 (may_alias folded away)
2017-03-28  Richard Biener  <rguenther@suse.de>

	PR middle-end/80222
	* gimple-fold.c (gimple_fold_indirect_ref): Do not touch
	TYPE_REF_CAN_ALIAS_ALL references.
	* fold-const.c (fold_indirect_ref_1): Likewise.

	* g++.dg/pr80222.C: New testcase.

From-SVN: r246527
2017-03-28 10:10:01 +00:00
Martin Liska 62f96a79f1 Fix calls.c for a _complex type (PR ipa/80104).
2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80104
	* cgraphunit.c (cgraph_node::expand_thunk): Mark argument of a
	thunk call as DECL_GIMPLE_REG_P when vector or complex type.
2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80104
	* gcc.dg/ipa/pr80104.c: New test.

From-SVN: r246525
2017-03-28 09:01:57 +00:00
Claudiu Zissulescu 0dee55fec9 [ARC] Define _REENTRANT when -pthread is passed.
The compiler is supposed to have the builtin defined _REENTRANT defined
when -pthread is passed, which wasn't done on the ARC architecture.

When _REENTRANT is not passed, the C library will not use reentrant
functions, and the latest version of ax_pthread.m4 from the
autoconf-archive will no longer detect that thread support is
available (see https://savannah.gnu.org/patch/?8186).

gcc/
2017-03-28  Claudiu Zissulescu  <claziss@synopsys.com>
	    Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

	* config/arc/arc.h (CPP_SPEC): Add subtarget_cpp_spec.
	(EXTRA_SPECS): Define.
	(SUBTARGET_EXTRA_SPECS): Likewise.
	(SUBTARGET_CPP_SPEC): Likewise.
	* config/arc/elf.h (EXTRA_SPECS): Renamed to
	SUBTARGET_EXTRA_SPECS.
	* config/arc/linux.h (SUBTARGET_CPP_SPEC): Define.

Co-Authored-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

From-SVN: r246524
2017-03-28 10:56:44 +02:00
Claudiu Zissulescu d1ab0a32ad [ARC] Update ARC SIMD patterns.
vec_select expects in selection a list of subparts. The old ARC SIMD
extension instructions were not up-to-date.

gcc/
2017-03-28  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/simdext.md (vst64_insn): Update pattern.
	(vld32wh_insn): Likewise.
	(vld32wl_insn): Likewise.
	(vld64_insn): Likewise.
	(vld32_insn): Likewise.

From-SVN: r246523
2017-03-28 10:56:33 +02:00
Marek Polacek 72785f2660 re PR sanitizer/80067 (ICE in fold_comparison with -fsanitize=undefined)
PR sanitizer/80067
	* fold-const.c (fold_comparison): Use protected_set_expr_location
	instead of SET_EXPR_LOCATION.

	* c-c++-common/ubsan/shift-10.c: New test.

From-SVN: r246521
2017-03-28 08:13:04 +00:00
Markus Trippelsdorf a292245ee8 Avoid name lookup warning
/home/markus/gcc/gcc/tree.c: In function ‘void inchash::add_expr(const_tree, inchash::hash&, unsigned int)’:
/home/markus/gcc/gcc/tree.c:8013:11: warning: name lookup of ‘i’ changed
      for (i = TREE_OPERAND_LENGTH (t) - 1; i >= 0; --i)
           ^
/home/markus/gcc/gcc/tree.c:7773:7: warning:   matches this ‘i’ under ISO standard rules
   int i;
       ^
/home/markus/gcc/gcc/tree.c:7869:16: warning:   matches this ‘i’ under old rules
       for (int i = 0; i < TREE_VEC_LENGTH (t); ++i)
                ^

From-SVN: r246519
2017-03-28 05:47:13 +00:00
Jeff Law 4dbf1eeeb6 Fix PR# in last commit
From-SVN: r246518
2017-03-27 21:30:35 -06:00
Jeff Law 865169874b re PR target/80162 (ICE on invalid code (address of register variable))
PR tree-optimization/80162
	* tree-ssa-dom.c (derive_equivalences_from_bit_ior): Fix typo in
	function name.  Limit recursion depth.
	(record_temporary_equivalences): Corresponding changes.

	PR tree-optimization/80162
	* gcc.c-torture/compile/pr80216.c: New test.

From-SVN: r246517
2017-03-27 21:22:25 -06:00
Jonathan Wakely 7810f87a47 Restructure -Wno-narrowing documentation
* doc/invoke.texi (-Wno-narrowing): Reorder so default behavior is
	covered first.

From-SVN: r246513
2017-03-27 23:00:45 +01:00
Jakub Jelinek aade772d8a re PR target/80102 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2330)
PR target/80102
	* reg-notes.def (REG_CFA_NOTE): Define.  Use it for CFA related
	notes.
	* cfgcleanup.c (reg_note_cfa_p): New array.
	(insns_have_identical_cfa_notes): New function.
	(old_insns_match_p): Don't cross-jump in between /f
	and non-/f instructions.  If both i1 and i2 are frame related,
	verify all CFA notes, their order and content.

	* g++.dg/opt/pr80102.C: New test.

From-SVN: r246511
2017-03-27 23:00:35 +02:00
Michael Meissner d89f355e2d re PR target/78543 (ICE in push_reload, at reload.c:1349 on powerpc64le-linux-gnu)
[gcc]
2017-03-27  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/78543
	* config/rs6000/rs6000.md (bswaphi2_extenddi): Combine bswap
	HImode and SImode with zero extend to DImode to one insn.
	(bswap<mode>2_extenddi): Likewise.
	(bswapsi2_extenddi): Likewise.
	(bswaphi2_extendsi): Likewise.
	(bswaphi2): Combine bswap HImode and SImode into one insn.
	Separate memory insns from swapping register.
	(bswapsi2): Likewise.
	(bswap<mode>2): Likewise.
	(bswaphi2_internal): Delete, no longer used.
	(bswapsi2_internal): Likewise.
	(bswap<mode>2_load): Split bswap HImode/SImode into separate load,
	store, and gpr<-gpr swap insns.
	(bswap<mode>2_store): Likewise.
	(bswaphi2_reg): Register only splitter, combine with the splitter.
	(bswaphi2 splitter): Likewise.
	(bswapsi2_reg): Likewise.
	(bswapsi2 splitter): Likewise.
	(bswapdi2): If we have the LDBRX and STDBRX instructions, split
	the insns into load, store, and register/register insns.
	(bswapdi2_ldbrx): Likewise.
	(bswapdi2_load): Likewise.
	(bswapdi2_store): Likewise.
	(bswapdi2_reg): Likewise.

[gcc/testsuite]
2017-03-27  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/78543
	* gcc.target/powerpc/pr78543.c: New test.

From-SVN: r246508
2017-03-27 19:19:00 +00:00
Gunther Nikl 34c66326b3 system.h (HAVE_DESIGNATED_INITIALIZERS): Fix non C++ case.
* system.h (HAVE_DESIGNATED_INITIALIZERS): Fix non C++ case.
	(HAVE_DESIGNATED_UNION_INITIALIZERS): Likewise.

From-SVN: r246506
2017-03-27 11:53:35 -06:00
Kelvin Nilsen 79c4d73bdd re PR target/80103 (ICE in output_1144, at config/rs6000/vsx.md:2298)
gcc/testsuite/ChangeLog:

2017-03-27  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80103
	* gcc.target/powerpc/pr80103-1.c: New test.

gcc/ChangeLog:

2017-03-27  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80103
	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Edit and
	add comments.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Add
	special handling for target option conflicts between dform
	options (-mpower9-dform, -mpower9-dform-vector,
	-mpower9-dform-scalar) and -mno-direct-move.

From-SVN: r246505
2017-03-27 17:04:07 +00:00
Richard Biener 819df78156 re PR tree-optimization/80181 (ICE in set_lattice_value, at tree-ssa-ccp.c:505)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80181
	* tree-ssa-ccp.c (likely_value): UNDEFINED ^ X is UNDEFINED.

	* gcc.dg/torture/pr80181.c: New testcase.

From-SVN: r246500
2017-03-27 12:52:13 +00:00
Claudiu Zissulescu e5dcff3eb5 [ARC] Fix move_double_src_operand predicate.
Durring compilation process, (subreg (mem ...) ...) can occur. Hence,
we need to check if the address of mem is a valid one. This patch is
fixing this check by directly calling the address_operand, instead of
calling move_double_src_operand, as the latter is always checking
against the original mode, thus, returning false when the inner and
outer modes are different.

gcc/
2017-03-27  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/predicates.md (move_double_src_operand): Replace the
	call to move_double_src_operand with a call to address_operand.

From-SVN: r246499
2017-03-27 12:56:46 +02:00
Claudiu Zissulescu 81b98ef769 [ARC] Disable TP register when building for bare metal.
gcc/
2017-03-27  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/elf.h (ARGET_ARC_TP_REGNO_DEFAULT): Define.
	* config/arc/linux.h (ARGET_ARC_TP_REGNO_DEFAULT): Likewise.
	* config/arc/arc.opt (mtp-regno): Use ARGET_ARC_TP_REGNO_DEFAULT.

From-SVN: r246497
2017-03-27 12:56:24 +02:00
Claudiu Zissulescu ac25518506 [ARC] Fix detection of long immediate for load/store operands.
ARC can use scaled offsets when loading (i.e. ld.as rA,[base,
offset]).  Where base and offset can be a register or an immediate
operand.  The scaling only applies on the offset part of the
instruction.  The compiler can accept an address like this:

(plus:SI (mult:SI (reg:SI 2 r2 [orig:596 _2129 ] [596])
	          (const_int 4 [0x4]))
	 (const_int 60 [0x3c]))

Hence, to emit this instruction we place the (const_int 60) into base
and the register into offset to take advantage of the scaled offset
facility of the load instruction.  As a result the length of the load
instruction is 8 bytes.  However, the long_immediate_loadstore_operand
predicate used for calculating the length attribute doesn't recognize
this address and returns a wrong decision leading to a wrong length
computation for a load instruction using the above address.

gcc/
2017-03-27  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/predicates.md (long_immediate_loadstore_operand):
	Consider scaled addresses cases.

From-SVN: r246496
2017-03-27 12:56:14 +02:00
Claudiu Zissulescu 84804c5b47 [ARC] Save/restore blink when in ISR.
gcc/
2017-03-27  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_epilogue_uses): BLINK should be also
	restored when in interrupt.
	* config/arc/arc.md (simple_return): ARCv2 rtie instruction
	doesn't have delay slot.

2017-03-27  Claudiu Zissulescu  <claziss@synopsys.com>

	* testsuite/gcc.target/arc/interrupt-4.c: New file.

From-SVN: r246495
2017-03-27 12:56:04 +02:00
Richard Biener c5e5f5f642 re PR ipa/79776 (ICE on valid code in insert_vi_for_tree, at tree-ssa-structalias.c:2807)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR ipa/79776
	* tree-ssa-structalias.c (associate_varinfo_to_alias): Skip
	inlined thunk clones.

	* g++.dg/ipa/pr79776.C: New testcase.

From-SVN: r246494
2017-03-27 10:50:55 +00:00
Jakub Jelinek 7cd200f63f re PR sanitizer/80168 (ICE in make_decl_rtl, at varasm.c:1311 w/ VLA and -fsanitize=address)
PR sanitizer/80168
	* asan.c (instrument_derefs): Copy over last operand from
	original COMPONENT_REF to the new COMPONENT_REF with
	DECL_BIT_FIELD_REPRESENTATIVE.
	* ubsan.c (instrument_object_size): Likewise.

	* gcc.dg/asan/pr80168.c: New test.

From-SVN: r246492
2017-03-27 10:25:01 +02:00
Richard Biener 79f512ffeb re PR tree-optimization/80170 (SLP vectorization creates aligned access)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80170
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Make
	sure DR/SCEV didnt fold in constants we do not see when looking
	at the reference base alignment.

	* gcc.dg/pr80170.c: New testcase.

From-SVN: r246491
2017-03-27 08:07:49 +00:00
Richard Biener 672d9f8eab re PR tree-optimization/80171 (ICE (Segmentation fault) with optimization)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/80171
	* gimple-fold.c (fold_ctor_reference): Properly guard against
	NULL return value from canonicalize_constructor_val.

	* g++.dg/torture/pr80171.C: New testcase.

From-SVN: r246490
2017-03-27 07:35:44 +00:00
Uros Bizjak 59ba44930f re PR target/80180 (Incorrect codegen from rdseed intrinsic use (CVE-2017-11671))
PR target/80180
	* config/i386/i386.c (ix86_expand_builtin)
	<IX86_BUILTIN_RDSEED{16,32,64}_STEP>: Do not expand arg0 between
	flags reg setting and flags reg using instructions.
	<IX86_BUILTIN_RDRAND{16,32,64}_STEP>: Ditto.  Use non-flags reg
	clobbering instructions to zero extend op2.

From-SVN: r246475
2017-03-25 17:34:09 +01:00
Gerald Pfeifer 7d437dc1a2 install.texi (Configuration): Update link to AIX ld.
* doc/install.texi (Configuration) <--with-aix-soname>:
	Update link to AIX ld.

From-SVN: r246474
2017-03-25 14:17:55 +00:00
Bernd Schmidt 5da906ca43 re PR target/80160 (operand has impossible constraints)
PR rtl-optimization/80160
	PR rtl-optimization/80159
	* lra-assigns.c (must_not_spill_p): Tighten new test to also take
	reg_alternate_class into account.

	* gcc.target/i386/pr80160.c: New test.

From-SVN: r246473
2017-03-25 01:12:04 +00:00
Vladimir Makarov fdcfea63c6 re PR target/80148 (operand has impossible constraints)
2017-03-24  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/80148
	* lra-assigns.c (assign_by_spills): Add spilled non-reload pseudos
	to consider in curr_insn_transform.

From-SVN: r246467
2017-03-24 18:47:38 +00:00
Jakub Jelinek c4d5ab5d09 genrecog.c (validate_pattern): Add VEC_SELECT validation.
* genrecog.c (validate_pattern): Add VEC_SELECT validation.
	* genmodes.c (emit_min_insn_modes_c): Call emit_mode_nunits
	and emit_mode_inner.

From-SVN: r246460
2017-03-24 15:09:33 +01:00
Andreas Krebbel 76794c5221 S/390: arch12: New builtins.
This patch implements a set of low-level builtins for instruction
which would otherwise not be emitted by the compiler plus a set of
high-level builtins as defined by the IBM XL compiler.  The high-level
builtins will be described in a future revision of the z/OS XL C/C++
Programming Guide.

I'll try to come up with a documentation appropriate for the GCC
manual as well (sometimes in the future).

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390-builtins.def: Add VXE builtins.  Add a flags
	argument to the overloaded builtin variants.  Use the new flag to
	deprecate certain builtin variants.
	* config/s390/s390-builtin-types.def: Add new builtin types.
	* config/s390/s390-builtins.h: Support new flags field for
	overloaded builtins.
	* config/s390/s390-c.c (OB_DEF_VAR): New flags field.
	(s390_macro_to_expand): Enable vector float data type.
	(s390_cpu_cpp_builtins_internal): Indicate support of the new
	builtins by incrementing the __VEC__ version number.
	(s390_expand_overloaded_builtin): Support expansion of vec_xl and
	vec_xst.
	(s390_resolve_overloaded_builtin): Emit error messages depending
	on the builtin flags.
	* config/s390/s390.c (s390_expand_builtin): Support additional
	flags argument.  Change error message to match the messages
	emitted in s390-c.c.
	* config/s390/s390.md: New UNSPEC_* constants.
	(op_type): Add new instruction types.
	* config/s390/vecintrin.h: Add new builtins and test data class
	constants.
	* config/s390/vx-builtins.md (V_HW_32_64): Add V4SF.
	(V_HW_4, VEC_HW, VECF_HW): New mode iterators.
	(VEC_INEXACT, VEC_NOINEXACT): New constants.
	("vec_splats<mode>", "vec_insert<mode>", "vec_promote<mode>")
	("vec_insert_and_zero<mode>", "vec_mergeh<mode>")
	("vec_mergel<mode>"): V_HW -> VEC_HW.

	("vlrlrv16qi", "vstrlrv16qi", "vbpermv16qi", "vec_msumv2di")
	("vmslg", "*vftci<mode>_cconly", "vftci<mode>_intcconly")
	("*vftci<mode>", "vftci<mode>_intcc", "vec_double_s64")
	("vec_double_u64", "vfmin<mode>", "vfmax<mode>"): New definition.

	("and_av2df3", "and_cv2df3", "vec_andc_av2df3")
	("vec_andc_cv2df3", "xor_av2df3", "xor_cv2df3", "vec_nor_av2df3")
	("vec_nor_cv2df3", "ior_av2df3", "ior_cv2df3", "vec_nabs")
	("*vftcidb", "*vftcidb_cconly", "vftcidb"): Remove definition.

	("vec_all_<fpcmpcc:code>v2df", "vec_any_<fpcmpcc:code>v2df")
	("vec_scatter_elementv4si_DI", "vec_cmp<fpcmp:code>v2df")
	("vec_di_to_df_s64", "vec_di_to_df_u64", "vec_df_to_di_u64")
	("vfidb", "*vldeb", "*vledb", "*vec_cmp<insn_cmp>v2df_cconly")
	("vec_cmpeqv2df_cc", "vec_cmpeqv2df_cc", "vec_cmphv2df_cc")
	("vec_cmphev2df_cc", "*vec_cmpeqv2df_cc")
	("*vec_cmphv2df_cc", "*vec_cmphev2df_cc"): Enable new modes as ...

	("vec_all_<fpcmpcc:code><mode>", "vec_any_<fpcmpcc:code><mode>")
	("vec_scatter_element<V_HW_4:mode>_DI")
	("vec_cmp<fpcmp:code><mode>", "vcdgb", "vcdlgb", "vclgdb")
	("vec_fpint<mode>", "vflls")
	("vflrd", "*vec_cmp<insn_cmp><mode>_cconly", "vec_cmpeq<mode>_cc")
	("vec_cmpeq<mode>_cc", "vec_cmph<mode>_cc", "vec_cmphe<mode>_cc")
	("*vec_cmpeq<mode>_cc", "*vec_cmph<mode>_cc")
	("*vec_cmphe<mode>_cc"): ... these.

	("vec_ctd_s64", "vec_ctsl", "vec_ctul", "vec_st2f"): Use rounding
	mode constant instead of magic value.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/target-attribute/tattr-3.c: Adjust error message
	and remove the high-level builtin.  The error message for the
	would prevent compilation from reaching the second.
	* gcc.target/s390/target-attribute/tattr-4.c: Likewise.

From-SVN: r246459
2017-03-24 14:04:12 +00:00
Andreas Krebbel 2de2b3f93b S/390: arch12: Support new vector floating point modes.
This patch adds support for the new floating point vector elements (SF
and TF) introduced with arch12.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_expand_vec_compare): Support other
	vector floating point modes than just V2DF.
	(s390_expand_vcond): Likewise.
	(s390_hard_regno_mode_ok): Allow SFmode values in VRs.
	(s390_cannot_change_mode_class): Prevent mode changes between TF
	and V1TF in vector registers.
	* config/s390/s390.md (DF, SF): New mode attributes.
	("*cmp<mode>_ccs", "add<mode>3", "sub<mode>3", "mul<mode>3")
	("fma<mode>4", "fms<mode>4", "div<mode>3", "*neg<mode>2"): Add
	SFmode support for VRs.
	* config/s390/vector.md (V_HW, V_HW2, VT_HW, ti*, nonvec): Add new
	vector fp modes.
	(VFT, VF_HW): New mode iterators.
	(vw, sdx): New mode attributes.
	("addv2df3", "subv2df3", "mulv2df3", "divv2df3", "sqrtv2df2")
	("fmav2df4","fmsv2df4", "negv2df2", "absv2df2", "*negabsv2df2")
	("smaxv2df3", "sminv2df3", "*vec_cmp<VFCMP_HW_OP:code>v2df_nocc")
	("vec_cmpuneqv2df", "vec_cmpltgtv2df", "vec_orderedv2df")
	("vec_unorderedv2df"): Adjust the v2df only patterns to support
	also the new vector floating point modes.  Renaming to ...

	("add<mode>3", "sub<mode>3", "mul<mode>3", "div<mode>3")
	("sqrt<mode>2", "fma<mode>4", "fms<mode>4", "neg<mode>2")
	("abs<mode>2", "negabs<mode>2", "smax<mode>3")
	("smin<mode>3", "*vec_cmp<VFCMP_HW_OP:code><mode>_nocc")
	("vec_cmpuneq<mode>", "vec_cmpltgt<mode>", "vec_ordered<mode>")
	("vec_unordered<mode>"): ... these.

	("neg_fma<mode>4", "neg_fms<mode>4", "*smax<mode>3_vxe")
	("*smin<mode>3_vxe", "*sminv2df3_vx", "*vec_extendv4sf")
	("*vec_extendv2df"): New insn definitions.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vxe/negfma-1.c: New test.

From-SVN: r246458
2017-03-24 14:03:24 +00:00
Andreas Krebbel 7d2fd07577 S/390: arch12: Support the mul/add/subtract
instructions.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md ("*adddi3_sign", "*subdi3_sign", "mulditi3")
	("mulditi3_2", "*muldi3_sign"): New patterns.
	("muldi3", "*muldi3", "mulsi3", "*mulsi3"): Add an expander and
	rename the pattern definition.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/arch12/aghsghmgh-1.c: New test.
	* gcc.target/s390/arch12/mul-1.c: New test.
	* gcc.target/s390/arch12/mul-2.c: New test.

From-SVN: r246457
2017-03-24 14:02:51 +00:00
Andreas Krebbel 2841f55067 S/390: arch12: Add indirect branch pattern
This adds support for the branch indirect instruction.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md ("indirect_jump"): Turn insn definition into
	expander.
	("*indirect_jump", "*indirect2_jump"): New pattern definitions.

From-SVN: r246456
2017-03-24 14:02:17 +00:00
Andreas Krebbel 72612e4e9e S/390: arch12: Add vllezlf instruction.
This adds support for the vector load element and zero instruction and
makes sure it is used when initializing vectors with elements while
setting the rest to 0.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_expand_vec_init): Use vllezl
	instruction if possible.
	* config/s390/vector.md (vec_halfnumelts): New mode
	attribute.
	("*vec_vllezlf<mode>"): New pattern.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vxe/vllezlf-1.c: New test.

From-SVN: r246455
2017-03-24 14:01:54 +00:00
Andreas Krebbel 6c7774d15e S/390: arch12: New vector popcount variants
arch12 provides pop count vector instructions for bigger elements than
just chars.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vxe/popcount-1.c: New test.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/vector.md ("popcountv16qi2", "popcountv8hi2")
	("popcountv4si2", "popcountv2di2"): Rename to ...
	("popcount<mode>2", "popcountv8hi2_vx", "popcountv4si2_vx")
	("popcountv2di2_vx"): ... these and add !TARGET_VXE to the
	condition.
	("popcount<mode>2_vxe"): New pattern.

From-SVN: r246454
2017-03-24 14:01:18 +00:00
Andreas Krebbel 6654e96fc8 S/390: arch12: Add arch12 option.
This patch covers the mechanical work of making the new architecture
option arch12 available wherever it will be needed later.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/s390.exp: Run tests in arch12 and vxe dirs.
	* lib/target-supports.exp: Add effective target check s390_vxe.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* common/config/s390/s390-common.c (processor_flags_table): Add
	arch12.
	* config.gcc: Add arch12.
	* config/s390/driver-native.c (s390_host_detect_local_cpu):
	Default to arch12 for unknown CPU model numbers.
	* config/s390/s390-builtins.def: Add B_VXE builtin flag.
	* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Adjust
	PROCESSOR_max sanity check.
	* config/s390/s390-opts.h (enum processor_type): Add
	PROCESSOR_ARCH12.
	* config/s390/s390.c (processor_table): Add arch12.
	(s390_expand_builtin): Add check for B_VXE flag.
	(s390_issue_rate): Add PROCESSOR_ARCH12.
	(s390_get_sched_attrmask): Likewise.
	(s390_get_unit_mask): Likewise.
	(s390_sched_score): Enable z13 scheduling for arch12.
	(s390_sched_reorder): Likewise.
	(s390_sched_variable_issue): Likewise.
	* config/s390/s390.h (enum processor_flags): Add PF_ARCH12 and
	PF_VXE.
	(s390_tune_attr): Use z13 scheduling also for arch12.
	(TARGET_CPU_ARCH12, TARGET_CPU_ARCH12_P, TARGET_CPU_VXE)
	(TARGET_CPU_VXE_P, TARGET_ARCH12, TARGET_ARCH12_P, TARGET_VXE)
	(TARGET_VXE_P): New macros.
	* config/s390/s390.md: Add arch12 to cpu attribute.  Add arch12
	and vxe to cpu_facility.  Add arch12 and vxe to enabled attribute.
	* config/s390/s390.opt: Add arch12 as processor_type.

From-SVN: r246452
2017-03-24 13:59:51 +00:00
Andreas Krebbel 9751ad6e9b S/390: Rearrange fixuns_trunc pattern definitions.
This reworks the fixuns_trunc* patterns a bit which got quite confusing
after adding z13 support.  Now we just have a single RTL standard name
expander definition ("fixuns_trunc<FP:mode><GPR:mode>2") which then
multiplexes to either the emulation variants *_emu or the hardware
implementations.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md
	("fixuns_truncdddi2", "fixuns_trunctddi2")
	("fixuns_trunc<BFP:mode><GPR:mode>2"): Merge into ...
	("fixuns_trunc<FP:mode><GPR:mode>2"): New expander.

	("fixuns_trunc<BFP:mode><GPR:mode>2", "fixuns_trunc<mode>si2"):
	Rename expanders to ...

	("fixuns_trunc<BFP:mode><GPR:mode>2_emu")
	("fixuns_truncdddi2_emu"): ... these.

	("fixuns_trunc<mode>si2_emu"): New expander.

	("*fixuns_truncdfdi2_z13"): Rename to ...
	("*fixuns_truncdfdi2_vx"): ... this.

From-SVN: r246451
2017-03-24 13:59:13 +00:00
Andreas Krebbel 77c585ca57 S/390: Use wfc for scalar vector compares
The z13 vector support used the vector style comparison instructions
also for the scalar compares in vector registers.  However, it is much
more convenient to just use the compare scalar instruction for that
purpose.  The advantage is that this instruction generates a CC result
as our compares usually do.  So this results in quite some code to be
removed from the backend.

Regression tested on s390x.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/2964.md: Remove the single element vector compare
	instructions which are no longer used.
	* config/s390/s390.c (s390_select_ccmode): Remove handling of
	vector CCmodes.
	(s390_canonicalize_comparison): Remove handling of DFmode
	compares.
	(s390_expand_vec_compare_scalar): Remove function.
	(s390_emit_compare): Don't call s390_expand_vec_compare_scalar.
	* config/s390/s390.md ("*vec_cmp<insn_cmp>df_cconly"): Remove
	pattern.
	("*cmp<mode>_ccs"): Add wfcdb instruction.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vector/vec-scalar-cmp-1.c: Adjust for the
	comparison instructions used from now on.

From-SVN: r246450
2017-03-24 13:58:41 +00:00
Andreas Krebbel 590961cff2 S/390: movdf improvements
This patch add the vector load element from immediate instruction to the
movdf/dd pattern for loading a FP zero and it removes the vector
instructions from the mov<mode>_64 pattern. These were pointless in
there because z13 support implies DFP support so these instructions will
always be matched in the mov<mode>_64dfp pattern instead.

Regression tested on s390x

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md ("mov<mode>_64dfp" DD_DF): Use vleig for loading a
	FP zero.
	("*mov<mode>_64" DD_DF): Remove the vector instructions. These
	will anyway by matched by mov<mode>_64dfp.

From-SVN: r246448
2017-03-24 13:57:19 +00:00
Andreas Krebbel 298f464762 S/390: movsf/sd pattern fixes.
The SD/SFmode move pattern used a wrong mnemonic for vector load
element.
On the vector load element instruction was an operand missing.

Regression tested on s390x.

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md ("mov<mode>" SD_SF): Change vleg/vsteg to
	vlef/vstef.  Add missing operand to vleif.

From-SVN: r246447
2017-03-24 13:55:41 +00:00
Andreas Krebbel a602f98516 S/390: vec_init improvements
This enables the vec_init pattern also for V4SF, V1TI, and V1TF.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vector/vec-init-2.c: New test.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_expand_vec_init): Enable vector load
	pair for all vector types with 64 bit elements.
	* config/s390/vx-builtins.md (V_HW_64): Move mode iterator to ...
	* config/s390/vector.md (V_HW_64): ... here.
	(V_128_NOSINGLE): New mode iterator.
	("vec_init<V_HW:mode>"): Use V_128 as mode iterator.
	("*vec_splat<mode>"): Use V_128_NOSINGLE mode iterator.
	("*vec_tf_to_v1tf", "*vec_ti_to_v1ti"): New pattern definitions.
	("*vec_load_pairv2di"): Change to ...
	("*vec_load_pair<mode>"): ... this one.

From-SVN: r246446
2017-03-24 13:54:23 +00:00
Andreas Krebbel 9d605427fa S/390: Improve support of 128 bit vectors in GPRs
This patch improves the handling of 128 bit vectors residing in GPRs
by adding more alternatives to the move pattern.

Regression tested on s390x.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/constraints.md: Add comments.
	(jKK): Reject element sizes > 8 bytes.
	* config/s390/s390.c (s390_split_ok_p): Enable splitting also for
	s_operands.
	* config/s390/s390.md: Add the s_operand checks formerly in
	s390_split_ok_p to various splitters where they are still
	required.
	* config/s390/vector.md ("mov<mode>" V_128): Add GPR alternatives
	for 128 bit vectors.  Plus two splitters.

From-SVN: r246445
2017-03-24 13:53:43 +00:00
Andreas Krebbel 285363a1be S/390: Rename cpu facility vec to vx.
gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md: Rename the cpu facilty vec to vx throughout
	the file.

From-SVN: r246444
2017-03-24 13:53:08 +00:00
Andreas Krebbel dc4f29bc9a S/390: PR79893: Add diagnostics vec_load_bndry builtin.
The boundary argument of the vec_load_bndry builtin needs to be
rewritten.  At that point it must be constant already.  The current
diagnostics in s390_expand_builtins is too late for this.  The patch
adds an additional check for that builtin which will be triggered
already during preprocessing.

Regression tested on s390x.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79893
	* gcc.target/s390/zvector/pr79893.c: New test.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79893
	* config/s390/s390-c.c (s390_adjust_builtin_arglist): Issue an
	error if the boundary argument is not constant.

From-SVN: r246442
2017-03-24 13:51:32 +00:00