diff options
97 files changed, 2820 insertions, 1485 deletions
diff --git a/contrib/gcc_update b/contrib/gcc_update index 43d284d..45a27b7 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -89,6 +89,7 @@ gcc/config/c6x/c6x-mult.md: gcc/config/c6x/c6x-mult.md.in gcc/config/c6x/genmult gcc/config/m68k/m68k-tables.opt: gcc/config/m68k/m68k-devices.def gcc/config/m68k/m68k-isas.def gcc/config/m68k/m68k-microarchs.def gcc/config/m68k/genopt.sh gcc/config/mips/mips-tables.opt: gcc/config/mips/mips-cpus.def gcc/config/mips/genopt.sh gcc/config/rs6000/rs6000-tables.opt: gcc/config/rs6000/rs6000-cpus.def gcc/config/rs6000/genopt.sh +gcc/config/rs6000/fusion.md: gcc/config/rs6000/genfusion.pl gcc/config/tilegx/mul-tables.c: gcc/config/tilepro/gen-mul-tables.cc gcc/config/tilepro/mul-tables.c: gcc/config/tilepro/gen-mul-tables.cc # And then, language-specific files diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 98453b0..fc67dd4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,98 @@ +2021-02-02 Richard Biener <rguenther@suse.de> + + * gimple-loop-interchange.cc (prepare_data_references): + Release vectors. + * gimple-loop-jam.c (tree_loop_unroll_and_jam): Likewise. + * tree-ssa-loop-im.c (hoist_memory_references): Likewise. + * tree-vect-stmts.c (vectorizable_condition): Do not + allocate vectors. + (vectorizable_comparison): Likewise. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64-simd-builtins.def (ursqrte): Define builtin. + * config/aarch64/aarch64-simd.md (aarch64_ursqrte<mode>): New pattern. + * config/aarch64/arm_neon.h (vrsqrte_u32): Reimplement using builtin. + (vrsqrteq_u32): Likewise. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64-simd-builtins.def (sqxtun2): Define builtin. + * config/aarch64/aarch64-simd.md (aarch64_sqxtun2<mode>_le): Define. + (aarch64_sqxtun2<mode>_be): Likewise. + (aarch64_sqxtun2<mode>): Likewise. + * config/aarch64/arm_neon.h (vqmovun_high_s16): Reimplement using builtin. + (vqmovun_high_s32): Likewise. + (vqmovun_high_s64): Likewise. + * config/aarch64/iterators.md (UNSPEC_SQXTUN2): Define. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64-simd-builtins.def (bfdot_lane, bfdot_laneq): Use + AUTO_FP flags. + (bfmlalb_lane, bfmlalt_lane, bfmlalb_lane_q, bfmlalt_lane_q): Use FP flags. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64-simd-builtins.def (fcmla_lane0, fcmla_lane90, + fcmla_lane180, fcmla_lane270, fcmlaq_lane0, fcmlaq_lane90, fcmlaq_lane180, + fcmlaq_lane270, scvtf, ucvtf, fcvtzs, fcvtzu, scvtfsi, scvtfdi, ucvtfsi, + ucvtfdi, fcvtzshf, fcvtzuhf, fmlal_lane_low, fmlsl_lane_low, + fmlal_laneq_low, fmlsl_laneq_low, fmlalq_lane_low, fmlslq_lane_low, + fmlalq_laneq_low, fmlslq_laneq_low, fmlal_lane_high, fmlsl_lane_high, + fmlal_laneq_high, fmlsl_laneq_high, fmlalq_lane_high, fmlslq_lane_high, + fmlalq_laneq_high, fmlslq_laneq_high): Use FP flags. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64-builtins.c (FLAG_LOAD): Define. + * config/aarch64/aarch64-simd-builtins.def (ld1x2, ld2, ld3, ld4, ld2r, + ld3r, ld4r, ld1, ld1x3, ld1x4): Use LOAD flags. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64-simd-builtins.def (combine, zip1, zip2, + uzp1, uzp2, trn1, trn2, simd_bsl): Use AUTO_FP flags. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64-simd-builtins.def (clrsb, clz, ctz, popcount, + vec_smult_lane_, vec_smlal_lane_, vec_smult_laneq_, vec_smlal_laneq_, + vec_umult_lane_, vec_umlal_lane_, vec_umult_laneq_, vec_umlal_laneq_, + ashl, sshl, ushl, srshl, urshl, sdot_lane, udot_lane, sdot_laneq, + udot_laneq, usdot_lane, usdot_laneq, sudot_lane, sudot_laneq, ashr, + ashr_simd, lshr, lshr_simd, srshr_n, urshr_n, ssra_n, usra_n, srsra_n, + ursra_n, sshll_n, ushll_n, sshll2_n, ushll2_n, ssri_n, usri_n, ssli_n, + ssli_n, usli_n, bswap, rbit, simd_bsl, eor3q, rax1q, xarq, bcaxq): Use + NONE builtin flags. + +2021-02-02 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/98848 + * tree-vect-patterns.c (vect_recog_over_widening_pattern): Punt if + STMT_VINFO_DEF_TYPE (last_stmt_info) is vect_reduction_def. + +2021-02-02 Kito Cheng <kito.cheng@sifive.com> + + PR target/98743 + * expr.c: Check mode before calling store_expr. + +2021-02-02 Christophe Lyon <christophe.lyon@linaro.org> + + * config/arm/iterators.md (supf): Remove VORNQ_S and VORNQ_U. + (VORNQ): Remove. + * config/arm/mve.md (mve_vornq_s<mode>): New entry for vorn + instruction using expression ior. + (mve_vornq_u<mode>): New expander. + (mve_vornq_f<mode>): Use ior code instead of unspec. + * config/arm/unspecs.md (VORNQ_S, VORNQ_U, VORNQ_F): Remove. + +2021-02-02 Alexandre Oliva <oliva@adacore.com> + + * tree-nested.c (convert_nonlocal_reference_op): Move + current_function_decl restore after re-gimplification. + (convert_local_reference_op): Likewise. + 2021-02-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/aarch64/aarch64-simd-builtins.def (rshrn, rshrn2): diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 43c7f94..465eb04 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20210202 +20210203 diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 5ea1b16..aea191c 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -2197,14 +2197,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) } else { + /* We make the fields addressable for the sake of compatibility + with languages for which the regular fields are addressable. */ tem = create_field_decl (get_identifier ("P_ARRAY"), ptr_type_node, gnu_fat_type, - NULL_TREE, NULL_TREE, 0, 0); + NULL_TREE, NULL_TREE, 0, 1); DECL_CHAIN (tem) = create_field_decl (get_identifier ("P_BOUNDS"), gnu_ptr_template, gnu_fat_type, - NULL_TREE, NULL_TREE, 0, 0); + NULL_TREE, NULL_TREE, 0, 1); finish_fat_pointer_type (gnu_fat_type, tem); SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_type); } @@ -2327,7 +2329,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) finish_record_type (gnu_template_type, gnu_template_fields, 0, debug_info_p); TYPE_CONTEXT (gnu_template_type) = current_function_decl; - TYPE_READONLY (gnu_template_type) = 1; /* If Component_Size is not already specified, annotate it with the size of the component. */ @@ -3054,15 +3055,24 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) || type_annotate_only); } - /* Make a node for the record. If we are not defining the record, - suppress expanding incomplete types. */ + /* Make a node for the record type. */ gnu_type = make_node (tree_code_for_record_type (gnat_entity)); TYPE_NAME (gnu_type) = gnu_entity_name; TYPE_PACKED (gnu_type) = (packed != 0) || has_align || has_rep; TYPE_REVERSE_STORAGE_ORDER (gnu_type) = Reverse_Storage_Order (gnat_entity); + + /* If the record type has discriminants, pointers to it may also point + to constrained subtypes of it, so mark it as may_alias for LTO. */ + if (has_discr) + prepend_one_attribute + (&attr_list, ATTR_MACHINE_ATTRIBUTE, + get_identifier ("may_alias"), NULL_TREE, + gnat_entity); + process_attributes (&gnu_type, &attr_list, true, gnat_entity); + /* If we are not defining it, suppress expanding incomplete types. */ if (!definition) { defer_incomplete_level++; @@ -8320,12 +8330,12 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, if (p_gnu_rep_list && gnu_rep_list) *p_gnu_rep_list = chainon (*p_gnu_rep_list, gnu_rep_list); - /* Deal with the annoying case of an extension of a record with variable size - and partial rep clause, for which the _Parent field is forced at offset 0 - and has variable size, which we do not support below. Note that we cannot - do it if the field has fixed size because we rely on the presence of the - REP part built below to trigger the reordering of the fields in a derived - record type when all the fields have a fixed position. */ + /* Deal with the case of an extension of a record type with variable size and + partial rep clause, for which the _Parent field is forced at offset 0 and + has variable size. Note that we cannot do it if the field has fixed size + because we rely on the presence of the REP part built below to trigger the + reordering of the fields in a derived record type when all the fields have + a fixed position. */ else if (gnu_rep_list && !DECL_CHAIN (gnu_rep_list) && TREE_CODE (DECL_SIZE (gnu_rep_list)) != INTEGER_CST @@ -8343,33 +8353,52 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, record, before the others, if we also have fields without rep clause. */ else if (gnu_rep_list) { - tree gnu_rep_type, gnu_rep_part; - int i, len = list_length (gnu_rep_list); - tree *gnu_arr = XALLOCAVEC (tree, len); + tree gnu_parent, gnu_rep_type; /* If all the fields have a rep clause, we can do a flat layout. */ layout_with_rep = !gnu_field_list && (!gnu_variant_part || variants_have_rep); + + /* Same as above but the extension itself has a rep clause, in which case + we need to set aside the _Parent field to lay out the REP part. */ + if (TREE_CODE (DECL_SIZE (gnu_rep_list)) != INTEGER_CST + && !layout_with_rep + && !variants_have_rep + && first_free_pos + && integer_zerop (first_free_pos) + && integer_zerop (bit_position (gnu_rep_list))) + { + gnu_parent = gnu_rep_list; + gnu_rep_list = DECL_CHAIN (gnu_rep_list); + } + else + gnu_parent = NULL_TREE; + gnu_rep_type = layout_with_rep ? gnu_record_type : make_node (RECORD_TYPE); - for (gnu_field = gnu_rep_list, i = 0; - gnu_field; - gnu_field = DECL_CHAIN (gnu_field), i++) - gnu_arr[i] = gnu_field; + /* Sort the fields in order of increasing bit position. */ + const int len = list_length (gnu_rep_list); + tree *gnu_arr = XALLOCAVEC (tree, len); + + gnu_field = gnu_rep_list; + for (int i = 0; i < len; i++) + { + gnu_arr[i] = gnu_field; + gnu_field = DECL_CHAIN (gnu_field); + } qsort (gnu_arr, len, sizeof (tree), compare_field_bitpos); - /* Put the fields in the list in order of increasing position, which - means we start from the end. */ gnu_rep_list = NULL_TREE; - for (i = len - 1; i >= 0; i--) + for (int i = len - 1; i >= 0; i--) { DECL_CHAIN (gnu_arr[i]) = gnu_rep_list; gnu_rep_list = gnu_arr[i]; DECL_CONTEXT (gnu_arr[i]) = gnu_rep_type; } + /* Do the layout of the REP part, if any. */ if (layout_with_rep) gnu_field_list = gnu_rep_list; else @@ -8378,14 +8407,36 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, = create_concat_name (gnat_record_type, "REP"); TYPE_REVERSE_STORAGE_ORDER (gnu_rep_type) = TYPE_REVERSE_STORAGE_ORDER (gnu_record_type); - finish_record_type (gnu_rep_type, gnu_rep_list, 1, debug_info); + finish_record_type (gnu_rep_type, gnu_rep_list, 1, false); /* If FIRST_FREE_POS is nonzero, we need to ensure that the fields without rep clause are laid out starting from this position. Therefore, we force it as a minimal size on the REP part. */ - gnu_rep_part + tree gnu_rep_part = create_rep_part (gnu_rep_type, gnu_record_type, first_free_pos); + /* If this is an extension, put back the _Parent field as the first + field of the REP part at offset 0 and update its layout. */ + if (gnu_parent) + { + const unsigned int align = DECL_ALIGN (gnu_parent); + DECL_CHAIN (gnu_parent) = TYPE_FIELDS (gnu_rep_type); + TYPE_FIELDS (gnu_rep_type) = gnu_parent; + DECL_CONTEXT (gnu_parent) = gnu_rep_type; + if (align > TYPE_ALIGN (gnu_rep_type)) + { + SET_TYPE_ALIGN (gnu_rep_type, align); + TYPE_SIZE (gnu_rep_type) + = round_up (TYPE_SIZE (gnu_rep_type), align); + TYPE_SIZE_UNIT (gnu_rep_type) + = round_up (TYPE_SIZE_UNIT (gnu_rep_type), align); + SET_DECL_ALIGN (gnu_rep_part, align); + } + } + + if (debug_info) + rest_of_record_type_compilation (gnu_rep_type); + /* Chain the REP part at the beginning of the field list. */ DECL_CHAIN (gnu_rep_part) = gnu_field_list; gnu_field_list = gnu_rep_part; diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index c503bfb..952f032 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -467,6 +467,11 @@ make_dummy_type (Entity_Id gnat_type) = create_type_stub_decl (TYPE_NAME (gnu_type), gnu_type); if (Is_By_Reference_Type (gnat_equiv)) TYPE_BY_REFERENCE_P (gnu_type) = 1; + if (Has_Discriminants (gnat_equiv)) + decl_attributes (&gnu_type, + tree_cons (get_identifier ("may_alias"), NULL_TREE, + NULL_TREE), + ATTR_FLAG_TYPE_IN_PLACE); SET_DUMMY_NODE (gnat_equiv, gnu_type); @@ -516,10 +521,10 @@ build_dummy_unc_pointer_types (Entity_Id gnat_desig_type, tree gnu_desig_type) = create_type_stub_decl (create_concat_name (gnat_desig_type, "XUP"), gnu_fat_type); fields = create_field_decl (get_identifier ("P_ARRAY"), gnu_ptr_array, - gnu_fat_type, NULL_TREE, NULL_TREE, 0, 0); + gnu_fat_type, NULL_TREE, NULL_TREE, 0, 1); DECL_CHAIN (fields) = create_field_decl (get_identifier ("P_BOUNDS"), gnu_ptr_template, - gnu_fat_type, NULL_TREE, NULL_TREE, 0, 0); + gnu_fat_type, NULL_TREE, NULL_TREE, 0, 1); finish_fat_pointer_type (gnu_fat_type, fields); SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_desig_type); /* Suppress debug info until after the type is completed. */ @@ -2046,7 +2051,6 @@ finish_record_type (tree record_type, tree field_list, int rep_level, this_ada_size = this_size; const bool variant_part = (TREE_CODE (type) == QUAL_UNION_TYPE); - const bool variant_part_at_zero = variant_part && integer_zerop (pos); /* Clear DECL_BIT_FIELD for the cases layout_decl does not handle. */ if (DECL_BIT_FIELD (field) @@ -2089,7 +2093,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level, /* Clear DECL_BIT_FIELD_TYPE for a variant part at offset 0, it's simply not supported by the DECL_BIT_FIELD_REPRESENTATIVE machinery because the variant part is always the last field in the list. */ - if (variant_part_at_zero) + if (variant_part && integer_zerop (pos)) DECL_BIT_FIELD_TYPE (field) = NULL_TREE; /* If we still have DECL_BIT_FIELD set at this point, we know that the @@ -2124,18 +2128,20 @@ finish_record_type (tree record_type, tree field_list, int rep_level, case RECORD_TYPE: /* Since we know here that all fields are sorted in order of increasing bit position, the size of the record is one - higher than the ending bit of the last field processed, - unless we have a variant part at offset 0, since in this - case we might have a field outside the variant part that - has a higher ending position; so use a MAX in this case. - Also, if this field is a QUAL_UNION_TYPE, we need to take - into account the previous size in the case of empty variants. */ + higher than the ending bit of the last field processed + unless we have a rep clause, because we might be processing + the REP part of a record with a variant part for which the + variant part has a rep clause but not the fixed part, in + which case this REP part may contain overlapping fields + and thus needs to be treated like a union tyoe above, so + use a MAX in that case. Also, if this field is a variant + part, we need to take into account the previous size in + the case of empty variants. */ ada_size - = merge_sizes (ada_size, pos, this_ada_size, variant_part, - variant_part_at_zero); + = merge_sizes (ada_size, pos, this_ada_size, rep_level > 0, + variant_part); size - = merge_sizes (size, pos, this_size, variant_part, - variant_part_at_zero); + = merge_sizes (size, pos, this_size, rep_level > 0, variant_part); break; default: @@ -2427,14 +2433,14 @@ rest_of_record_type_compilation (tree record_type) } /* Utility function of above to merge LAST_SIZE, the previous size of a record - with FIRST_BIT and SIZE that describe a field. SPECIAL is true if this - represents a QUAL_UNION_TYPE in which case we must look for COND_EXPRs and - replace a value of zero with the old size. If MAX is true, we take the + with FIRST_BIT and SIZE that describe a field. If MAX is true, we take the MAX of the end position of this field with LAST_SIZE. In all other cases, - we use FIRST_BIT plus SIZE. Return an expression for the size. */ + we use FIRST_BIT plus SIZE. SPECIAL is true if it's for a QUAL_UNION_TYPE, + in which case we must look for COND_EXPRs and replace a value of zero with + the old size. Return an expression for the size. */ static tree -merge_sizes (tree last_size, tree first_bit, tree size, bool special, bool max) +merge_sizes (tree last_size, tree first_bit, tree size, bool max, bool special) { tree type = TREE_TYPE (last_size); tree new_size; @@ -2451,11 +2457,11 @@ merge_sizes (tree last_size, tree first_bit, tree size, bool special, bool max) integer_zerop (TREE_OPERAND (size, 1)) ? last_size : merge_sizes (last_size, first_bit, TREE_OPERAND (size, 1), - 1, max), + max, special), integer_zerop (TREE_OPERAND (size, 2)) ? last_size : merge_sizes (last_size, first_bit, TREE_OPERAND (size, 2), - 1, max)); + max, special)); /* We don't need any NON_VALUE_EXPRs and they can confuse us (especially when fed through SUBSTITUTE_IN_EXPR) into thinking that a constant diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index 197df60..f976848 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,16 @@ +2021-02-02 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/93355 + PR analyzer/96374 + * engine.cc (toplevel_function_p): Simplify so that + we only reject functions with a "__analyzer_" prefix. + (add_any_callbacks): Delete. + (exploded_graph::build_initial_worklist): Update for + dropped param of toplevel_function_p. + (exploded_graph::build_initial_worklist): Don't bother + looking for callbacks that are reachable from global + initializers. + 2021-02-01 David Malcolm <dmalcolm@redhat.com> PR analyzer/98918 diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def index 48e481c..b787cb9 100644 --- a/gcc/config/aarch64/aarch64-simd-builtins.def +++ b/gcc/config/aarch64/aarch64-simd-builtins.def @@ -240,6 +240,18 @@ BUILTIN_VQW (TERNOP, smlsl_hi, 0, NONE) BUILTIN_VQW (TERNOPU, umlsl_hi, 0, NONE) + /* Implemented by aarch64_<su>mlsl_hi_n<mode>. */ + BUILTIN_VQ_HSI (TERNOP, smlsl_hi_n, 0, NONE) + BUILTIN_VQ_HSI (TERNOPU, umlsl_hi_n, 0, NONE) + + /* Implemented by aarch64_<su>mlal_hi<mode>. */ + BUILTIN_VQW (TERNOP, smlal_hi, 0, NONE) + BUILTIN_VQW (TERNOPU, umlal_hi, 0, NONE) + + /* Implemented by aarch64_<su>mlal_hi_n<mode>. */ + BUILTIN_VQ_HSI (TERNOP, smlal_hi_n, 0, NONE) + BUILTIN_VQ_HSI (TERNOPU, umlal_hi_n, 0, NONE) + BUILTIN_VSQN_HSDI (UNOPUS, sqmovun, 0, NONE) /* Implemented by aarch64_sqxtun2<mode>. */ @@ -302,6 +314,16 @@ BUILTIN_VD_HSI (QUADOPU_LANE, vec_umlsl_lane_, 0, NONE) BUILTIN_VD_HSI (QUADOPU_LANE, vec_umlsl_laneq_, 0, NONE) + BUILTIN_VQ_HSI (QUADOP_LANE, smlal_hi_lane, 0, NONE) + BUILTIN_VQ_HSI (QUADOP_LANE, smlal_hi_laneq, 0, NONE) + BUILTIN_VQ_HSI (QUADOPU_LANE, umlal_hi_lane, 0, NONE) + BUILTIN_VQ_HSI (QUADOPU_LANE, umlal_hi_laneq, 0, NONE) + + BUILTIN_VQ_HSI (QUADOP_LANE, smlsl_hi_lane, 0, NONE) + BUILTIN_VQ_HSI (QUADOP_LANE, smlsl_hi_laneq, 0, NONE) + BUILTIN_VQ_HSI (QUADOPU_LANE, umlsl_hi_lane, 0, NONE) + BUILTIN_VQ_HSI (QUADOPU_LANE, umlsl_hi_laneq, 0, NONE) + BUILTIN_VSD_HSI (BINOP, sqdmull, 0, NONE) BUILTIN_VSD_HSI (TERNOP_LANE, sqdmull_lane, 0, NONE) BUILTIN_VSD_HSI (TERNOP_LANE, sqdmull_laneq, 0, NONE) diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 767d673..393bab1 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -1976,7 +1976,7 @@ [(set_attr "type" "neon_mla_<Vetype>_long")] ) -(define_insn "*aarch64_<su>mlal_hi<mode>" +(define_insn "aarch64_<su>mlal_hi<mode>_insn" [(set (match_operand:<VWIDE> 0 "register_operand" "=w") (plus:<VWIDE> (mult:<VWIDE> @@ -1992,6 +1992,49 @@ [(set_attr "type" "neon_mla_<Vetype>_long")] ) +(define_expand "aarch64_<su>mlal_hi<mode>" + [(match_operand:<VWIDE> 0 "register_operand") + (match_operand:<VWIDE> 1 "register_operand") + (ANY_EXTEND:<VWIDE>(match_operand:VQW 2 "register_operand")) + (match_operand:VQW 3 "register_operand")] + "TARGET_SIMD" +{ + rtx p = aarch64_simd_vect_par_cnst_half (<MODE>mode, <nunits>, true); + emit_insn (gen_aarch64_<su>mlal_hi<mode>_insn (operands[0], operands[1], + operands[2], p, operands[3])); + DONE; +} +) + +(define_insn "aarch64_<su>mlal_hi_n<mode>_insn" + [(set (match_operand:<VWIDE> 0 "register_operand" "=w") + (plus:<VWIDE> + (mult:<VWIDE> + (ANY_EXTEND:<VWIDE> (vec_select:<VHALF> + (match_operand:VQ_HSI 2 "register_operand" "w") + (match_operand:VQ_HSI 3 "vect_par_cnst_hi_half" ""))) + (ANY_EXTEND:<VWIDE> (vec_duplicate:<VCOND> + (match_operand:<VEL> 4 "register_operand" "<h_con>")))) + (match_operand:<VWIDE> 1 "register_operand" "0")))] + "TARGET_SIMD" + "<su>mlal2\t%0.<Vwtype>, %2.<Vtype>, %4.<Vetype>[0]" + [(set_attr "type" "neon_mla_<Vetype>_long")] +) + +(define_expand "aarch64_<su>mlal_hi_n<mode>" + [(match_operand:<VWIDE> 0 "register_operand") + (match_operand:<VWIDE> 1 "register_operand") + (ANY_EXTEND:<VWIDE>(match_operand:VQ_HSI 2 "register_operand")) + (match_operand:<VEL> 3 "register_operand")] + "TARGET_SIMD" +{ + rtx p = aarch64_simd_vect_par_cnst_half (<MODE>mode, <nunits>, true); + emit_insn (gen_aarch64_<su>mlal_hi_n<mode>_insn (operands[0], + operands[1], operands[2], p, operands[3])); + DONE; +} +) + (define_insn "*aarch64_<su>mlsl_lo<mode>" [(set (match_operand:<VWIDE> 0 "register_operand" "=w") (minus:<VWIDE> @@ -2038,6 +2081,35 @@ } ) +(define_insn "aarch64_<su>mlsl_hi_n<mode>_insn" + [(set (match_operand:<VWIDE> 0 "register_operand" "=w") + (minus:<VWIDE> + (match_operand:<VWIDE> 1 "register_operand" "0") + (mult:<VWIDE> + (ANY_EXTEND:<VWIDE> (vec_select:<VHALF> + (match_operand:VQ_HSI 2 "register_operand" "w") + (match_operand:VQ_HSI 3 "vect_par_cnst_hi_half" ""))) + (ANY_EXTEND:<VWIDE> (vec_duplicate:<VCOND> + (match_operand:<VEL> 4 "register_operand" "<h_con>"))))))] + "TARGET_SIMD" + "<su>mlsl2\t%0.<Vwtype>, %2.<Vtype>, %4.<Vetype>[0]" + [(set_attr "type" "neon_mla_<Vetype>_long")] +) + +(define_expand "aarch64_<su>mlsl_hi_n<mode>" + [(match_operand:<VWIDE> 0 "register_operand") + (match_operand:<VWIDE> 1 "register_operand") + (ANY_EXTEND:<VWIDE>(match_operand:VQ_HSI 2 "register_operand")) + (match_operand:<VEL> 3 "register_operand")] + "TARGET_SIMD" +{ + rtx p = aarch64_simd_vect_par_cnst_half (<MODE>mode, <nunits>, true); + emit_insn (gen_aarch64_<su>mlsl_hi_n<mode>_insn (operands[0], + operands[1], operands[2], p, operands[3])); + DONE; +} +) + (define_insn "aarch64_<su>mlal<mode>" [(set (match_operand:<VWIDE> 0 "register_operand" "=w") (plus:<VWIDE> @@ -2215,6 +2287,76 @@ [(set_attr "type" "neon_mla_<Vetype>_scalar_long")] ) +(define_insn "aarch64_<su>mlal_hi_lane<mode>_insn" + [(set (match_operand:<VWIDE> 0 "register_operand" "=w") + (plus:<VWIDE> + (mult:<VWIDE> + (ANY_EXTEND:<VWIDE> (vec_select:<VHALF> + (match_operand:VQ_HSI 2 "register_operand" "w") + (match_operand:VQ_HSI 3 "vect_par_cnst_hi_half" ""))) + (ANY_EXTEND:<VWIDE> (vec_duplicate:<VHALF> + (vec_select:<VEL> + (match_operand:<VCOND> 4 "register_operand" "<vwx>") + (parallel [(match_operand:SI 5 "immediate_operand" "i")]))))) + (match_operand:<VWIDE> 1 "register_operand" "0")))] + "TARGET_SIMD" + { + operands[5] = aarch64_endian_lane_rtx (<VCOND>mode, INTVAL (operands[5])); + return "<su>mlal2\\t%0.<Vwtype>, %2.<Vtype>, %4.<Vetype>[%5]"; + } + [(set_attr "type" "neon_mla_<Vetype>_scalar_long")] +) + +(define_expand "aarch64_<su>mlal_hi_lane<mode>" + [(match_operand:<VWIDE> 0 "register_operand") + (match_operand:<VWIDE> 1 "register_operand") + (ANY_EXTEND:<VWIDE>(match_operand:VQ_HSI 2 "register_operand")) + (match_operand:<VCOND> 3 "register_operand") + (match_operand:SI 4 "immediate_operand")] + "TARGET_SIMD" +{ + rtx p = aarch64_simd_vect_par_cnst_half (<MODE>mode, <nunits>, true); + emit_insn (gen_aarch64_<su>mlal_hi_lane<mode>_insn (operands[0], + operands[1], operands[2], p, operands[3], operands[4])); + DONE; +} +) + +(define_insn "aarch64_<su>mlal_hi_laneq<mode>_insn" + [(set (match_operand:<VWIDE> 0 "register_operand" "=w") + (plus:<VWIDE> + (mult:<VWIDE> + (ANY_EXTEND:<VWIDE> (vec_select:<VHALF> + (match_operand:VQ_HSI 2 "register_operand" "w") + (match_operand:VQ_HSI 3 "vect_par_cnst_hi_half" ""))) + (ANY_EXTEND:<VWIDE> (vec_duplicate:<VHALF> + (vec_select:<VEL> + (match_operand:<VCONQ> 4 "register_operand" "<vwx>") + (parallel [(match_operand:SI 5 "immediate_operand" "i")]))))) + (match_operand:<VWIDE> 1 "register_operand" "0")))] + "TARGET_SIMD" + { + operands[5] = aarch64_endian_lane_rtx (<VCONQ>mode, INTVAL (operands[5])); + return "<su>mlal2\\t%0.<Vwtype>, %2.<Vtype>, %4.<Vetype>[%5]"; + } + [(set_attr "type" "neon_mla_<Vetype>_scalar_long")] +) + +(define_expand "aarch64_<su>mlal_hi_laneq<mode>" + [(match_operand:<VWIDE> 0 "register_operand") + (match_operand:<VWIDE> 1 "register_operand") + (ANY_EXTEND:<VWIDE>(match_operand:VQ_HSI 2 "register_operand")) + (match_operand:<VCONQ> 3 "register_operand") + (match_operand:SI 4 "immediate_operand")] + "TARGET_SIMD" +{ + rtx p = aarch64_simd_vect_par_cnst_half (<MODE>mode, <nunits>, true); + emit_insn (gen_aarch64_<su>mlal_hi_laneq<mode>_insn (operands[0], + operands[1], operands[2], p, operands[3], operands[4])); + DONE; +} +) + (define_insn "aarch64_vec_<su>mlsl_lane<Qlane>" [(set (match_operand:<VWIDE> 0 "register_operand" "=w") (minus:<VWIDE> @@ -2235,6 +2377,78 @@ [(set_attr "type" "neon_mla_<Vetype>_scalar_long")] ) +(define_insn "aarch64_<su>mlsl_hi_lane<mode>_insn" + [(set (match_operand:<VWIDE> 0 "register_operand" "=w") + (minus:<VWIDE> + (match_operand:<VWIDE> 1 "register_operand" "0") + (mult:<VWIDE> + (ANY_EXTEND:<VWIDE> (vec_select:<VHALF> + (match_operand:VQ_HSI 2 "register_operand" "w") + (match_operand:VQ_HSI 3 "vect_par_cnst_hi_half" ""))) + (ANY_EXTEND:<VWIDE> (vec_duplicate:<VHALF> + (vec_select:<VEL> + (match_operand:<VCOND> 4 "register_operand" "<vwx>") + (parallel [(match_operand:SI 5 "immediate_operand" "i")])))) + )))] + "TARGET_SIMD" + { + operands[5] = aarch64_endian_lane_rtx (<VCOND>mode, INTVAL (operands[5])); + return "<su>mlsl2\\t%0.<Vwtype>, %2.<Vtype>, %4.<Vetype>[%5]"; + } + [(set_attr "type" "neon_mla_<Vetype>_scalar_long")] +) + +(define_expand "aarch64_<su>mlsl_hi_lane<mode>" + [(match_operand:<VWIDE> 0 "register_operand") + (match_operand:<VWIDE> 1 "register_operand") + (ANY_EXTEND:<VWIDE>(match_operand:VQ_HSI 2 "register_operand")) + (match_operand:<VCOND> 3 "register_operand") + (match_operand:SI 4 "immediate_operand")] + "TARGET_SIMD" +{ + rtx p = aarch64_simd_vect_par_cnst_half (<MODE>mode, <nunits>, true); + emit_insn (gen_aarch64_<su>mlsl_hi_lane<mode>_insn (operands[0], + operands[1], operands[2], p, operands[3], operands[4])); + DONE; +} +) + +(define_insn "aarch64_<su>mlsl_hi_laneq<mode>_insn" + [(set (match_operand:<VWIDE> 0 "register_operand" "=w") + (minus:<VWIDE> + (match_operand:<VWIDE> 1 "register_operand" "0") + (mult:<VWIDE> + (ANY_EXTEND:<VWIDE> (vec_select:<VHALF> + (match_operand:VQ_HSI 2 "register_operand" "w") + (match_operand:VQ_HSI 3 "vect_par_cnst_hi_half" ""))) + (ANY_EXTEND:<VWIDE> (vec_duplicate:<VHALF> + (vec_select:<VEL> + (match_operand:<VCONQ> 4 "register_operand" "<vwx>") + (parallel [(match_operand:SI 5 "immediate_operand" "i")])))) + )))] + "TARGET_SIMD" + { + operands[5] = aarch64_endian_lane_rtx (<VCONQ>mode, INTVAL (operands[5])); + return "<su>mlsl2\\t%0.<Vwtype>, %2.<Vtype>, %4.<Vetype>[%5]"; + } + [(set_attr "type" "neon_mla_<Vetype>_scalar_long")] +) + +(define_expand "aarch64_<su>mlsl_hi_laneq<mode>" + [(match_operand:<VWIDE> 0 "register_operand") + (match_operand:<VWIDE> 1 "register_operand") + (ANY_EXTEND:<VWIDE>(match_operand:VQ_HSI 2 "register_operand")) + (match_operand:<VCONQ> 3 "register_operand") + (match_operand:SI 4 "immediate_operand")] + "TARGET_SIMD" +{ + rtx p = aarch64_simd_vect_par_cnst_half (<MODE>mode, <nunits>, true); + emit_insn (gen_aarch64_<su>mlsl_hi_laneq<mode>_insn (operands[0], + operands[1], operands[2], p, operands[3], operands[4])); + DONE; +} +) + ;; FP vector operations. ;; AArch64 AdvSIMD supports single-precision (32-bit) and ;; double-precision (64-bit) floating-point data types and arithmetic as diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 4b905d9..d50bd65 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -7152,236 +7152,138 @@ vmla_u32 (uint32x2_t __a, uint32x2_t __b, uint32x2_t __c) (int32x2_t) __c); } -#define vmlal_high_lane_s16(a, b, c, d) \ - __extension__ \ - ({ \ - int16x4_t c_ = (c); \ - int16x8_t b_ = (b); \ - int32x4_t a_ = (a); \ - int32x4_t result; \ - __asm__ ("smlal2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_lane_s16(int32x4_t __a, int16x8_t __b, int16x4_t __v, + const int __lane) +{ + return __builtin_aarch64_smlal_hi_lanev8hi (__a, __b, __v, __lane); +} -#define vmlal_high_lane_s32(a, b, c, d) \ - __extension__ \ - ({ \ - int32x2_t c_ = (c); \ - int32x4_t b_ = (b); \ - int64x2_t a_ = (a); \ - int64x2_t result; \ - __asm__ ("smlal2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_lane_s32(int64x2_t __a, int32x4_t __b, int32x2_t __v, + const int __lane) +{ + return __builtin_aarch64_smlal_hi_lanev4si (__a, __b, __v, __lane); +} -#define vmlal_high_lane_u16(a, b, c, d) \ - __extension__ \ - ({ \ - uint16x4_t c_ = (c); \ - uint16x8_t b_ = (b); \ - uint32x4_t a_ = (a); \ - uint32x4_t result; \ - __asm__ ("umlal2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_lane_u16(uint32x4_t __a, uint16x8_t __b, uint16x4_t __v, + const int __lane) +{ + return __builtin_aarch64_umlal_hi_lanev8hi_uuuus (__a, __b, __v, __lane); +} -#define vmlal_high_lane_u32(a, b, c, d) \ - __extension__ \ - ({ \ - uint32x2_t c_ = (c); \ - uint32x4_t b_ = (b); \ - uint64x2_t a_ = (a); \ - uint64x2_t result; \ - __asm__ ("umlal2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_lane_u32(uint64x2_t __a, uint32x4_t __b, uint32x2_t __v, + const int __lane) +{ + return __builtin_aarch64_umlal_hi_lanev4si_uuuus (__a, __b, __v, __lane); +} -#define vmlal_high_laneq_s16(a, b, c, d) \ - __extension__ \ - ({ \ - int16x8_t c_ = (c); \ - int16x8_t b_ = (b); \ - int32x4_t a_ = (a); \ - int32x4_t result; \ - __asm__ ("smlal2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_laneq_s16(int32x4_t __a, int16x8_t __b, int16x8_t __v, + const int __lane) +{ + return __builtin_aarch64_smlal_hi_laneqv8hi (__a, __b, __v, __lane); +} -#define vmlal_high_laneq_s32(a, b, c, d) \ - __extension__ \ - ({ \ - int32x4_t c_ = (c); \ - int32x4_t b_ = (b); \ - int64x2_t a_ = (a); \ - int64x2_t result; \ - __asm__ ("smlal2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_laneq_s32(int64x2_t __a, int32x4_t __b, int32x4_t __v, + const int __lane) +{ + return __builtin_aarch64_smlal_hi_laneqv4si (__a, __b, __v, __lane); +} -#define vmlal_high_laneq_u16(a, b, c, d) \ - __extension__ \ - ({ \ - uint16x8_t c_ = (c); \ - uint16x8_t b_ = (b); \ - uint32x4_t a_ = (a); \ - uint32x4_t result; \ - __asm__ ("umlal2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_laneq_u16(uint32x4_t __a, uint16x8_t __b, uint16x8_t __v, + const int __lane) +{ + return __builtin_aarch64_umlal_hi_laneqv8hi_uuuus (__a, __b, __v, __lane); +} -#define vmlal_high_laneq_u32(a, b, c, d) \ - __extension__ \ - ({ \ - uint32x4_t c_ = (c); \ - uint32x4_t b_ = (b); \ - uint64x2_t a_ = (a); \ - uint64x2_t result; \ - __asm__ ("umlal2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlal_high_laneq_u32(uint64x2_t __a, uint32x4_t __b, uint32x4_t __v, + const int __lane) +{ + return __builtin_aarch64_umlal_hi_laneqv4si_uuuus (__a, __b, __v, __lane); +} __extension__ extern __inline int32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_n_s16 (int32x4_t __a, int16x8_t __b, int16_t __c) { - int32x4_t __result; - __asm__ ("smlal2 %0.4s,%2.8h,%3.h[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "x"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_smlal_hi_nv8hi (__a, __b, __c); } __extension__ extern __inline int64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_n_s32 (int64x2_t __a, int32x4_t __b, int32_t __c) { - int64x2_t __result; - __asm__ ("smlal2 %0.2d,%2.4s,%3.s[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_smlal_hi_nv4si (__a, __b, __c); } __extension__ extern __inline uint32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_n_u16 (uint32x4_t __a, uint16x8_t __b, uint16_t __c) { - uint32x4_t __result; - __asm__ ("umlal2 %0.4s,%2.8h,%3.h[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "x"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_umlal_hi_nv8hi_uuuu (__a, __b, __c); } __extension__ extern __inline uint64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_n_u32 (uint64x2_t __a, uint32x4_t __b, uint32_t __c) { - uint64x2_t __result; - __asm__ ("umlal2 %0.2d,%2.4s,%3.s[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_umlal_hi_nv4si_uuuu (__a, __b, __c); } __extension__ extern __inline int16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_s8 (int16x8_t __a, int8x16_t __b, int8x16_t __c) { - int16x8_t __result; - __asm__ ("smlal2 %0.8h,%2.16b,%3.16b" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_smlal_hiv16qi (__a, __b, __c); } __extension__ extern __inline int32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_s16 (int32x4_t __a, int16x8_t __b, int16x8_t __c) { - int32x4_t __result; - __asm__ ("smlal2 %0.4s,%2.8h,%3.8h" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_smlal_hiv8hi (__a, __b, __c); } __extension__ extern __inline int64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_s32 (int64x2_t __a, int32x4_t __b, int32x4_t __c) { - int64x2_t __result; - __asm__ ("smlal2 %0.2d,%2.4s,%3.4s" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_smlal_hiv4si (__a, __b, __c); } __extension__ extern __inline uint16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_u8 (uint16x8_t __a, uint8x16_t __b, uint8x16_t __c) { - uint16x8_t __result; - __asm__ ("umlal2 %0.8h,%2.16b,%3.16b" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_umlal_hiv16qi_uuuu (__a, __b, __c); } __extension__ extern __inline uint32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_u16 (uint32x4_t __a, uint16x8_t __b, uint16x8_t __c) { - uint32x4_t __result; - __asm__ ("umlal2 %0.4s,%2.8h,%3.8h" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_umlal_hiv8hi_uuuu (__a, __b, __c); } __extension__ extern __inline uint64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlal_high_u32 (uint64x2_t __a, uint32x4_t __b, uint32x4_t __c) { - uint64x2_t __result; - __asm__ ("umlal2 %0.2d,%2.4s,%3.4s" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_umlal_hiv4si_uuuu (__a, __b, __c); } __extension__ extern __inline int32x4_t @@ -7696,164 +7598,96 @@ vmls_u32 (uint32x2_t __a, uint32x2_t __b, uint32x2_t __c) (int32x2_t) __c); } -#define vmlsl_high_lane_s16(a, b, c, d) \ - __extension__ \ - ({ \ - int16x4_t c_ = (c); \ - int16x8_t b_ = (b); \ - int32x4_t a_ = (a); \ - int32x4_t result; \ - __asm__ ("smlsl2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_lane_s16(int32x4_t __a, int16x8_t __b, int16x4_t __v, + const int __lane) +{ + return __builtin_aarch64_smlsl_hi_lanev8hi (__a, __b, __v, __lane); +} -#define vmlsl_high_lane_s32(a, b, c, d) \ - __extension__ \ - ({ \ - int32x2_t c_ = (c); \ - int32x4_t b_ = (b); \ - int64x2_t a_ = (a); \ - int64x2_t result; \ - __asm__ ("smlsl2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_lane_s32(int64x2_t __a, int32x4_t __b, int32x2_t __v, + const int __lane) +{ + return __builtin_aarch64_smlsl_hi_lanev4si (__a, __b, __v, __lane); +} -#define vmlsl_high_lane_u16(a, b, c, d) \ - __extension__ \ - ({ \ - uint16x4_t c_ = (c); \ - uint16x8_t b_ = (b); \ - uint32x4_t a_ = (a); \ - uint32x4_t result; \ - __asm__ ("umlsl2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_lane_u16(uint32x4_t __a, uint16x8_t __b, uint16x4_t __v, + const int __lane) +{ + return __builtin_aarch64_umlsl_hi_lanev8hi_uuuus (__a, __b, __v, __lane); +} -#define vmlsl_high_lane_u32(a, b, c, d) \ - __extension__ \ - ({ \ - uint32x2_t c_ = (c); \ - uint32x4_t b_ = (b); \ - uint64x2_t a_ = (a); \ - uint64x2_t result; \ - __asm__ ("umlsl2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_lane_u32(uint64x2_t __a, uint32x4_t __b, uint32x2_t __v, + const int __lane) +{ + return __builtin_aarch64_umlsl_hi_lanev4si_uuuus (__a, __b, __v, __lane); +} -#define vmlsl_high_laneq_s16(a, b, c, d) \ - __extension__ \ - ({ \ - int16x8_t c_ = (c); \ - int16x8_t b_ = (b); \ - int32x4_t a_ = (a); \ - int32x4_t result; \ - __asm__ ("smlsl2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_laneq_s16(int32x4_t __a, int16x8_t __b, int16x8_t __v, + const int __lane) +{ + return __builtin_aarch64_smlsl_hi_laneqv8hi (__a, __b, __v, __lane); +} -#define vmlsl_high_laneq_s32(a, b, c, d) \ - __extension__ \ - ({ \ - int32x4_t c_ = (c); \ - int32x4_t b_ = (b); \ - int64x2_t a_ = (a); \ - int64x2_t result; \ - __asm__ ("smlsl2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline int64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_laneq_s32(int64x2_t __a, int32x4_t __b, int32x4_t __v, + const int __lane) +{ + return __builtin_aarch64_smlsl_hi_laneqv4si (__a, __b, __v, __lane); +} -#define vmlsl_high_laneq_u16(a, b, c, d) \ - __extension__ \ - ({ \ - uint16x8_t c_ = (c); \ - uint16x8_t b_ = (b); \ - uint32x4_t a_ = (a); \ - uint32x4_t result; \ - __asm__ ("umlsl2 %0.4s, %2.8h, %3.h[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "x"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_laneq_u16(uint32x4_t __a, uint16x8_t __b, uint16x8_t __v, + const int __lane) +{ + return __builtin_aarch64_umlsl_hi_laneqv8hi_uuuus (__a, __b, __v, __lane); +} -#define vmlsl_high_laneq_u32(a, b, c, d) \ - __extension__ \ - ({ \ - uint32x4_t c_ = (c); \ - uint32x4_t b_ = (b); \ - uint64x2_t a_ = (a); \ - uint64x2_t result; \ - __asm__ ("umlsl2 %0.2d, %2.4s, %3.s[%4]" \ - : "=w"(result) \ - : "0"(a_), "w"(b_), "w"(c_), "i"(d) \ - : /* No clobbers */); \ - result; \ - }) +__extension__ extern __inline uint64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmlsl_high_laneq_u32(uint64x2_t __a, uint32x4_t __b, uint32x4_t __v, + const int __lane) +{ + return __builtin_aarch64_umlsl_hi_laneqv4si_uuuus (__a, __b, __v, __lane); +} __extension__ extern __inline int32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlsl_high_n_s16 (int32x4_t __a, int16x8_t __b, int16_t __c) { - int32x4_t __result; - __asm__ ("smlsl2 %0.4s, %2.8h, %3.h[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "x"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_smlsl_hi_nv8hi (__a, __b, __c); } __extension__ extern __inline int64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlsl_high_n_s32 (int64x2_t __a, int32x4_t __b, int32_t __c) { - int64x2_t __result; - __asm__ ("smlsl2 %0.2d, %2.4s, %3.s[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_smlsl_hi_nv4si (__a, __b, __c); } __extension__ extern __inline uint32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlsl_high_n_u16 (uint32x4_t __a, uint16x8_t __b, uint16_t __c) { - uint32x4_t __result; - __asm__ ("umlsl2 %0.4s, %2.8h, %3.h[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "x"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_umlsl_hi_nv8hi_uuuu (__a, __b, __c); } __extension__ extern __inline uint64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vmlsl_high_n_u32 (uint64x2_t __a, uint32x4_t __b, uint32_t __c) { - uint64x2_t __result; - __asm__ ("umlsl2 %0.2d, %2.4s, %3.s[0]" - : "=w"(__result) - : "0"(__a), "w"(__b), "w"(__c) - : /* No clobbers */); - return __result; + return __builtin_aarch64_umlsl_hi_nv4si_uuuu (__a, __b, __c); } __extension__ extern __inline int16x8_t diff --git a/gcc/config/gcn/gcn-opts.h b/gcc/config/gcn/gcn-opts.h index ed9b451..ed67d01 100644 --- a/gcc/config/gcn/gcn-opts.h +++ b/gcc/config/gcn/gcn-opts.h @@ -22,7 +22,8 @@ enum processor_type { PROCESSOR_FIJI, // gfx803 PROCESSOR_VEGA10, // gfx900 - PROCESSOR_VEGA20 // gfx906 + PROCESSOR_VEGA20, // gfx906 + PROCESSOR_GFX908 // as yet unnamed }; /* Set in gcn_option_override. */ diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index 2351b24..e8bb0b6 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -2589,6 +2589,8 @@ gcn_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait, return gcn_arch == PROCESSOR_VEGA10; if (strcmp (name, "gfx906") == 0) return gcn_arch == PROCESSOR_VEGA20; + if (strcmp (name, "gfx908") == 0) + return gcn_arch == PROCESSOR_GFX908; return 0; default: gcc_unreachable (); @@ -5030,6 +5032,7 @@ output_file_start (void) case PROCESSOR_FIJI: cpu = "gfx803"; break; case PROCESSOR_VEGA10: cpu = "gfx900"; break; case PROCESSOR_VEGA20: cpu = "gfx906"; break; + case PROCESSOR_GFX908: cpu = "gfx908+sram-ecc"; break; default: gcc_unreachable (); } diff --git a/gcc/config/gcn/gcn.opt b/gcc/config/gcn/gcn.opt index 7fd84f8..767d458 100644 --- a/gcc/config/gcn/gcn.opt +++ b/gcc/config/gcn/gcn.opt @@ -34,6 +34,9 @@ Enum(gpu_type) String(gfx900) Value(PROCESSOR_VEGA10) EnumValue Enum(gpu_type) String(gfx906) Value(PROCESSOR_VEGA20) +EnumValue +Enum(gpu_type) String(gfx908) Value(PROCESSOR_GFX908) + march= Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_FIJI) Specify the name of the target GPU. diff --git a/gcc/config/gcn/mkoffload.c b/gcc/config/gcn/mkoffload.c index eb1c717..dc9d518 100644 --- a/gcc/config/gcn/mkoffload.c +++ b/gcc/config/gcn/mkoffload.c @@ -51,6 +51,8 @@ #define EF_AMDGPU_MACH_AMDGCN_GFX900 0x2c #undef EF_AMDGPU_MACH_AMDGCN_GFX906 #define EF_AMDGPU_MACH_AMDGCN_GFX906 0x2f +#undef EF_AMDGPU_MACH_AMDGCN_GFX908 +#define EF_AMDGPU_MACH_AMDGCN_GFX908 0x230 // Assume SRAM-ECC enabled. #ifndef R_AMDGPU_NONE #define R_AMDGPU_NONE 0 @@ -856,6 +858,8 @@ main (int argc, char **argv) elf_arch = EF_AMDGPU_MACH_AMDGCN_GFX900; else if (strcmp (argv[i], "-march=gfx906") == 0) elf_arch = EF_AMDGPU_MACH_AMDGCN_GFX906; + else if (strcmp (argv[i], "-march=gfx908") == 0) + elf_arch = EF_AMDGPU_MACH_AMDGCN_GFX908; } if (!(fopenacc ^ fopenmp)) diff --git a/gcc/config/gcn/t-gcn-hsa b/gcc/config/gcn/t-gcn-hsa index bf47da7..ee4d9b3 100644 --- a/gcc/config/gcn/t-gcn-hsa +++ b/gcc/config/gcn/t-gcn-hsa @@ -42,8 +42,8 @@ ALL_HOST_OBJS += gcn-run.o gcn-run$(exeext): gcn-run.o +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $< -ldl -MULTILIB_OPTIONS = march=gfx900/march=gfx906 -MULTILIB_DIRNAMES = gfx900 gfx906 +MULTILIB_OPTIONS = march=gfx900/march=gfx906/march=gfx908 +MULTILIB_DIRNAMES = gfx900 gfx906 gfx908 gcn-tree.o: $(srcdir)/config/gcn/gcn-tree.c $(COMPILE) $< diff --git a/gcc/config/gcn/t-omp-device b/gcc/config/gcn/t-omp-device index d9809d5..8461c43 100644 --- a/gcc/config/gcn/t-omp-device +++ b/gcc/config/gcn/t-omp-device @@ -1,4 +1,4 @@ omp-device-properties-gcn: $(srcdir)/config/gcn/gcn.c echo kind: gpu > $@ echo arch: gcn >> $@ - echo isa: fiji gfx900 gfx906 >> $@ + echo isa: fiji gfx900 gfx906 gfx908 >> $@ diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index a6ddc71..9e5a4d1 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1528,9 +1528,9 @@ (set_attr "mode" "DI,TI,TI")]) (define_expand "<insn><mode>3" - [(set (match_operand:MMXMODE248 0 "register_operand") - (any_lshift:MMXMODE248 - (match_operand:MMXMODE248 1 "register_operand") + [(set (match_operand:MMXMODE24 0 "register_operand") + (any_lshift:MMXMODE24 + (match_operand:MMXMODE24 1 "register_operand") (match_operand:DI 2 "nonmemory_operand")))] "TARGET_MMX_WITH_SSE") diff --git a/gcc/config/rs6000/fusion.md b/gcc/config/rs6000/fusion.md index 1ddbe7f..737a6da 100644 --- a/gcc/config/rs6000/fusion.md +++ b/gcc/config/rs6000/fusion.md @@ -357,2176 +357,2304 @@ ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> and (define_insn "*fuse_and_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;and %3,%3,%2 - and %0,%1,%0\;and %0,%0,%2 - and %1,%1,%0\;and %1,%1,%2 + and %3,%1,%0\;and %3,%3,%2 + and %3,%1,%0\;and %3,%3,%2 and %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> and (define_insn "*fuse_andc_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;and %3,%3,%2 - andc %0,%1,%0\;and %0,%0,%2 - andc %1,%1,%0\;and %1,%1,%2 + andc %3,%1,%0\;and %3,%3,%2 + andc %3,%1,%0\;and %3,%3,%2 andc %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> and (define_insn "*fuse_eqv_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;and %3,%3,%2 - eqv %0,%1,%0\;and %0,%0,%2 - eqv %1,%1,%0\;and %1,%1,%2 + eqv %3,%1,%0\;and %3,%3,%2 + eqv %3,%1,%0\;and %3,%3,%2 eqv %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> and (define_insn "*fuse_nand_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;and %3,%3,%2 - nand %0,%1,%0\;and %0,%0,%2 - nand %1,%1,%0\;and %1,%1,%2 + nand %3,%1,%0\;and %3,%3,%2 + nand %3,%1,%0\;and %3,%3,%2 nand %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> and (define_insn "*fuse_nor_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;and %3,%3,%2 - nor %0,%1,%0\;and %0,%0,%2 - nor %1,%1,%0\;and %1,%1,%2 + nor %3,%1,%0\;and %3,%3,%2 + nor %3,%1,%0\;and %3,%3,%2 nor %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> and (define_insn "*fuse_or_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;and %3,%3,%2 - or %0,%1,%0\;and %0,%0,%2 - or %1,%1,%0\;and %1,%1,%2 + or %3,%1,%0\;and %3,%3,%2 + or %3,%1,%0\;and %3,%3,%2 or %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> and (define_insn "*fuse_orc_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;and %3,%3,%2 - orc %0,%1,%0\;and %0,%0,%2 - orc %1,%1,%0\;and %1,%1,%2 + orc %3,%1,%0\;and %3,%3,%2 + orc %3,%1,%0\;and %3,%3,%2 orc %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: and op and rtl and inv 0 comp 0 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> and (define_insn "*fuse_xor_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;and %3,%3,%2 - xor %0,%1,%0\;and %0,%0,%2 - xor %1,%1,%0\;and %1,%1,%2 + xor %3,%1,%0\;and %3,%3,%2 + xor %3,%1,%0\;and %3,%3,%2 xor %4,%1,%0\;and %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> andc (define_insn "*fuse_and_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;andc %3,%3,%2 - and %0,%1,%0\;andc %0,%0,%2 - and %1,%1,%0\;andc %1,%1,%2 + and %3,%1,%0\;andc %3,%3,%2 + and %3,%1,%0\;andc %3,%3,%2 and %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> andc (define_insn "*fuse_andc_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;andc %3,%3,%2 - andc %0,%1,%0\;andc %0,%0,%2 - andc %1,%1,%0\;andc %1,%1,%2 + andc %3,%1,%0\;andc %3,%3,%2 + andc %3,%1,%0\;andc %3,%3,%2 andc %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> andc (define_insn "*fuse_eqv_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;andc %3,%3,%2 - eqv %0,%1,%0\;andc %0,%0,%2 - eqv %1,%1,%0\;andc %1,%1,%2 + eqv %3,%1,%0\;andc %3,%3,%2 + eqv %3,%1,%0\;andc %3,%3,%2 eqv %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> andc (define_insn "*fuse_nand_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;andc %3,%3,%2 - nand %0,%1,%0\;andc %0,%0,%2 - nand %1,%1,%0\;andc %1,%1,%2 + nand %3,%1,%0\;andc %3,%3,%2 + nand %3,%1,%0\;andc %3,%3,%2 nand %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> andc (define_insn "*fuse_nor_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;andc %3,%3,%2 - nor %0,%1,%0\;andc %0,%0,%2 - nor %1,%1,%0\;andc %1,%1,%2 + nor %3,%1,%0\;andc %3,%3,%2 + nor %3,%1,%0\;andc %3,%3,%2 nor %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> andc (define_insn "*fuse_or_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;andc %3,%3,%2 - or %0,%1,%0\;andc %0,%0,%2 - or %1,%1,%0\;andc %1,%1,%2 + or %3,%1,%0\;andc %3,%3,%2 + or %3,%1,%0\;andc %3,%3,%2 or %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> andc (define_insn "*fuse_orc_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;andc %3,%3,%2 - orc %0,%1,%0\;andc %0,%0,%2 - orc %1,%1,%0\;andc %1,%1,%2 + orc %3,%1,%0\;andc %3,%3,%2 + orc %3,%1,%0\;andc %3,%3,%2 orc %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: andc op andc rtl and inv 0 comp 1 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> andc (define_insn "*fuse_xor_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;andc %3,%3,%2 - xor %0,%1,%0\;andc %0,%0,%2 - xor %1,%1,%0\;andc %1,%1,%2 + xor %3,%1,%0\;andc %3,%3,%2 + xor %3,%1,%0\;andc %3,%3,%2 xor %4,%1,%0\;andc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> eqv (define_insn "*fuse_and_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;eqv %3,%3,%2 - and %0,%1,%0\;eqv %0,%0,%2 - and %1,%1,%0\;eqv %1,%1,%2 + and %3,%1,%0\;eqv %3,%3,%2 + and %3,%1,%0\;eqv %3,%3,%2 and %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> eqv (define_insn "*fuse_andc_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;eqv %3,%3,%2 - andc %0,%1,%0\;eqv %0,%0,%2 - andc %1,%1,%0\;eqv %1,%1,%2 + andc %3,%1,%0\;eqv %3,%3,%2 + andc %3,%1,%0\;eqv %3,%3,%2 andc %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> eqv (define_insn "*fuse_eqv_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;eqv %3,%3,%2 - eqv %0,%1,%0\;eqv %0,%0,%2 - eqv %1,%1,%0\;eqv %1,%1,%2 + eqv %3,%1,%0\;eqv %3,%3,%2 + eqv %3,%1,%0\;eqv %3,%3,%2 eqv %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> eqv (define_insn "*fuse_nand_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;eqv %3,%3,%2 - nand %0,%1,%0\;eqv %0,%0,%2 - nand %1,%1,%0\;eqv %1,%1,%2 + nand %3,%1,%0\;eqv %3,%3,%2 + nand %3,%1,%0\;eqv %3,%3,%2 nand %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> eqv (define_insn "*fuse_nor_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;eqv %3,%3,%2 - nor %0,%1,%0\;eqv %0,%0,%2 - nor %1,%1,%0\;eqv %1,%1,%2 + nor %3,%1,%0\;eqv %3,%3,%2 + nor %3,%1,%0\;eqv %3,%3,%2 nor %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> eqv (define_insn "*fuse_or_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;eqv %3,%3,%2 - or %0,%1,%0\;eqv %0,%0,%2 - or %1,%1,%0\;eqv %1,%1,%2 + or %3,%1,%0\;eqv %3,%3,%2 + or %3,%1,%0\;eqv %3,%3,%2 or %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> eqv (define_insn "*fuse_orc_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;eqv %3,%3,%2 - orc %0,%1,%0\;eqv %0,%0,%2 - orc %1,%1,%0\;eqv %1,%1,%2 + orc %3,%1,%0\;eqv %3,%3,%2 + orc %3,%1,%0\;eqv %3,%3,%2 orc %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: eqv op eqv rtl xor inv 1 comp 0 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> eqv (define_insn "*fuse_xor_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (not:GPR (xor:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (not:GPR (xor:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;eqv %3,%3,%2 - xor %0,%1,%0\;eqv %0,%0,%2 - xor %1,%1,%0\;eqv %1,%1,%2 + xor %3,%1,%0\;eqv %3,%3,%2 + xor %3,%1,%0\;eqv %3,%3,%2 xor %4,%1,%0\;eqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> nand (define_insn "*fuse_and_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;nand %3,%3,%2 - and %0,%1,%0\;nand %0,%0,%2 - and %1,%1,%0\;nand %1,%1,%2 + and %3,%1,%0\;nand %3,%3,%2 + and %3,%1,%0\;nand %3,%3,%2 and %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> nand (define_insn "*fuse_andc_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;nand %3,%3,%2 - andc %0,%1,%0\;nand %0,%0,%2 - andc %1,%1,%0\;nand %1,%1,%2 + andc %3,%1,%0\;nand %3,%3,%2 + andc %3,%1,%0\;nand %3,%3,%2 andc %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> nand (define_insn "*fuse_eqv_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;nand %3,%3,%2 - eqv %0,%1,%0\;nand %0,%0,%2 - eqv %1,%1,%0\;nand %1,%1,%2 + eqv %3,%1,%0\;nand %3,%3,%2 + eqv %3,%1,%0\;nand %3,%3,%2 eqv %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> nand (define_insn "*fuse_nand_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;nand %3,%3,%2 - nand %0,%1,%0\;nand %0,%0,%2 - nand %1,%1,%0\;nand %1,%1,%2 + nand %3,%1,%0\;nand %3,%3,%2 + nand %3,%1,%0\;nand %3,%3,%2 nand %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> nand (define_insn "*fuse_nor_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;nand %3,%3,%2 - nor %0,%1,%0\;nand %0,%0,%2 - nor %1,%1,%0\;nand %1,%1,%2 + nor %3,%1,%0\;nand %3,%3,%2 + nor %3,%1,%0\;nand %3,%3,%2 nor %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> nand (define_insn "*fuse_or_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;nand %3,%3,%2 - or %0,%1,%0\;nand %0,%0,%2 - or %1,%1,%0\;nand %1,%1,%2 + or %3,%1,%0\;nand %3,%3,%2 + or %3,%1,%0\;nand %3,%3,%2 or %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> nand (define_insn "*fuse_orc_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;nand %3,%3,%2 - orc %0,%1,%0\;nand %0,%0,%2 - orc %1,%1,%0\;nand %1,%1,%2 + orc %3,%1,%0\;nand %3,%3,%2 + orc %3,%1,%0\;nand %3,%3,%2 orc %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nand op nand rtl ior inv 0 comp 3 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> nand (define_insn "*fuse_xor_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;nand %3,%3,%2 - xor %0,%1,%0\;nand %0,%0,%2 - xor %1,%1,%0\;nand %1,%1,%2 + xor %3,%1,%0\;nand %3,%3,%2 + xor %3,%1,%0\;nand %3,%3,%2 xor %4,%1,%0\;nand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> nor (define_insn "*fuse_and_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;nor %3,%3,%2 - and %0,%1,%0\;nor %0,%0,%2 - and %1,%1,%0\;nor %1,%1,%2 + and %3,%1,%0\;nor %3,%3,%2 + and %3,%1,%0\;nor %3,%3,%2 and %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> nor (define_insn "*fuse_andc_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;nor %3,%3,%2 - andc %0,%1,%0\;nor %0,%0,%2 - andc %1,%1,%0\;nor %1,%1,%2 + andc %3,%1,%0\;nor %3,%3,%2 + andc %3,%1,%0\;nor %3,%3,%2 andc %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> nor (define_insn "*fuse_eqv_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;nor %3,%3,%2 - eqv %0,%1,%0\;nor %0,%0,%2 - eqv %1,%1,%0\;nor %1,%1,%2 + eqv %3,%1,%0\;nor %3,%3,%2 + eqv %3,%1,%0\;nor %3,%3,%2 eqv %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> nor (define_insn "*fuse_nand_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;nor %3,%3,%2 - nand %0,%1,%0\;nor %0,%0,%2 - nand %1,%1,%0\;nor %1,%1,%2 + nand %3,%1,%0\;nor %3,%3,%2 + nand %3,%1,%0\;nor %3,%3,%2 nand %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> nor (define_insn "*fuse_nor_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;nor %3,%3,%2 - nor %0,%1,%0\;nor %0,%0,%2 - nor %1,%1,%0\;nor %1,%1,%2 + nor %3,%1,%0\;nor %3,%3,%2 + nor %3,%1,%0\;nor %3,%3,%2 nor %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> nor (define_insn "*fuse_or_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;nor %3,%3,%2 - or %0,%1,%0\;nor %0,%0,%2 - or %1,%1,%0\;nor %1,%1,%2 + or %3,%1,%0\;nor %3,%3,%2 + or %3,%1,%0\;nor %3,%3,%2 or %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> nor (define_insn "*fuse_orc_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;nor %3,%3,%2 - orc %0,%1,%0\;nor %0,%0,%2 - orc %1,%1,%0\;nor %1,%1,%2 + orc %3,%1,%0\;nor %3,%3,%2 + orc %3,%1,%0\;nor %3,%3,%2 orc %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: nor op nor rtl and inv 0 comp 3 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> nor (define_insn "*fuse_xor_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;nor %3,%3,%2 - xor %0,%1,%0\;nor %0,%0,%2 - xor %1,%1,%0\;nor %1,%1,%2 + xor %3,%1,%0\;nor %3,%3,%2 + xor %3,%1,%0\;nor %3,%3,%2 xor %4,%1,%0\;nor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> or (define_insn "*fuse_and_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;or %3,%3,%2 - and %0,%1,%0\;or %0,%0,%2 - and %1,%1,%0\;or %1,%1,%2 + and %3,%1,%0\;or %3,%3,%2 + and %3,%1,%0\;or %3,%3,%2 and %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> or (define_insn "*fuse_andc_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;or %3,%3,%2 - andc %0,%1,%0\;or %0,%0,%2 - andc %1,%1,%0\;or %1,%1,%2 + andc %3,%1,%0\;or %3,%3,%2 + andc %3,%1,%0\;or %3,%3,%2 andc %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> or (define_insn "*fuse_eqv_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;or %3,%3,%2 - eqv %0,%1,%0\;or %0,%0,%2 - eqv %1,%1,%0\;or %1,%1,%2 + eqv %3,%1,%0\;or %3,%3,%2 + eqv %3,%1,%0\;or %3,%3,%2 eqv %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> or (define_insn "*fuse_nand_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;or %3,%3,%2 - nand %0,%1,%0\;or %0,%0,%2 - nand %1,%1,%0\;or %1,%1,%2 + nand %3,%1,%0\;or %3,%3,%2 + nand %3,%1,%0\;or %3,%3,%2 nand %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> or (define_insn "*fuse_nor_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;or %3,%3,%2 - nor %0,%1,%0\;or %0,%0,%2 - nor %1,%1,%0\;or %1,%1,%2 + nor %3,%1,%0\;or %3,%3,%2 + nor %3,%1,%0\;or %3,%3,%2 nor %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> or (define_insn "*fuse_or_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;or %3,%3,%2 - or %0,%1,%0\;or %0,%0,%2 - or %1,%1,%0\;or %1,%1,%2 + or %3,%1,%0\;or %3,%3,%2 + or %3,%1,%0\;or %3,%3,%2 or %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> or (define_insn "*fuse_orc_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;or %3,%3,%2 - orc %0,%1,%0\;or %0,%0,%2 - orc %1,%1,%0\;or %1,%1,%2 + orc %3,%1,%0\;or %3,%3,%2 + orc %3,%1,%0\;or %3,%3,%2 orc %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: or op or rtl ior inv 0 comp 0 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> or (define_insn "*fuse_xor_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;or %3,%3,%2 - xor %0,%1,%0\;or %0,%0,%2 - xor %1,%1,%0\;or %1,%1,%2 + xor %3,%1,%0\;or %3,%3,%2 + xor %3,%1,%0\;or %3,%3,%2 xor %4,%1,%0\;or %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> orc (define_insn "*fuse_and_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;orc %3,%3,%2 - and %0,%1,%0\;orc %0,%0,%2 - and %1,%1,%0\;orc %1,%1,%2 + and %3,%1,%0\;orc %3,%3,%2 + and %3,%1,%0\;orc %3,%3,%2 and %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> orc (define_insn "*fuse_andc_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;orc %3,%3,%2 - andc %0,%1,%0\;orc %0,%0,%2 - andc %1,%1,%0\;orc %1,%1,%2 + andc %3,%1,%0\;orc %3,%3,%2 + andc %3,%1,%0\;orc %3,%3,%2 andc %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> orc (define_insn "*fuse_eqv_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;orc %3,%3,%2 - eqv %0,%1,%0\;orc %0,%0,%2 - eqv %1,%1,%0\;orc %1,%1,%2 + eqv %3,%1,%0\;orc %3,%3,%2 + eqv %3,%1,%0\;orc %3,%3,%2 eqv %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> orc (define_insn "*fuse_nand_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;orc %3,%3,%2 - nand %0,%1,%0\;orc %0,%0,%2 - nand %1,%1,%0\;orc %1,%1,%2 + nand %3,%1,%0\;orc %3,%3,%2 + nand %3,%1,%0\;orc %3,%3,%2 nand %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> orc (define_insn "*fuse_nor_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;orc %3,%3,%2 - nor %0,%1,%0\;orc %0,%0,%2 - nor %1,%1,%0\;orc %1,%1,%2 + nor %3,%1,%0\;orc %3,%3,%2 + nor %3,%1,%0\;orc %3,%3,%2 nor %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> orc (define_insn "*fuse_or_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;orc %3,%3,%2 - or %0,%1,%0\;orc %0,%0,%2 - or %1,%1,%0\;orc %1,%1,%2 + or %3,%1,%0\;orc %3,%3,%2 + or %3,%1,%0\;orc %3,%3,%2 or %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> orc (define_insn "*fuse_orc_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;orc %3,%3,%2 - orc %0,%1,%0\;orc %0,%0,%2 - orc %1,%1,%0\;orc %1,%1,%2 + orc %3,%1,%0\;orc %3,%3,%2 + orc %3,%1,%0\;orc %3,%3,%2 orc %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: orc op orc rtl ior inv 0 comp 1 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> orc (define_insn "*fuse_xor_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (ior:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (ior:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;orc %3,%3,%2 - xor %0,%1,%0\;orc %0,%0,%2 - xor %1,%1,%0\;orc %1,%1,%2 + xor %3,%1,%0\;orc %3,%3,%2 + xor %3,%1,%0\;orc %3,%3,%2 xor %4,%1,%0\;orc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: and op and rtl and inv 0 comp 0 +;; scalar and -> xor (define_insn "*fuse_and_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ and %3,%1,%0\;xor %3,%3,%2 - and %0,%1,%0\;xor %0,%0,%2 - and %1,%1,%0\;xor %1,%1,%2 + and %3,%1,%0\;xor %3,%3,%2 + and %3,%1,%0\;xor %3,%3,%2 and %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: andc op andc rtl and inv 0 comp 1 +;; scalar andc -> xor (define_insn "*fuse_andc_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ andc %3,%1,%0\;xor %3,%3,%2 - andc %0,%1,%0\;xor %0,%0,%2 - andc %1,%1,%0\;xor %1,%1,%2 + andc %3,%1,%0\;xor %3,%3,%2 + andc %3,%1,%0\;xor %3,%3,%2 andc %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: eqv op eqv rtl xor inv 1 comp 0 +;; scalar eqv -> xor (define_insn "*fuse_eqv_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ eqv %3,%1,%0\;xor %3,%3,%2 - eqv %0,%1,%0\;xor %0,%0,%2 - eqv %1,%1,%0\;xor %1,%1,%2 + eqv %3,%1,%0\;xor %3,%3,%2 + eqv %3,%1,%0\;xor %3,%3,%2 eqv %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: nand op nand rtl ior inv 0 comp 3 +;; scalar nand -> xor (define_insn "*fuse_nand_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nand %3,%1,%0\;xor %3,%3,%2 - nand %0,%1,%0\;xor %0,%0,%2 - nand %1,%1,%0\;xor %1,%1,%2 + nand %3,%1,%0\;xor %3,%3,%2 + nand %3,%1,%0\;xor %3,%3,%2 nand %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: nor op nor rtl and inv 0 comp 3 +;; scalar nor -> xor (define_insn "*fuse_nor_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ nor %3,%1,%0\;xor %3,%3,%2 - nor %0,%1,%0\;xor %0,%0,%2 - nor %1,%1,%0\;xor %1,%1,%2 + nor %3,%1,%0\;xor %3,%3,%2 + nor %3,%1,%0\;xor %3,%3,%2 nor %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: or op or rtl ior inv 0 comp 0 +;; scalar or -> xor (define_insn "*fuse_or_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ or %3,%1,%0\;xor %3,%3,%2 - or %0,%1,%0\;xor %0,%0,%2 - or %1,%1,%0\;xor %1,%1,%2 + or %3,%1,%0\;xor %3,%3,%2 + or %3,%1,%0\;xor %3,%3,%2 or %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: orc op orc rtl ior inv 0 comp 1 +;; scalar orc -> xor (define_insn "*fuse_orc_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ orc %3,%1,%0\;xor %3,%3,%2 - orc %0,%1,%0\;xor %0,%0,%2 - orc %1,%1,%0\;xor %1,%1,%2 + orc %3,%1,%0\;xor %3,%3,%2 + orc %3,%1,%0\;xor %3,%3,%2 orc %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: scalar outer: xor op xor rtl xor inv 0 comp 0 -;; inner: xor op xor rtl xor inv 0 comp 0 +;; scalar xor -> xor (define_insn "*fuse_xor_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=&r,0,1,r") - (xor:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) - (clobber (match_scratch:GPR 4 "=X,X,X,r"))] + [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + (xor:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") + (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) + (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) + (clobber (match_scratch:GPR 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ xor %3,%1,%0\;xor %3,%3,%2 - xor %0,%1,%0\;xor %0,%0,%2 - xor %1,%1,%0\;xor %1,%1,%2 + xor %3,%1,%0\;xor %3,%3,%2 + xor %3,%1,%0\;xor %3,%3,%2 xor %4,%1,%0\;xor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> vand (define_insn "*fuse_vand_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;vand %3,%3,%2 - vand %0,%1,%0\;vand %0,%0,%2 - vand %1,%1,%0\;vand %1,%1,%2 + vand %3,%1,%0\;vand %3,%3,%2 + vand %3,%1,%0\;vand %3,%3,%2 vand %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> vand (define_insn "*fuse_vandc_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;vand %3,%3,%2 - vandc %0,%1,%0\;vand %0,%0,%2 - vandc %1,%1,%0\;vand %1,%1,%2 + vandc %3,%1,%0\;vand %3,%3,%2 + vandc %3,%1,%0\;vand %3,%3,%2 vandc %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> vand (define_insn "*fuse_veqv_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;vand %3,%3,%2 - veqv %0,%1,%0\;vand %0,%0,%2 - veqv %1,%1,%0\;vand %1,%1,%2 + veqv %3,%1,%0\;vand %3,%3,%2 + veqv %3,%1,%0\;vand %3,%3,%2 veqv %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> vand (define_insn "*fuse_vnand_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;vand %3,%3,%2 - vnand %0,%1,%0\;vand %0,%0,%2 - vnand %1,%1,%0\;vand %1,%1,%2 + vnand %3,%1,%0\;vand %3,%3,%2 + vnand %3,%1,%0\;vand %3,%3,%2 vnand %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> vand (define_insn "*fuse_vnor_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;vand %3,%3,%2 - vnor %0,%1,%0\;vand %0,%0,%2 - vnor %1,%1,%0\;vand %1,%1,%2 + vnor %3,%1,%0\;vand %3,%3,%2 + vnor %3,%1,%0\;vand %3,%3,%2 vnor %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> vand (define_insn "*fuse_vor_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;vand %3,%3,%2 - vor %0,%1,%0\;vand %0,%0,%2 - vor %1,%1,%0\;vand %1,%1,%2 + vor %3,%1,%0\;vand %3,%3,%2 + vor %3,%1,%0\;vand %3,%3,%2 vor %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> vand (define_insn "*fuse_vorc_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;vand %3,%3,%2 - vorc %0,%1,%0\;vand %0,%0,%2 - vorc %1,%1,%0\;vand %1,%1,%2 + vorc %3,%1,%0\;vand %3,%3,%2 + vorc %3,%1,%0\;vand %3,%3,%2 vorc %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: and op vand rtl and inv 0 comp 0 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> vand (define_insn "*fuse_vxor_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;vand %3,%3,%2 - vxor %0,%1,%0\;vand %0,%0,%2 - vxor %1,%1,%0\;vand %1,%1,%2 + vxor %3,%1,%0\;vand %3,%3,%2 + vxor %3,%1,%0\;vand %3,%3,%2 vxor %4,%1,%0\;vand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> vandc (define_insn "*fuse_vand_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;vandc %3,%3,%2 - vand %0,%1,%0\;vandc %0,%0,%2 - vand %1,%1,%0\;vandc %1,%1,%2 + vand %3,%1,%0\;vandc %3,%3,%2 + vand %3,%1,%0\;vandc %3,%3,%2 vand %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> vandc (define_insn "*fuse_vandc_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;vandc %3,%3,%2 - vandc %0,%1,%0\;vandc %0,%0,%2 - vandc %1,%1,%0\;vandc %1,%1,%2 + vandc %3,%1,%0\;vandc %3,%3,%2 + vandc %3,%1,%0\;vandc %3,%3,%2 vandc %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> vandc (define_insn "*fuse_veqv_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;vandc %3,%3,%2 - veqv %0,%1,%0\;vandc %0,%0,%2 - veqv %1,%1,%0\;vandc %1,%1,%2 + veqv %3,%1,%0\;vandc %3,%3,%2 + veqv %3,%1,%0\;vandc %3,%3,%2 veqv %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> vandc (define_insn "*fuse_vnand_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;vandc %3,%3,%2 - vnand %0,%1,%0\;vandc %0,%0,%2 - vnand %1,%1,%0\;vandc %1,%1,%2 + vnand %3,%1,%0\;vandc %3,%3,%2 + vnand %3,%1,%0\;vandc %3,%3,%2 vnand %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> vandc (define_insn "*fuse_vnor_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;vandc %3,%3,%2 - vnor %0,%1,%0\;vandc %0,%0,%2 - vnor %1,%1,%0\;vandc %1,%1,%2 + vnor %3,%1,%0\;vandc %3,%3,%2 + vnor %3,%1,%0\;vandc %3,%3,%2 vnor %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> vandc (define_insn "*fuse_vor_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;vandc %3,%3,%2 - vor %0,%1,%0\;vandc %0,%0,%2 - vor %1,%1,%0\;vandc %1,%1,%2 + vor %3,%1,%0\;vandc %3,%3,%2 + vor %3,%1,%0\;vandc %3,%3,%2 vor %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> vandc (define_insn "*fuse_vorc_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;vandc %3,%3,%2 - vorc %0,%1,%0\;vandc %0,%0,%2 - vorc %1,%1,%0\;vandc %1,%1,%2 + vorc %3,%1,%0\;vandc %3,%3,%2 + vorc %3,%1,%0\;vandc %3,%3,%2 vorc %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: andc op vandc rtl and inv 0 comp 1 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> vandc (define_insn "*fuse_vxor_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;vandc %3,%3,%2 - vxor %0,%1,%0\;vandc %0,%0,%2 - vxor %1,%1,%0\;vandc %1,%1,%2 + vxor %3,%1,%0\;vandc %3,%3,%2 + vxor %3,%1,%0\;vandc %3,%3,%2 vxor %4,%1,%0\;vandc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> veqv (define_insn "*fuse_vand_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;veqv %3,%3,%2 - vand %0,%1,%0\;veqv %0,%0,%2 - vand %1,%1,%0\;veqv %1,%1,%2 + vand %3,%1,%0\;veqv %3,%3,%2 + vand %3,%1,%0\;veqv %3,%3,%2 vand %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> veqv (define_insn "*fuse_vandc_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;veqv %3,%3,%2 - vandc %0,%1,%0\;veqv %0,%0,%2 - vandc %1,%1,%0\;veqv %1,%1,%2 + vandc %3,%1,%0\;veqv %3,%3,%2 + vandc %3,%1,%0\;veqv %3,%3,%2 vandc %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> veqv (define_insn "*fuse_veqv_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;veqv %3,%3,%2 - veqv %0,%1,%0\;veqv %0,%0,%2 - veqv %1,%1,%0\;veqv %1,%1,%2 + veqv %3,%1,%0\;veqv %3,%3,%2 + veqv %3,%1,%0\;veqv %3,%3,%2 veqv %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> veqv (define_insn "*fuse_vnand_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;veqv %3,%3,%2 - vnand %0,%1,%0\;veqv %0,%0,%2 - vnand %1,%1,%0\;veqv %1,%1,%2 + vnand %3,%1,%0\;veqv %3,%3,%2 + vnand %3,%1,%0\;veqv %3,%3,%2 vnand %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> veqv (define_insn "*fuse_vnor_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;veqv %3,%3,%2 - vnor %0,%1,%0\;veqv %0,%0,%2 - vnor %1,%1,%0\;veqv %1,%1,%2 + vnor %3,%1,%0\;veqv %3,%3,%2 + vnor %3,%1,%0\;veqv %3,%3,%2 vnor %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> veqv (define_insn "*fuse_vor_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;veqv %3,%3,%2 - vor %0,%1,%0\;veqv %0,%0,%2 - vor %1,%1,%0\;veqv %1,%1,%2 + vor %3,%1,%0\;veqv %3,%3,%2 + vor %3,%1,%0\;veqv %3,%3,%2 vor %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> veqv (define_insn "*fuse_vorc_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;veqv %3,%3,%2 - vorc %0,%1,%0\;veqv %0,%0,%2 - vorc %1,%1,%0\;veqv %1,%1,%2 + vorc %3,%1,%0\;veqv %3,%3,%2 + vorc %3,%1,%0\;veqv %3,%3,%2 vorc %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: eqv op veqv rtl xor inv 1 comp 0 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> veqv (define_insn "*fuse_vxor_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (not:VM (xor:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (not:VM (xor:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;veqv %3,%3,%2 - vxor %0,%1,%0\;veqv %0,%0,%2 - vxor %1,%1,%0\;veqv %1,%1,%2 + vxor %3,%1,%0\;veqv %3,%3,%2 + vxor %3,%1,%0\;veqv %3,%3,%2 vxor %4,%1,%0\;veqv %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> vnand (define_insn "*fuse_vand_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;vnand %3,%3,%2 - vand %0,%1,%0\;vnand %0,%0,%2 - vand %1,%1,%0\;vnand %1,%1,%2 + vand %3,%1,%0\;vnand %3,%3,%2 + vand %3,%1,%0\;vnand %3,%3,%2 vand %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> vnand (define_insn "*fuse_vandc_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;vnand %3,%3,%2 - vandc %0,%1,%0\;vnand %0,%0,%2 - vandc %1,%1,%0\;vnand %1,%1,%2 + vandc %3,%1,%0\;vnand %3,%3,%2 + vandc %3,%1,%0\;vnand %3,%3,%2 vandc %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> vnand (define_insn "*fuse_veqv_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;vnand %3,%3,%2 - veqv %0,%1,%0\;vnand %0,%0,%2 - veqv %1,%1,%0\;vnand %1,%1,%2 + veqv %3,%1,%0\;vnand %3,%3,%2 + veqv %3,%1,%0\;vnand %3,%3,%2 veqv %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> vnand (define_insn "*fuse_vnand_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;vnand %3,%3,%2 - vnand %0,%1,%0\;vnand %0,%0,%2 - vnand %1,%1,%0\;vnand %1,%1,%2 + vnand %3,%1,%0\;vnand %3,%3,%2 + vnand %3,%1,%0\;vnand %3,%3,%2 vnand %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> vnand (define_insn "*fuse_vnor_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;vnand %3,%3,%2 - vnor %0,%1,%0\;vnand %0,%0,%2 - vnor %1,%1,%0\;vnand %1,%1,%2 + vnor %3,%1,%0\;vnand %3,%3,%2 + vnor %3,%1,%0\;vnand %3,%3,%2 vnor %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> vnand (define_insn "*fuse_vor_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;vnand %3,%3,%2 - vor %0,%1,%0\;vnand %0,%0,%2 - vor %1,%1,%0\;vnand %1,%1,%2 + vor %3,%1,%0\;vnand %3,%3,%2 + vor %3,%1,%0\;vnand %3,%3,%2 vor %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> vnand (define_insn "*fuse_vorc_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;vnand %3,%3,%2 - vorc %0,%1,%0\;vnand %0,%0,%2 - vorc %1,%1,%0\;vnand %1,%1,%2 + vorc %3,%1,%0\;vnand %3,%3,%2 + vorc %3,%1,%0\;vnand %3,%3,%2 vorc %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nand op vnand rtl ior inv 0 comp 3 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> vnand (define_insn "*fuse_vxor_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;vnand %3,%3,%2 - vxor %0,%1,%0\;vnand %0,%0,%2 - vxor %1,%1,%0\;vnand %1,%1,%2 + vxor %3,%1,%0\;vnand %3,%3,%2 + vxor %3,%1,%0\;vnand %3,%3,%2 vxor %4,%1,%0\;vnand %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> vnor (define_insn "*fuse_vand_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;vnor %3,%3,%2 - vand %0,%1,%0\;vnor %0,%0,%2 - vand %1,%1,%0\;vnor %1,%1,%2 + vand %3,%1,%0\;vnor %3,%3,%2 + vand %3,%1,%0\;vnor %3,%3,%2 vand %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> vnor (define_insn "*fuse_vandc_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;vnor %3,%3,%2 - vandc %0,%1,%0\;vnor %0,%0,%2 - vandc %1,%1,%0\;vnor %1,%1,%2 + vandc %3,%1,%0\;vnor %3,%3,%2 + vandc %3,%1,%0\;vnor %3,%3,%2 vandc %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> vnor (define_insn "*fuse_veqv_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;vnor %3,%3,%2 - veqv %0,%1,%0\;vnor %0,%0,%2 - veqv %1,%1,%0\;vnor %1,%1,%2 + veqv %3,%1,%0\;vnor %3,%3,%2 + veqv %3,%1,%0\;vnor %3,%3,%2 veqv %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> vnor (define_insn "*fuse_vnand_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;vnor %3,%3,%2 - vnand %0,%1,%0\;vnor %0,%0,%2 - vnand %1,%1,%0\;vnor %1,%1,%2 + vnand %3,%1,%0\;vnor %3,%3,%2 + vnand %3,%1,%0\;vnor %3,%3,%2 vnand %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> vnor (define_insn "*fuse_vnor_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;vnor %3,%3,%2 - vnor %0,%1,%0\;vnor %0,%0,%2 - vnor %1,%1,%0\;vnor %1,%1,%2 + vnor %3,%1,%0\;vnor %3,%3,%2 + vnor %3,%1,%0\;vnor %3,%3,%2 vnor %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> vnor (define_insn "*fuse_vor_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;vnor %3,%3,%2 - vor %0,%1,%0\;vnor %0,%0,%2 - vor %1,%1,%0\;vnor %1,%1,%2 + vor %3,%1,%0\;vnor %3,%3,%2 + vor %3,%1,%0\;vnor %3,%3,%2 vor %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> vnor (define_insn "*fuse_vorc_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;vnor %3,%3,%2 - vorc %0,%1,%0\;vnor %0,%0,%2 - vorc %1,%1,%0\;vnor %1,%1,%2 + vorc %3,%1,%0\;vnor %3,%3,%2 + vorc %3,%1,%0\;vnor %3,%3,%2 vorc %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: nor op vnor rtl and inv 0 comp 3 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> vnor (define_insn "*fuse_vxor_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;vnor %3,%3,%2 - vxor %0,%1,%0\;vnor %0,%0,%2 - vxor %1,%1,%0\;vnor %1,%1,%2 + vxor %3,%1,%0\;vnor %3,%3,%2 + vxor %3,%1,%0\;vnor %3,%3,%2 vxor %4,%1,%0\;vnor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> vor (define_insn "*fuse_vand_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;vor %3,%3,%2 - vand %0,%1,%0\;vor %0,%0,%2 - vand %1,%1,%0\;vor %1,%1,%2 + vand %3,%1,%0\;vor %3,%3,%2 + vand %3,%1,%0\;vor %3,%3,%2 vand %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> vor (define_insn "*fuse_vandc_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;vor %3,%3,%2 - vandc %0,%1,%0\;vor %0,%0,%2 - vandc %1,%1,%0\;vor %1,%1,%2 + vandc %3,%1,%0\;vor %3,%3,%2 + vandc %3,%1,%0\;vor %3,%3,%2 vandc %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> vor (define_insn "*fuse_veqv_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;vor %3,%3,%2 - veqv %0,%1,%0\;vor %0,%0,%2 - veqv %1,%1,%0\;vor %1,%1,%2 + veqv %3,%1,%0\;vor %3,%3,%2 + veqv %3,%1,%0\;vor %3,%3,%2 veqv %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> vor (define_insn "*fuse_vnand_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;vor %3,%3,%2 - vnand %0,%1,%0\;vor %0,%0,%2 - vnand %1,%1,%0\;vor %1,%1,%2 + vnand %3,%1,%0\;vor %3,%3,%2 + vnand %3,%1,%0\;vor %3,%3,%2 vnand %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> vor (define_insn "*fuse_vnor_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;vor %3,%3,%2 - vnor %0,%1,%0\;vor %0,%0,%2 - vnor %1,%1,%0\;vor %1,%1,%2 + vnor %3,%1,%0\;vor %3,%3,%2 + vnor %3,%1,%0\;vor %3,%3,%2 vnor %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> vor (define_insn "*fuse_vor_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;vor %3,%3,%2 - vor %0,%1,%0\;vor %0,%0,%2 - vor %1,%1,%0\;vor %1,%1,%2 + vor %3,%1,%0\;vor %3,%3,%2 + vor %3,%1,%0\;vor %3,%3,%2 vor %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> vor (define_insn "*fuse_vorc_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;vor %3,%3,%2 - vorc %0,%1,%0\;vor %0,%0,%2 - vorc %1,%1,%0\;vor %1,%1,%2 + vorc %3,%1,%0\;vor %3,%3,%2 + vorc %3,%1,%0\;vor %3,%3,%2 vorc %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: or op vor rtl ior inv 0 comp 0 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> vor (define_insn "*fuse_vxor_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;vor %3,%3,%2 - vxor %0,%1,%0\;vor %0,%0,%2 - vxor %1,%1,%0\;vor %1,%1,%2 + vxor %3,%1,%0\;vor %3,%3,%2 + vxor %3,%1,%0\;vor %3,%3,%2 vxor %4,%1,%0\;vor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> vorc (define_insn "*fuse_vand_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;vorc %3,%3,%2 - vand %0,%1,%0\;vorc %0,%0,%2 - vand %1,%1,%0\;vorc %1,%1,%2 + vand %3,%1,%0\;vorc %3,%3,%2 + vand %3,%1,%0\;vorc %3,%3,%2 vand %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> vorc (define_insn "*fuse_vandc_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;vorc %3,%3,%2 - vandc %0,%1,%0\;vorc %0,%0,%2 - vandc %1,%1,%0\;vorc %1,%1,%2 + vandc %3,%1,%0\;vorc %3,%3,%2 + vandc %3,%1,%0\;vorc %3,%3,%2 vandc %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> vorc (define_insn "*fuse_veqv_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;vorc %3,%3,%2 - veqv %0,%1,%0\;vorc %0,%0,%2 - veqv %1,%1,%0\;vorc %1,%1,%2 + veqv %3,%1,%0\;vorc %3,%3,%2 + veqv %3,%1,%0\;vorc %3,%3,%2 veqv %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> vorc (define_insn "*fuse_vnand_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;vorc %3,%3,%2 - vnand %0,%1,%0\;vorc %0,%0,%2 - vnand %1,%1,%0\;vorc %1,%1,%2 + vnand %3,%1,%0\;vorc %3,%3,%2 + vnand %3,%1,%0\;vorc %3,%3,%2 vnand %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> vorc (define_insn "*fuse_vnor_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;vorc %3,%3,%2 - vnor %0,%1,%0\;vorc %0,%0,%2 - vnor %1,%1,%0\;vorc %1,%1,%2 + vnor %3,%1,%0\;vorc %3,%3,%2 + vnor %3,%1,%0\;vorc %3,%3,%2 vnor %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> vorc (define_insn "*fuse_vor_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;vorc %3,%3,%2 - vor %0,%1,%0\;vorc %0,%0,%2 - vor %1,%1,%0\;vorc %1,%1,%2 + vor %3,%1,%0\;vorc %3,%3,%2 + vor %3,%1,%0\;vorc %3,%3,%2 vor %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> vorc (define_insn "*fuse_vorc_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;vorc %3,%3,%2 - vorc %0,%1,%0\;vorc %0,%0,%2 - vorc %1,%1,%0\;vorc %1,%1,%2 + vorc %3,%1,%0\;vorc %3,%3,%2 + vorc %3,%1,%0\;vorc %3,%3,%2 vorc %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: orc op vorc rtl ior inv 0 comp 1 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> vorc (define_insn "*fuse_vxor_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (ior:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (ior:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;vorc %3,%3,%2 - vxor %0,%1,%0\;vorc %0,%0,%2 - vxor %1,%1,%0\;vorc %1,%1,%2 + vxor %3,%1,%0\;vorc %3,%3,%2 + vxor %3,%1,%0\;vorc %3,%3,%2 vxor %4,%1,%0\;vorc %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: and op vand rtl and inv 0 comp 0 +;; vector vand -> vxor (define_insn "*fuse_vand_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vand %3,%1,%0\;vxor %3,%3,%2 - vand %0,%1,%0\;vxor %0,%0,%2 - vand %1,%1,%0\;vxor %1,%1,%2 + vand %3,%1,%0\;vxor %3,%3,%2 + vand %3,%1,%0\;vxor %3,%3,%2 vand %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: andc op vandc rtl and inv 0 comp 1 +;; vector vandc -> vxor (define_insn "*fuse_vandc_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vandc %3,%1,%0\;vxor %3,%3,%2 - vandc %0,%1,%0\;vxor %0,%0,%2 - vandc %1,%1,%0\;vxor %1,%1,%2 + vandc %3,%1,%0\;vxor %3,%3,%2 + vandc %3,%1,%0\;vxor %3,%3,%2 vandc %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: eqv op veqv rtl xor inv 1 comp 0 +;; vector veqv -> vxor (define_insn "*fuse_veqv_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ veqv %3,%1,%0\;vxor %3,%3,%2 - veqv %0,%1,%0\;vxor %0,%0,%2 - veqv %1,%1,%0\;vxor %1,%1,%2 + veqv %3,%1,%0\;vxor %3,%3,%2 + veqv %3,%1,%0\;vxor %3,%3,%2 veqv %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: nand op vnand rtl ior inv 0 comp 3 +;; vector vnand -> vxor (define_insn "*fuse_vnand_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnand %3,%1,%0\;vxor %3,%3,%2 - vnand %0,%1,%0\;vxor %0,%0,%2 - vnand %1,%1,%0\;vxor %1,%1,%2 + vnand %3,%1,%0\;vxor %3,%3,%2 + vnand %3,%1,%0\;vxor %3,%3,%2 vnand %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: nor op vnor rtl and inv 0 comp 3 +;; vector vnor -> vxor (define_insn "*fuse_vnor_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vnor %3,%1,%0\;vxor %3,%3,%2 - vnor %0,%1,%0\;vxor %0,%0,%2 - vnor %1,%1,%0\;vxor %1,%1,%2 + vnor %3,%1,%0\;vxor %3,%3,%2 + vnor %3,%1,%0\;vxor %3,%3,%2 vnor %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: or op vor rtl ior inv 0 comp 0 +;; vector vor -> vxor (define_insn "*fuse_vor_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vor %3,%1,%0\;vxor %3,%3,%2 - vor %0,%1,%0\;vxor %0,%0,%2 - vor %1,%1,%0\;vxor %1,%1,%2 + vor %3,%1,%0\;vxor %3,%3,%2 + vor %3,%1,%0\;vxor %3,%3,%2 vor %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: orc op vorc rtl ior inv 0 comp 1 +;; vector vorc -> vxor (define_insn "*fuse_vorc_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vorc %3,%1,%0\;vxor %3,%3,%2 - vorc %0,%1,%0\;vxor %0,%0,%2 - vorc %1,%1,%0\;vxor %1,%1,%2 + vorc %3,%1,%0\;vxor %3,%3,%2 + vorc %3,%1,%0\;vxor %3,%3,%2 vorc %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") (set_attr "length" "8")]) ;; logical-logical fusion pattern generated by gen_2logical -;; kind: vector outer: xor op vxor rtl xor inv 0 comp 0 -;; inner: xor op vxor rtl xor inv 0 comp 0 +;; vector vxor -> vxor (define_insn "*fuse_vxor_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=&v,0,1,v") - (xor:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) - (clobber (match_scratch:VM 4 "=X,X,X,r"))] + [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + (xor:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") + (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) + (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) + (clobber (match_scratch:VM 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ vxor %3,%1,%0\;vxor %3,%3,%2 - vxor %0,%1,%0\;vxor %0,%0,%2 - vxor %1,%1,%0\;vxor %1,%1,%2 + vxor %3,%1,%0\;vxor %3,%3,%2 + vxor %3,%1,%0\;vxor %3,%3,%2 vxor %4,%1,%0\;vxor %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") diff --git a/gcc/config/rs6000/genfusion.pl b/gcc/config/rs6000/genfusion.pl index 837af7a..e1c45f5 100755 --- a/gcc/config/rs6000/genfusion.pl +++ b/gcc/config/rs6000/genfusion.pl @@ -192,7 +192,8 @@ sub gen_2logical if ( ($inner_comp & 2) == 2 ) { $inner_arg1 = "(not:${mode} $inner_arg1)"; } - $inner_exp = "(${inner_rtl}:${mode} ${inner_arg0} ${inner_arg1})"; + $inner_exp = "(${inner_rtl}:${mode} ${inner_arg0} + ${inner_arg1})"; if ( $inner_inv == 1 ) { $inner_exp = "(not:${mode} $inner_exp)"; } @@ -203,7 +204,8 @@ sub gen_2logical if ( ($outer_comp & 2) == 2 ) { $inner_exp = "(not:${mode} $inner_exp)"; } - $outer_exp = "(${outer_rtl}:${mode} ${inner_exp} ${outer_arg2})"; + $outer_exp = "(${outer_rtl}:${mode} ${inner_exp} + ${outer_arg2})"; if ( $outer_inv == 1 ) { $outer_exp = "(not:${mode} $outer_exp)"; } @@ -211,17 +213,16 @@ sub gen_2logical $insn = <<"EOF"; ;; logical-logical fusion pattern generated by gen_2logical -;; kind: $kind outer: $outer op $outer_op rtl $outer_rtl inv $outer_inv comp $outer_comp -;; inner: $inner op $inner_op rtl $inner_rtl inv $inner_inv comp $inner_comp +;; $kind $inner_op -> $outer_op (define_insn "*fuse_${inner_op}_${outer_op}" - [(set (match_operand:${mode} 3 "${pred}" "=&${constraint},0,1,${constraint}") + [(set (match_operand:${mode} 3 "${pred}" "=0,1,&${constraint},${constraint}") ${outer_exp}) - (clobber (match_scratch:${mode} 4 "=X,X,X,r"))] + (clobber (match_scratch:${mode} 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)" "@ ${inner_op} %3,%1,%0\\;${outer_op} %3,%3,%2 - ${inner_op} %0,%1,%0\\;${outer_op} %0,%0,%2 - ${inner_op} %1,%1,%0\\;${outer_op} %1,%1,%2 + ${inner_op} %3,%1,%0\\;${outer_op} %3,%3,%2 + ${inner_op} %3,%1,%0\\;${outer_op} %3,%3,%2 ${inner_op} %4,%1,%0\\;${outer_op} %3,%4,%2" [(set_attr "type" "logical") (set_attr "cost" "6") diff --git a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000 index e3a58bf..1541a65 100644 --- a/gcc/config/rs6000/t-rs6000 +++ b/gcc/config/rs6000/t-rs6000 @@ -47,8 +47,8 @@ rs6000-call.o: $(srcdir)/config/rs6000/rs6000-call.c $(COMPILE) $< $(POSTCOMPILE) -$(srcdir)/config/rs6000/fusion.md: $(srcdir)/config/rs6000/genfusion.pl - $(srcdir)/config/rs6000/genfusion.pl > $(srcdir)/config/rs6000/fusion.md +#$(srcdir)/config/rs6000/fusion.md: $(srcdir)/config/rs6000/genfusion.pl +# $(srcdir)/config/rs6000/genfusion.pl > $(srcdir)/config/rs6000/fusion.md $(srcdir)/config/rs6000/rs6000-tables.opt: $(srcdir)/config/rs6000/genopt.sh \ $(srcdir)/config/rs6000/rs6000-cpus.def diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bac41f1..de69476 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2021-02-02 Jason Merrill <jason@redhat.com> + + PR c++/98929 + PR c++/96199 + * error.c (dump_expr): Ignore dummy object. + * pt.c (tsubst_baselink): Handle dependent scope. + 2021-02-01 Patrick Palka <ppalka@redhat.com> PR c++/98295 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index abadaf9..5da8670 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -25026,8 +25026,8 @@ cp_parser_class_specifier_1 (cp_parser* parser) pushed_scope = push_scope (class_type); } - tree spec = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl)); - spec = TREE_PURPOSE (spec); + tree def_parse = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl)); + def_parse = TREE_PURPOSE (def_parse); /* Make sure that any template parameters are in scope. */ maybe_begin_member_template_processing (decl); @@ -25044,7 +25044,7 @@ cp_parser_class_specifier_1 (cp_parser* parser) parser->local_variables_forbidden_p |= THIS_FORBIDDEN; /* Now we can parse the noexcept-specifier. */ - spec = cp_parser_late_noexcept_specifier (parser, spec); + tree spec = cp_parser_late_noexcept_specifier (parser, def_parse); if (spec == error_mark_node) spec = NULL_TREE; @@ -25052,6 +25052,12 @@ cp_parser_class_specifier_1 (cp_parser* parser) /* Update the fn's type directly -- it might have escaped beyond this decl :( */ fixup_deferred_exception_variants (TREE_TYPE (decl), spec); + /* Update any instantiations we've already created. We must + keep the new noexcept-specifier wrapped in a DEFERRED_NOEXCEPT + so that maybe_instantiate_noexcept can tsubst the NOEXCEPT_EXPR + in the pattern. */ + for (tree i : DEFPARSE_INSTANTIATIONS (def_parse)) + DEFERRED_NOEXCEPT_PATTERN (TREE_PURPOSE (i)) = TREE_PURPOSE (spec); /* Restore the state of local_variables_forbidden_p. */ parser->local_variables_forbidden_p = local_variables_forbidden_p; @@ -26695,6 +26701,7 @@ cp_parser_save_noexcept (cp_parser *parser) /* Save away the noexcept-specifier; we will process it when the class is complete. */ DEFPARSE_TOKENS (expr) = cp_token_cache_new (first, last); + DEFPARSE_INSTANTIATIONS (expr) = nullptr; expr = build_tree_list (expr, NULL_TREE); return expr; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index aa1687a..4781519 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15189,6 +15189,22 @@ tsubst_exception_specification (tree fntype, /*integral_constant_expression_p=*/true); } new_specs = build_noexcept_spec (new_specs, complain); + /* We've instantiated a template before a noexcept-specifier + contained therein has been parsed. This can happen for + a nested template class: + + struct S { + template<typename> struct B { B() noexcept(...); }; + struct A : B<int> { ... use B() ... }; + }; + + where completing B<int> will trigger instantiating the + noexcept, even though we only parse it at the end of S. */ + if (UNPARSED_NOEXCEPT_SPEC_P (specs)) + { + gcc_checking_assert (defer_ok); + vec_safe_push (DEFPARSE_INSTANTIATIONS (expr), new_specs); + } } else if (specs) { diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 2e5a1f1..e6ced27 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2738,8 +2738,7 @@ fixup_deferred_exception_variants (tree type, tree raises) tree original = TYPE_RAISES_EXCEPTIONS (type); tree cr = flag_noexcept_type ? canonical_eh_spec (raises) : NULL_TREE; - gcc_checking_assert (TREE_CODE (TREE_PURPOSE (original)) - == DEFERRED_PARSE); + gcc_checking_assert (UNPARSED_NOEXCEPT_SPEC_P (original)); /* Though sucky, this walk will process the canonical variants first. */ diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index 83dfb28..354f65f 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,8 @@ +2021-02-02 Iain Buclaw <ibuclaw@gdcproject.org> + + PR d/98921 + * dmd/MERGE: Merge upstream dmd 5e2a81d9c. + 2021-01-30 Iain Buclaw <ibuclaw@gdcproject.org> * typeinfo.cc (TypeInfoVisitor::visit (TypeInfoDeclaration *)): Don't diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index c9baca8..5de3b2c 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see #include "dependency.h" #include "constructor.h" #include "arith.h" +#include "options.h" /* static declarations */ /* Enums */ @@ -2142,9 +2143,17 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse, return (fin_dep == GFC_DEP_OVERLAP) ? 1 : 0; case REF_ARRAY: - - /* For now, treat all coarrays as dangerous. */ - if (lref->u.ar.codimen || rref->u.ar.codimen) + /* Coarrays: If there is a coindex, either the image differs and there + is no overlap or the image is the same - then the normal analysis + applies. Hence, return early only if 'identical' is required and + either ref is coindexed and more than one image can exist. */ + if (identical && flag_coarray != GFC_FCOARRAY_SINGLE + && ((lref->u.ar.codimen + && lref->u.ar.dimen_type[lref->u.ar.dimen] + != DIMEN_THIS_IMAGE) + || (rref->u.ar.codimen + && lref->u.ar.dimen_type[lref->u.ar.dimen] + != DIMEN_THIS_IMAGE))) return 1; if (ref_same_as_full_array (lref, rref)) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index cb12c83a..905c6fe 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -271a043537f2f0ae93bde2cf4f4897e68a476ece +78770fd9c29037dec8b2919c0f02067915c6ad33 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 1480a94a..b467eb5 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -885,6 +885,60 @@ noce_emit_store_flag (struct noce_if_info *if_info, rtx x, int reversep, || code == GEU || code == GTU), normalize); } +/* Return true if X can be safely forced into a register by copy_to_mode_reg + / force_operand. */ + +static bool +noce_can_force_operand (rtx x) +{ + if (general_operand (x, VOIDmode)) + return true; + if (SUBREG_P (x)) + { + if (!noce_can_force_operand (SUBREG_REG (x))) + return false; + return true; + } + if (ARITHMETIC_P (x)) + { + if (!noce_can_force_operand (XEXP (x, 0)) + || !noce_can_force_operand (XEXP (x, 1))) + return false; + switch (GET_CODE (x)) + { + case MULT: + case DIV: + case MOD: + case UDIV: + case UMOD: + return true; + default: + return code_to_optab (GET_CODE (x)); + } + } + if (UNARY_P (x)) + { + if (!noce_can_force_operand (XEXP (x, 0))) + return false; + switch (GET_CODE (x)) + { + case ZERO_EXTEND: + case SIGN_EXTEND: + case TRUNCATE: + case FLOAT_EXTEND: + case FLOAT_TRUNCATE: + case FIX: + case UNSIGNED_FIX: + case FLOAT: + case UNSIGNED_FLOAT: + return true; + default: + return code_to_optab (GET_CODE (x)); + } + } + return false; +} + /* Emit instruction to move an rtx, possibly into STRICT_LOW_PART. X is the destination/target and Y is the value to copy. */ @@ -943,7 +997,7 @@ noce_emit_move_insn (rtx x, rtx y) { case RTX_UNARY: ot = code_to_optab (GET_CODE (y)); - if (ot) + if (ot && noce_can_force_operand (XEXP (y, 0))) { start_sequence (); target = expand_unop (GET_MODE (y), ot, XEXP (y, 0), x, 0); @@ -960,7 +1014,9 @@ noce_emit_move_insn (rtx x, rtx y) case RTX_BIN_ARITH: case RTX_COMM_ARITH: ot = code_to_optab (GET_CODE (y)); - if (ot) + if (ot + && noce_can_force_operand (XEXP (y, 0)) + && noce_can_force_operand (XEXP (y, 1))) { start_sequence (); target = expand_binop (GET_MODE (y), ot, @@ -2763,15 +2819,18 @@ noce_try_sign_mask (struct noce_if_info *if_info) INSN_B which can happen for e.g. conditional stores to memory. For the cost computation use the block TEST_BB where the evaluation will end up after the transformation. */ - t_unconditional = - (t == if_info->b - && (if_info->insn_b == NULL_RTX - || BLOCK_FOR_INSN (if_info->insn_b) == if_info->test_bb)); + t_unconditional + = (t == if_info->b + && (if_info->insn_b == NULL_RTX + || BLOCK_FOR_INSN (if_info->insn_b) == if_info->test_bb)); if (!(t_unconditional || (set_src_cost (t, mode, if_info->speed_p) < COSTS_N_INSNS (2)))) return FALSE; + if (!noce_can_force_operand (t)) + return FALSE; + start_sequence (); /* Use emit_store_flag to generate "m < 0 ? -1 : 0" instead of expanding "(signed) m >> 31" directly. This benefits targets with specialized diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index e739a46..6a5aa41 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3106,8 +3106,13 @@ process_alt_operands (int only_alternative) && operand_reg[j] != NULL_RTX && HARD_REGISTER_P (operand_reg[j]) && REG_USERVAR_P (operand_reg[j])) - fatal_insn ("unable to generate reloads for " - "impossible constraints:", curr_insn); + { + /* For asm, let curr_insn_transform diagnose it. */ + if (INSN_CODE (curr_insn) < 0) + return false; + fatal_insn ("unable to generate reloads for " + "impossible constraints:", curr_insn); + } } if (last_conflict_j < 0) continue; diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index 26f56b2..01bd825 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -431,7 +431,7 @@ remove_pseudos (rtx *loc, rtx_insn *insn) alter_subreg (loc, false); if (GET_CODE (*loc) == MEM) { - lra_get_insn_recog_data (insn)->used_insn_alternative = -1; + lra_update_insn_recog_data (insn); if (lra_dump_file != NULL) fprintf (lra_dump_file, "Memory subreg was simplified in insn #%u\n", diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 405f3bf..a26d488 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2670,7 +2670,7 @@ produce_lto_section () bool slim_object = flag_generate_lto && !flag_fat_lto_objects; lto_section s - = { LTO_major_version, LTO_minor_version, slim_object, 0 }; + = { LTO_major_version, LTO_minor_version, slim_object, 0, 0 }; s.set_compression (compression); lto_write_data (&s, sizeof s); lto_end_section (); diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c index 36e6735..84db5eb 100644 --- a/gcc/lto-streamer.c +++ b/gcc/lto-streamer.c @@ -106,6 +106,7 @@ lto_get_section_name (int section_type, const char *name, const char *add; char post[32]; const char *sep; + char *buffer = NULL; if (section_type == LTO_section_function_body) { @@ -113,7 +114,7 @@ lto_get_section_name (int section_type, const char *name, if (name[0] == '*') name++; - char *buffer = (char *)xmalloc (strlen (name) + 32); + buffer = (char *)xmalloc (strlen (name) + 32); sprintf (buffer, "%s.%d", name, node_order); add = buffer; @@ -138,7 +139,10 @@ lto_get_section_name (int section_type, const char *name, sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, f->id); else sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, get_random_seed (false)); - return concat (section_name_prefix, sep, add, post, NULL); + char *res = concat (section_name_prefix, sep, add, post, NULL); + if (buffer) + free (buffer); + return res; } diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 7736ae7..5c7cd84 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -369,6 +369,7 @@ struct lto_section int16_t major_version; int16_t minor_version; unsigned char slim_object; + unsigned char _padding; /* Flags is a private field that is not defined publicly. */ uint16_t flags; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0614da1..a0c6e73 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,73 @@ +2021-02-02 Martin Liska <mliska@suse.cz> + + PR target/97510 + * gcc.target/i386/pr97510.c: New test. + +2021-02-02 Jason Merrill <jason@redhat.com> + + PR c++/98929 + * g++.dg/cpp1z/class-deduction-decltype1.C: New test. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/narrow_high-intrinsics.c: Adjust sqxtun2 scan. + +2021-02-02 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/91862 + * gfortran.dg/pr91862.f90: New test. + +2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/arg-type-diagnostics-1.c: Return result from foo. + +2021-02-02 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/98848 + * gcc.dg/vect/pr98848.c: New test. + * gcc.dg/vect/pr92205.c: Remove xfail. + +2021-02-02 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/97960 + * g++.dg/torture/pr97960.C: New test. + +2021-02-02 Kito Cheng <kito.cheng@sifive.com> + + PR target/98743 + * g++.dg/opt/pr98743.C: New. + +2021-02-02 Christophe Lyon <christophe.lyon@linaro.org> + + * gcc.target/arm/simd/mve-vorn.c: Add vorn tests. + +2021-02-02 Alexandre Oliva <oliva@adacore.com> + + * gcc.dg/asan/nested-1.c: New. + +2021-02-02 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/93355 + PR analyzer/96374 + * gcc.dg/analyzer/conditionals-3.c: Add "__analyzer_" + prefix to support subroutines where necessary. + * gcc.dg/analyzer/data-model-1.c: Likewise. + * gcc.dg/analyzer/feasibility-1.c (called_by_test_6a): New. + (test_6a): New. + * gcc.dg/analyzer/params.c: Add "__analyzer_" prefix to support + subroutines where necessary. + * gcc.dg/analyzer/pr96651-2.c: Likewise. + * gcc.dg/analyzer/signal-4b.c: Likewise. + * gcc.dg/analyzer/single-field.c: Likewise. + * gcc.dg/analyzer/torture/conditionals-2.c: Likewise. + +2021-02-02 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/93355 + PR analyzer/96374 + * gcc.dg/analyzer/pr93355-localealias-feasibility-2.c: New test. + * gcc.dg/analyzer/pr93355-localealias-feasibility-3.c: New test. + 2021-02-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * gcc.target/aarch64/narrow_high-intrinsics.c: Adjust rshrn2 diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept65.C b/gcc/testsuite/g++.dg/cpp0x/noexcept65.C new file mode 100644 index 0000000..f593377 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept65.C @@ -0,0 +1,35 @@ +// PR c++/98899 +// { dg-do compile { target c++11 } } + +template <int __v> struct integral_constant { + static constexpr int value = __v; +}; + +struct S { + template<class> struct B { + B() noexcept(noexcept(x)); + int x; + }; + struct A : B<int> { + A() : B() {} + }; +}; + +struct S2 { + template<class> struct B { + B() noexcept(integral_constant<false>::value); + }; + struct A : B<int> { + A() : B() {} + }; +}; + +struct S3 { + template<class> struct B { + B() noexcept(b); + }; + struct A : B<int> { + A() : B() {} + }; + static constexpr bool b = false; +}; diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address11.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address11.C new file mode 100644 index 0000000..9ca6184 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address11.C @@ -0,0 +1,18 @@ +// PR c++/97804 +// { dg-do compile { target c++17 } } + +template <typename a> struct b { + constexpr b() : c() {} + [[no_unique_address]] a c; +}; +template <unsigned long, typename...> struct d; +template <unsigned long e, typename a, typename... f> +struct d<e, a, f...> : d<1, f...>, b<a> {}; +template <unsigned long e, typename a> struct d<e, a> : b<a> {}; +template <typename... g> class h : d<0, g...> {}; +struct i {}; +class j { + using k = int; + h<k, i> l; + float m = 0.025f; +} n; diff --git a/gcc/testsuite/gcc.dg/pr97487-1.c b/gcc/testsuite/gcc.dg/pr97487-1.c new file mode 100644 index 0000000..e79d1f1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr97487-1.c @@ -0,0 +1,9 @@ +/* PR middle-end/97487 */ +/* { dg-do compile } */ +/* { dg-options "-O2 --param max-rtl-if-conversion-unpredictable-cost=0" } */ + +long int __attribute__ ((simd)) +foo (long int x, long int y) +{ + return x < 0 ? y : 0; +} diff --git a/gcc/testsuite/gcc.dg/pr97487-2.c b/gcc/testsuite/gcc.dg/pr97487-2.c new file mode 100644 index 0000000..0b62381 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr97487-2.c @@ -0,0 +1,18 @@ +/* PR middle-end/97487 */ +/* { dg-do compile } */ +/* { dg-options "-O2 --param max-rtl-if-conversion-unpredictable-cost=0 -Wno-psabi -w" } */ + +typedef long long int V __attribute__((vector_size (16))); + +long long int +foo (V x, V y) +{ + long long int t1 = y[0]; + long long int t2 = x[0]; + long long int t3; + if (t2 < 0) + t3 = t1; + else + t3 = 0; + return t3; +} diff --git a/gcc/testsuite/gcc.dg/pr98287.c b/gcc/testsuite/gcc.dg/pr98287.c new file mode 100644 index 0000000..0314428 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr98287.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/98287 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-ccp -fno-tree-forwprop -Wno-psabi -w" } */ + +typedef unsigned long __attribute__((__vector_size__ (8))) V; +V v; + +static __attribute__((noinline, noclone)) V +bar (unsigned short s) +{ + return v >> s << s | v >> s >> 63; +} + +unsigned long +foo (void) +{ + V x = bar (1); + return x[0]; +} diff --git a/gcc/testsuite/gcc.target/i386/pr97971.c b/gcc/testsuite/gcc.target/i386/pr97971.c new file mode 100644 index 0000000..d07a310 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr97971.c @@ -0,0 +1,12 @@ +/* PR middle-end/97971 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +foo (void) +{ + register _Complex long a asm ("rax"); + register int b asm ("rdx"); + asm ("# %0 %1" : "=&r" (a), "=r" (b)); /* { dg-error "inconsistent operand constraints in an 'asm'" } */ + return a; +} diff --git a/gcc/testsuite/gcc.target/i386/pr98928.c b/gcc/testsuite/gcc.target/i386/pr98928.c new file mode 100644 index 0000000..9503b57 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr98928.c @@ -0,0 +1,59 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-Ofast -march=skylake-avx512 -fwhole-program -w" } */ + +typedef float MagickRealType; +typedef short Quantum; +float InterpolateMagickPixelPacket_alpha[1]; +int InterpolateMagickPixelPacket_i; + +void InterpolateMagickPixelPacket(); + +void main() { InterpolateMagickPixelPacket(); } + +typedef struct { + MagickRealType red, green, blue, opacity, index; +} MagickPixelPacket; +typedef struct { + Quantum blue, green, red, opacity; +} PixelPacket; +struct _Image { + int colorspace; + int matte; +} GetMagickPixelPacket(MagickPixelPacket *pixel) { + pixel->red = pixel->green = pixel->blue = 0.0; +} +int AlphaBlendMagickPixelPacket(struct _Image *image, PixelPacket *color, + Quantum *indexes, MagickPixelPacket *pixel, + MagickRealType *alpha) { + if (image->matte) { + *alpha = pixel->red = pixel->green = pixel->blue = pixel->opacity = + color->opacity; + pixel->index = 0.0; + if (image->colorspace) + pixel->index = *indexes; + return 0; + } + *alpha = 1.0 / 0.2; + pixel->red = *alpha * color->red; + pixel->green = *alpha * color->green; + pixel->blue = *alpha * color->blue; + pixel->opacity = pixel->index = 0.0; + if (image->colorspace && indexes) + pixel->index = *indexes; +} +MagickPixelPacket InterpolateMagickPixelPacket_pixels[1]; +PixelPacket InterpolateMagickPixelPacket_p; + +void +InterpolateMagickPixelPacket(struct _Image *image) { + Quantum *indexes; + for (; InterpolateMagickPixelPacket_i; InterpolateMagickPixelPacket_i++) { + GetMagickPixelPacket(InterpolateMagickPixelPacket_pixels + + InterpolateMagickPixelPacket_i); + AlphaBlendMagickPixelPacket( + image, &InterpolateMagickPixelPacket_p + InterpolateMagickPixelPacket_i, + indexes + InterpolateMagickPixelPacket_i, + InterpolateMagickPixelPacket_pixels + InterpolateMagickPixelPacket_i, + InterpolateMagickPixelPacket_alpha + InterpolateMagickPixelPacket_i); + } +} diff --git a/gcc/testsuite/gfortran.dg/coarray/array_temporary.f90 b/gcc/testsuite/gfortran.dg/coarray/array_temporary.f90 new file mode 100644 index 0000000..86460a7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray/array_temporary.f90 @@ -0,0 +1,74 @@ +! { dg-do compile } +! { dg-additional-options "-Warray-temporaries" } +! +! PR fortran/98913 +! +! Contributed by Jorge D'Elia +! +! Did create an array temporary for local access to coarray +! (but not for identical noncoarray use). +! + +program test + implicit none + integer, parameter :: iin = kind (1) + integer, parameter :: idp = kind (1.0d0) + real (kind=idp), allocatable :: AA (:,:)[:] + real (kind=idp), allocatable :: BB (:,:) + real (kind=idp), allocatable :: UU (:) + integer (kind=iin) :: nn, n1, n2 + integer (kind=iin) :: j, k, k1 + ! + nn = 5 + n1 = 1 + n2 = 10 + ! + allocate (AA (1:nn,n1:n2)[*]) + allocate (BB (1:nn,n1:n2)) + allocate (UU (1:nn)) + ! + k = 1 + k1 = k + 1 + ! + AA = 1.0_idp + BB = 1.0_idp + UU = 2.0_idp + + ! AA - coarrays + ! No temporary needed: + do j = 1, nn + AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j) ! { dg-bogus "Creating array temporary" } + end do + do j = 1, nn + AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j) - UU(k) * AA (k1-1:nn-1,j) ! { dg-bogus "Creating array temporary" } + end do + do j = 1, nn + AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j) - UU(k) * AA (k1+1:nn+1,j) ! { dg-bogus "Creating array temporary" } + end do + + ! But: + do j = 1, nn + AA (k1:nn,j) = AA (k1-1:nn-1,j) - UU (k1:nn) * AA (k,j) - UU(k) * AA (k1+1:nn+1,j) ! { dg-warning "Creating array temporary" } + end do + + ! BB - no coarrays + ! No temporary needed: + do j = 1, nn + BB (k1:nn,j) = BB (k1:nn,j) - UU (k1:nn) * BB (k,j) ! { dg-bogus "Creating array temporary" } + end do + do j = 1, nn + BB (k1:nn,j) = BB (k1:nn,j) - UU (k1:nn) * BB (k,j) - UU(k) * BB (k1-1:nn-1,j) ! { dg-bogus "Creating array temporary" } + end do + do j = 1, nn + BB (k1:nn,j) = BB (k1:nn,j) - UU (k1:nn) * BB (k,j) - UU(k) * BB (k1+1:nn+1,j) ! { dg-bogus "Creating array temporary" } + end do + + ! But: + do j = 1, nn + BB (k1:nn,j) = BB (k1-1:nn-1,j) - UU (k1:nn) * BB (k,j) - UU(k) * BB (k1+1:nn+1,j) ! { dg-warning "Creating array temporary" } + end do + + deallocate (AA) + deallocate (BB) + deallocate (UU) +end program test diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index bb15fd3..7ee19fc 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -2358,6 +2358,7 @@ loop_distribution::merge_dep_scc_partitions (struct graph *rdg, sort_partitions_by_post_order (pg, partitions); gcc_assert (partitions->length () == (unsigned)num_sccs); free_partition_graph_vdata (pg); + for_each_edge (pg, free_partition_graph_edata_cb, NULL); free_graph (pg); } diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index acfd195..200ed27 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2700,7 +2700,7 @@ again: { stmt_vec_info pattern_stmt_info = STMT_VINFO_RELATED_STMT (stmt_info); - if (STMT_VINFO_SLP_VECT_ONLY (pattern_stmt_info)) + if (STMT_VINFO_SLP_VECT_ONLY_PATTERN (pattern_stmt_info)) STMT_VINFO_IN_PATTERN_P (stmt_info) = false; gimple *pattern_def_seq = STMT_VINFO_PATTERN_DEF_SEQ (stmt_info); diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c index d25560f..f0817da 100644 --- a/gcc/tree-vect-slp-patterns.c +++ b/gcc/tree-vect-slp-patterns.c @@ -599,7 +599,7 @@ complex_pattern::build (vec_info *vinfo) the call there. */ vect_mark_pattern_stmts (vinfo, stmt_info, call_stmt, SLP_TREE_VECTYPE (node)); - STMT_VINFO_SLP_VECT_ONLY (call_stmt_info) = true; + STMT_VINFO_SLP_VECT_ONLY_PATTERN (call_stmt_info) = true; /* Since we are replacing all the statements in the group with the same thing it doesn't really matter. So just set it every time a new stmt diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index f8bf448..e564fcf 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1215,6 +1215,10 @@ public: /* True if this is only suitable for SLP vectorization. */ bool slp_vect_only_p; + + /* True if this is a pattern that can only be handled by SLP + vectorization. */ + bool slp_vect_pattern_only_p; }; /* Information about a gather/scatter call. */ @@ -1301,6 +1305,7 @@ struct gather_scatter_info { #define STMT_VINFO_REDUC_VECTYPE(S) (S)->reduc_vectype #define STMT_VINFO_REDUC_VECTYPE_IN(S) (S)->reduc_vectype_in #define STMT_VINFO_SLP_VECT_ONLY(S) (S)->slp_vect_only_p +#define STMT_VINFO_SLP_VECT_ONLY_PATTERN(S) (S)->slp_vect_pattern_only_p #define DR_GROUP_FIRST_ELEMENT(S) \ (gcc_checking_assert ((S)->dr_aux.dr), (S)->first_element) diff --git a/gotools/ChangeLog b/gotools/ChangeLog index 754fd6b..e8e2495 100644 --- a/gotools/ChangeLog +++ b/gotools/ChangeLog @@ -1,3 +1,11 @@ +2021-02-02 Ian Lance Taylor <iant@golang.org> + + * Makefile.am (check-embed): New target. + (check): Depend on check-embed. Examine embed-testlog. + (mostlyclean-local): Add check-embed-dir. + (.PHONY): Add check-embed. + * Makefile.in: Regenerate. + 2020-12-30 Ian Lance Taylor <iant@golang.org> * Makefile.am (check-runtime): Don't create check-runtime-dir. diff --git a/libgo/Makefile.am b/libgo/Makefile.am index 7be90a5..eea7ff1 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -130,6 +130,7 @@ toolexeclibgo_DATA = \ bytes.gox \ context.gox \ crypto.gox \ + embed.gox \ encoding.gox \ errors.gox \ expvar.gox \ @@ -256,6 +257,11 @@ toolexeclibgogo_DATA = \ go/token.gox \ go/types.gox +toolexeclibgogobuilddir = $(toolexeclibgogodir)/build + +toolexeclibgogobuild_DATA = \ + go/build/constraint.gox + toolexeclibgohashdir = $(toolexeclibgodir)/hash toolexeclibgohash_DATA = \ @@ -292,6 +298,7 @@ toolexeclibgoindex_DATA = \ toolexeclibgoiodir = $(toolexeclibgodir)/io toolexeclibgoio_DATA = \ + io/fs.gox \ io/ioutil.gox toolexeclibgologdir = $(toolexeclibgodir)/log @@ -360,6 +367,7 @@ toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime toolexeclibgoruntime_DATA = \ runtime/debug.gox \ + runtime/metrics.gox \ runtime/pprof.gox \ runtime/trace.gox @@ -371,6 +379,7 @@ toolexeclibgosync_DATA = \ toolexeclibgotestingdir = $(toolexeclibgodir)/testing toolexeclibgotesting_DATA = \ + testing/fstest.gox \ testing/iotest.gox \ testing/quick.gox diff --git a/libgo/Makefile.in b/libgo/Makefile.in index c52723b..8938eba 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -169,6 +169,7 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ "$(DESTDIR)$(toolexeclibgodebugdir)" \ "$(DESTDIR)$(toolexeclibgoencodingdir)" \ "$(DESTDIR)$(toolexeclibgogodir)" \ + "$(DESTDIR)$(toolexeclibgogobuilddir)" \ "$(DESTDIR)$(toolexeclibgohashdir)" \ "$(DESTDIR)$(toolexeclibgohtmldir)" \ "$(DESTDIR)$(toolexeclibgoimagedir)" \ @@ -335,16 +336,16 @@ DATA = $(noinst_DATA) $(toolexeclibgo_DATA) \ $(toolexeclibgocryptox509_DATA) $(toolexeclibgodatabase_DATA) \ $(toolexeclibgodatabasesql_DATA) $(toolexeclibgodebug_DATA) \ $(toolexeclibgoencoding_DATA) $(toolexeclibgogo_DATA) \ - $(toolexeclibgohash_DATA) $(toolexeclibgohtml_DATA) \ - $(toolexeclibgoimage_DATA) $(toolexeclibgoimagecolor_DATA) \ - $(toolexeclibgoindex_DATA) $(toolexeclibgointernal_DATA) \ - $(toolexeclibgoio_DATA) $(toolexeclibgolog_DATA) \ - $(toolexeclibgomath_DATA) $(toolexeclibgomime_DATA) \ - $(toolexeclibgonet_DATA) $(toolexeclibgonethttp_DATA) \ - $(toolexeclibgonetrpc_DATA) $(toolexeclibgoos_DATA) \ - $(toolexeclibgopath_DATA) $(toolexeclibgoregexp_DATA) \ - $(toolexeclibgoruntime_DATA) $(toolexeclibgosync_DATA) \ - $(toolexeclibgotesting_DATA) \ + $(toolexeclibgogobuild_DATA) $(toolexeclibgohash_DATA) \ + $(toolexeclibgohtml_DATA) $(toolexeclibgoimage_DATA) \ + $(toolexeclibgoimagecolor_DATA) $(toolexeclibgoindex_DATA) \ + $(toolexeclibgointernal_DATA) $(toolexeclibgoio_DATA) \ + $(toolexeclibgolog_DATA) $(toolexeclibgomath_DATA) \ + $(toolexeclibgomime_DATA) $(toolexeclibgonet_DATA) \ + $(toolexeclibgonethttp_DATA) $(toolexeclibgonetrpc_DATA) \ + $(toolexeclibgoos_DATA) $(toolexeclibgopath_DATA) \ + $(toolexeclibgoregexp_DATA) $(toolexeclibgoruntime_DATA) \ + $(toolexeclibgosync_DATA) $(toolexeclibgotesting_DATA) \ $(toolexeclibgotestinginternal_DATA) $(toolexeclibgotext_DATA) \ $(toolexeclibgotexttemplate_DATA) $(toolexeclibgotime_DATA) \ $(toolexeclibgounicode_DATA) @@ -628,6 +629,7 @@ toolexeclibgo_DATA = \ bytes.gox \ context.gox \ crypto.gox \ + embed.gox \ encoding.gox \ errors.gox \ expvar.gox \ @@ -744,6 +746,10 @@ toolexeclibgogo_DATA = \ go/token.gox \ go/types.gox +toolexeclibgogobuilddir = $(toolexeclibgogodir)/build +toolexeclibgogobuild_DATA = \ + go/build/constraint.gox + toolexeclibgohashdir = $(toolexeclibgodir)/hash toolexeclibgohash_DATA = \ hash/adler32.gox \ @@ -774,6 +780,7 @@ toolexeclibgoindex_DATA = \ toolexeclibgoiodir = $(toolexeclibgodir)/io toolexeclibgoio_DATA = \ + io/fs.gox \ io/ioutil.gox toolexeclibgologdir = $(toolexeclibgodir)/log @@ -832,6 +839,7 @@ toolexeclibgoregexp_DATA = \ toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime toolexeclibgoruntime_DATA = \ runtime/debug.gox \ + runtime/metrics.gox \ runtime/pprof.gox \ runtime/trace.gox @@ -841,6 +849,7 @@ toolexeclibgosync_DATA = \ toolexeclibgotestingdir = $(toolexeclibgodir)/testing toolexeclibgotesting_DATA = \ + testing/fstest.gox \ testing/iotest.gox \ testing/quick.gox @@ -1777,6 +1786,27 @@ uninstall-toolexeclibgogoDATA: @list='$(toolexeclibgogo_DATA)'; test -n "$(toolexeclibgogodir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(toolexeclibgogodir)'; $(am__uninstall_files_from_dir) +install-toolexeclibgogobuildDATA: $(toolexeclibgogobuild_DATA) + @$(NORMAL_INSTALL) + @list='$(toolexeclibgogobuild_DATA)'; test -n "$(toolexeclibgogobuilddir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibgogobuilddir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibgogobuilddir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgogobuilddir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgogobuilddir)" || exit $$?; \ + done + +uninstall-toolexeclibgogobuildDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgogobuild_DATA)'; test -n "$(toolexeclibgogobuilddir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(toolexeclibgogobuilddir)'; $(am__uninstall_files_from_dir) install-toolexeclibgohashDATA: $(toolexeclibgohash_DATA) @$(NORMAL_INSTALL) @list='$(toolexeclibgohash_DATA)'; test -n "$(toolexeclibgohashdir)" || list=; \ @@ -2393,7 +2423,7 @@ all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) config.h \ all-local installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibgodir)" "$(DESTDIR)$(toolexeclibgoarchivedir)" "$(DESTDIR)$(toolexeclibgocompressdir)" "$(DESTDIR)$(toolexeclibgocontainerdir)" "$(DESTDIR)$(toolexeclibgocryptodir)" "$(DESTDIR)$(toolexeclibgocryptox509dir)" "$(DESTDIR)$(toolexeclibgodatabasedir)" "$(DESTDIR)$(toolexeclibgodatabasesqldir)" "$(DESTDIR)$(toolexeclibgodebugdir)" "$(DESTDIR)$(toolexeclibgoencodingdir)" "$(DESTDIR)$(toolexeclibgogodir)" "$(DESTDIR)$(toolexeclibgohashdir)" "$(DESTDIR)$(toolexeclibgohtmldir)" "$(DESTDIR)$(toolexeclibgoimagedir)" "$(DESTDIR)$(toolexeclibgoimagecolordir)" "$(DESTDIR)$(toolexeclibgoindexdir)" "$(DESTDIR)$(toolexeclibgointernaldir)" "$(DESTDIR)$(toolexeclibgoiodir)" "$(DESTDIR)$(toolexeclibgologdir)" "$(DESTDIR)$(toolexeclibgomathdir)" "$(DESTDIR)$(toolexeclibgomimedir)" "$(DESTDIR)$(toolexeclibgonetdir)" "$(DESTDIR)$(toolexeclibgonethttpdir)" "$(DESTDIR)$(toolexeclibgonetrpcdir)" "$(DESTDIR)$(toolexeclibgoosdir)" "$(DESTDIR)$(toolexeclibgopathdir)" "$(DESTDIR)$(toolexeclibgoregexpdir)" "$(DESTDIR)$(toolexeclibgoruntimedir)" "$(DESTDIR)$(toolexeclibgosyncdir)" "$(DESTDIR)$(toolexeclibgotestingdir)" "$(DESTDIR)$(toolexeclibgotestinginternaldir)" "$(DESTDIR)$(toolexeclibgotextdir)" "$(DESTDIR)$(toolexeclibgotexttemplatedir)" "$(DESTDIR)$(toolexeclibgotimedir)" "$(DESTDIR)$(toolexeclibgounicodedir)"; do \ + for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibgodir)" "$(DESTDIR)$(toolexeclibgoarchivedir)" "$(DESTDIR)$(toolexeclibgocompressdir)" "$(DESTDIR)$(toolexeclibgocontainerdir)" "$(DESTDIR)$(toolexeclibgocryptodir)" "$(DESTDIR)$(toolexeclibgocryptox509dir)" "$(DESTDIR)$(toolexeclibgodatabasedir)" "$(DESTDIR)$(toolexeclibgodatabasesqldir)" "$(DESTDIR)$(toolexeclibgodebugdir)" "$(DESTDIR)$(toolexeclibgoencodingdir)" "$(DESTDIR)$(toolexeclibgogodir)" "$(DESTDIR)$(toolexeclibgogobuilddir)" "$(DESTDIR)$(toolexeclibgohashdir)" "$(DESTDIR)$(toolexeclibgohtmldir)" "$(DESTDIR)$(toolexeclibgoimagedir)" "$(DESTDIR)$(toolexeclibgoimagecolordir)" "$(DESTDIR)$(toolexeclibgoindexdir)" "$(DESTDIR)$(toolexeclibgointernaldir)" "$(DESTDIR)$(toolexeclibgoiodir)" "$(DESTDIR)$(toolexeclibgologdir)" "$(DESTDIR)$(toolexeclibgomathdir)" "$(DESTDIR)$(toolexeclibgomimedir)" "$(DESTDIR)$(toolexeclibgonetdir)" "$(DESTDIR)$(toolexeclibgonethttpdir)" "$(DESTDIR)$(toolexeclibgonetrpcdir)" "$(DESTDIR)$(toolexeclibgoosdir)" "$(DESTDIR)$(toolexeclibgopathdir)" "$(DESTDIR)$(toolexeclibgoregexpdir)" "$(DESTDIR)$(toolexeclibgoruntimedir)" "$(DESTDIR)$(toolexeclibgosyncdir)" "$(DESTDIR)$(toolexeclibgotestingdir)" "$(DESTDIR)$(toolexeclibgotestinginternaldir)" "$(DESTDIR)$(toolexeclibgotextdir)" "$(DESTDIR)$(toolexeclibgotexttemplatedir)" "$(DESTDIR)$(toolexeclibgotimedir)" "$(DESTDIR)$(toolexeclibgounicodedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -2472,8 +2502,8 @@ install-exec-am: install-exec-local install-toolexeclibLIBRARIES \ install-toolexeclibgodatabasesqlDATA \ install-toolexeclibgodebugDATA \ install-toolexeclibgoencodingDATA install-toolexeclibgogoDATA \ - install-toolexeclibgohashDATA install-toolexeclibgohtmlDATA \ - install-toolexeclibgoimageDATA \ + install-toolexeclibgogobuildDATA install-toolexeclibgohashDATA \ + install-toolexeclibgohtmlDATA install-toolexeclibgoimageDATA \ install-toolexeclibgoimagecolorDATA \ install-toolexeclibgoindexDATA \ install-toolexeclibgointernalDATA install-toolexeclibgoioDATA \ @@ -2541,7 +2571,9 @@ uninstall-am: uninstall-toolexeclibLIBRARIES \ uninstall-toolexeclibgodatabasesqlDATA \ uninstall-toolexeclibgodebugDATA \ uninstall-toolexeclibgoencodingDATA \ - uninstall-toolexeclibgogoDATA uninstall-toolexeclibgohashDATA \ + uninstall-toolexeclibgogoDATA \ + uninstall-toolexeclibgogobuildDATA \ + uninstall-toolexeclibgohashDATA \ uninstall-toolexeclibgohtmlDATA \ uninstall-toolexeclibgoimageDATA \ uninstall-toolexeclibgoimagecolorDATA \ @@ -2587,8 +2619,8 @@ uninstall-am: uninstall-toolexeclibLIBRARIES \ install-toolexeclibgodatabasesqlDATA \ install-toolexeclibgodebugDATA \ install-toolexeclibgoencodingDATA install-toolexeclibgogoDATA \ - install-toolexeclibgohashDATA install-toolexeclibgohtmlDATA \ - install-toolexeclibgoimageDATA \ + install-toolexeclibgogobuildDATA install-toolexeclibgohashDATA \ + install-toolexeclibgohtmlDATA install-toolexeclibgoimageDATA \ install-toolexeclibgoimagecolorDATA \ install-toolexeclibgoindexDATA \ install-toolexeclibgointernalDATA install-toolexeclibgoioDATA \ @@ -2619,7 +2651,9 @@ uninstall-am: uninstall-toolexeclibLIBRARIES \ uninstall-toolexeclibgodatabasesqlDATA \ uninstall-toolexeclibgodebugDATA \ uninstall-toolexeclibgoencodingDATA \ - uninstall-toolexeclibgogoDATA uninstall-toolexeclibgohashDATA \ + uninstall-toolexeclibgogoDATA \ + uninstall-toolexeclibgogobuildDATA \ + uninstall-toolexeclibgohashDATA \ uninstall-toolexeclibgohtmlDATA \ uninstall-toolexeclibgoimageDATA \ uninstall-toolexeclibgoimagecolorDATA \ diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index 47f0b6e..8e6af69 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -403,6 +403,7 @@ typedef enum { EF_AMDGPU_MACH_AMDGCN_GFX803 = 0x02a, EF_AMDGPU_MACH_AMDGCN_GFX900 = 0x02c, EF_AMDGPU_MACH_AMDGCN_GFX906 = 0x02f, + EF_AMDGPU_MACH_AMDGCN_GFX908 = 0x030 } EF_AMDGPU_MACH; const static int EF_AMDGPU_MACH_MASK = 0x000000ff; @@ -1596,6 +1597,7 @@ elf_gcn_isa_field (Elf64_Ehdr *image) const static char *gcn_gfx803_s = "gfx803"; const static char *gcn_gfx900_s = "gfx900"; const static char *gcn_gfx906_s = "gfx906"; +const static char *gcn_gfx908_s = "gfx908"; const static int gcn_isa_name_len = 6; /* Returns the name that the HSA runtime uses for the ISA or NULL if we do not @@ -1611,6 +1613,8 @@ isa_hsa_name (int isa) { return gcn_gfx900_s; case EF_AMDGPU_MACH_AMDGCN_GFX906: return gcn_gfx906_s; + case EF_AMDGPU_MACH_AMDGCN_GFX908: + return gcn_gfx908_s; } return NULL; } @@ -1644,6 +1648,9 @@ isa_code(const char *isa) { if (!strncmp (isa, gcn_gfx906_s, gcn_isa_name_len)) return EF_AMDGPU_MACH_AMDGCN_GFX906; + if (!strncmp (isa, gcn_gfx908_s, gcn_isa_name_len)) + return EF_AMDGPU_MACH_AMDGCN_GFX908; + return -1; } diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e745b1b..ee36cba 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2021-02-02 Jonathan Wakely <jwakely@redhat.com> + + * doc/xml/manual/status_cxx2011.xml: Remove stray table cell. + * doc/xml/manual/status_cxx2014.xml: Likewise. + * doc/xml/manual/status_cxx2017.xml: Likewise. + * doc/html/manual/status.html: Regenerate. + 2021-02-01 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/70303 diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h index 084849e..c452778 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -204,6 +204,33 @@ template <size_t _Np> template <size_t _X> using _SizeConstant = integral_constant<size_t, _X>; +namespace __detail +{ + struct _Minimum + { + template <typename _Tp> + _GLIBCXX_SIMD_INTRINSIC constexpr + _Tp + operator()(_Tp __a, _Tp __b) const + { + using std::min; + return min(__a, __b); + } + }; + + struct _Maximum + { + template <typename _Tp> + _GLIBCXX_SIMD_INTRINSIC constexpr + _Tp + operator()(_Tp __a, _Tp __b) const + { + using std::max; + return max(__a, __b); + } + }; +} // namespace __detail + // unrolled/pack execution helpers // __execute_n_times{{{ template <typename _Fp, size_t... _I> @@ -477,6 +504,11 @@ constexpr inline bool __support_neon_float = false; #endif +#ifdef _ARCH_PWR10 +constexpr inline bool __have_power10vec = true; +#else +constexpr inline bool __have_power10vec = false; +#endif #ifdef __POWER9_VECTOR__ constexpr inline bool __have_power9vec = true; #else @@ -1380,12 +1412,34 @@ template <typename _Tp> inline constexpr bool __is_vector_type_v = __is_vector_type<_Tp>::value; // }}} +// __is_intrinsic_type {{{ +#if _GLIBCXX_SIMD_HAVE_SSE_ABI +template <typename _Tp> + using __is_intrinsic_type = __is_vector_type<_Tp>; +#else // not SSE (x86) +template <typename _Tp, typename = void_t<>> + struct __is_intrinsic_type : false_type {}; + +template <typename _Tp> + struct __is_intrinsic_type< + _Tp, void_t<typename __intrinsic_type< + remove_reference_t<decltype(declval<_Tp>()[0])>, sizeof(_Tp)>::type>> + : is_same<_Tp, typename __intrinsic_type< + remove_reference_t<decltype(declval<_Tp>()[0])>, + sizeof(_Tp)>::type> {}; +#endif + +template <typename _Tp> + inline constexpr bool __is_intrinsic_type_v = __is_intrinsic_type<_Tp>::value; + +// }}} // _VectorTraits{{{ template <typename _Tp, typename = void_t<>> struct _VectorTraitsImpl; template <typename _Tp> - struct _VectorTraitsImpl<_Tp, enable_if_t<__is_vector_type_v<_Tp>>> + struct _VectorTraitsImpl<_Tp, enable_if_t<__is_vector_type_v<_Tp> + || __is_intrinsic_type_v<_Tp>>> { using type = _Tp; using value_type = remove_reference_t<decltype(declval<_Tp>()[0])>; @@ -1457,7 +1511,8 @@ template <typename _To, typename _From> _GLIBCXX_SIMD_INTRINSIC constexpr _To __intrin_bitcast(_From __v) { - static_assert(__is_vector_type_v<_From> && __is_vector_type_v<_To>); + static_assert((__is_vector_type_v<_From> || __is_intrinsic_type_v<_From>) + && (__is_vector_type_v<_To> || __is_intrinsic_type_v<_To>)); if constexpr (sizeof(_To) == sizeof(_From)) return reinterpret_cast<_To>(__v); else if constexpr (sizeof(_From) > sizeof(_To)) @@ -2183,16 +2238,55 @@ template <typename _Tp, size_t _Bytes> #endif // _GLIBCXX_SIMD_HAVE_SSE_ABI // __intrinsic_type (ARM){{{ #if _GLIBCXX_SIMD_HAVE_NEON +template <> + struct __intrinsic_type<float, 8, void> + { using type = float32x2_t; }; + +template <> + struct __intrinsic_type<float, 16, void> + { using type = float32x4_t; }; + +#if _GLIBCXX_SIMD_HAVE_NEON_A64 +template <> + struct __intrinsic_type<double, 8, void> + { using type = float64x1_t; }; + +template <> + struct __intrinsic_type<double, 16, void> + { using type = float64x2_t; }; +#endif + +#define _GLIBCXX_SIMD_ARM_INTRIN(_Bits, _Np) \ +template <> \ + struct __intrinsic_type<__int_with_sizeof_t<_Bits / 8>, \ + _Np * _Bits / 8, void> \ + { using type = int##_Bits##x##_Np##_t; }; \ +template <> \ + struct __intrinsic_type<make_unsigned_t<__int_with_sizeof_t<_Bits / 8>>, \ + _Np * _Bits / 8, void> \ + { using type = uint##_Bits##x##_Np##_t; } +_GLIBCXX_SIMD_ARM_INTRIN(8, 8); +_GLIBCXX_SIMD_ARM_INTRIN(8, 16); +_GLIBCXX_SIMD_ARM_INTRIN(16, 4); +_GLIBCXX_SIMD_ARM_INTRIN(16, 8); +_GLIBCXX_SIMD_ARM_INTRIN(32, 2); +_GLIBCXX_SIMD_ARM_INTRIN(32, 4); +_GLIBCXX_SIMD_ARM_INTRIN(64, 1); +_GLIBCXX_SIMD_ARM_INTRIN(64, 2); +#undef _GLIBCXX_SIMD_ARM_INTRIN + template <typename _Tp, size_t _Bytes> struct __intrinsic_type<_Tp, _Bytes, enable_if_t<__is_vectorizable_v<_Tp> && _Bytes <= 16>> { - static constexpr int _S_VBytes = _Bytes <= 8 ? 8 : 16; + static constexpr int _SVecBytes = _Bytes <= 8 ? 8 : 16; using _Ip = __int_for_sizeof_t<_Tp>; using _Up = conditional_t< is_floating_point_v<_Tp>, _Tp, conditional_t<is_unsigned_v<_Tp>, make_unsigned_t<_Ip>, _Ip>>; - using type [[__gnu__::__vector_size__(_S_VBytes)]] = _Up; + static_assert(!is_same_v<_Tp, _Up> || _SVecBytes != _Bytes, + "should use explicit specialization above"); + using type = typename __intrinsic_type<_Up, _SVecBytes>::type; }; #endif // _GLIBCXX_SIMD_HAVE_NEON @@ -2223,20 +2317,19 @@ template <typename _Tp, size_t _Bytes> struct __intrinsic_type<_Tp, _Bytes, enable_if_t<__is_vectorizable_v<_Tp> && _Bytes <= 16>> { - static_assert(!is_same_v<_Tp, long double>, + static constexpr bool _S_is_ldouble = is_same_v<_Tp, long double>; + // allow _Tp == long double with -mlong-double-64 + static_assert(!(_S_is_ldouble && sizeof(long double) > sizeof(double)), "no __intrinsic_type support for long double on PPC"); #ifndef __VSX__ static_assert(!is_same_v<_Tp, double>, "no __intrinsic_type support for double on PPC w/o VSX"); #endif -#ifndef __POWER8_VECTOR__ - static_assert( - !(is_integral_v<_Tp> && sizeof(_Tp) > 4), - "no __intrinsic_type support for integers larger than 4 Bytes " - "on PPC w/o POWER8 vectors"); -#endif - using type = typename __intrinsic_type_impl<conditional_t< - is_floating_point_v<_Tp>, _Tp, __int_for_sizeof_t<_Tp>>>::type; + using type = + typename __intrinsic_type_impl< + conditional_t<is_floating_point_v<_Tp>, + conditional_t<_S_is_ldouble, double, _Tp>, + __int_for_sizeof_t<_Tp>>>::type; }; #endif // __ALTIVEC__ @@ -3342,7 +3435,7 @@ template <typename _Tp, typename _Ap> // }}}1 // reductions [simd.reductions] {{{1 - template <typename _Tp, typename _Abi, typename _BinaryOperation = plus<>> +template <typename _Tp, typename _Abi, typename _BinaryOperation = plus<>> _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR _Tp reduce(const simd<_Tp, _Abi>& __v, _BinaryOperation __binary_op = _BinaryOperation()) @@ -3388,6 +3481,61 @@ template <typename _M, typename _V> reduce(const const_where_expression<_M, _V>& __x, bit_xor<> __binary_op) { return reduce(__x, 0, __binary_op); } +template <typename _Tp, typename _Abi> + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR _Tp + hmin(const simd<_Tp, _Abi>& __v) noexcept + { + return _Abi::_SimdImpl::_S_reduce(__v, __detail::_Minimum()); + } + +template <typename _Tp, typename _Abi> + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR _Tp + hmax(const simd<_Tp, _Abi>& __v) noexcept + { + return _Abi::_SimdImpl::_S_reduce(__v, __detail::_Maximum()); + } + +template <typename _M, typename _V> + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR + typename _V::value_type + hmin(const const_where_expression<_M, _V>& __x) noexcept + { + using _Tp = typename _V::value_type; + constexpr _Tp __id_elem = +#ifdef __FINITE_MATH_ONLY__ + __finite_max_v<_Tp>; +#else + __value_or<__infinity, _Tp>(__finite_max_v<_Tp>); +#endif + _V __tmp = __id_elem; + _V::_Impl::_S_masked_assign(__data(__get_mask(__x)), __data(__tmp), + __data(__get_lvalue(__x))); + return _V::abi_type::_SimdImpl::_S_reduce(__tmp, __detail::_Minimum()); + } + +template <typename _M, typename _V> + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR + typename _V::value_type + hmax(const const_where_expression<_M, _V>& __x) noexcept + { + using _Tp = typename _V::value_type; + constexpr _Tp __id_elem = +#ifdef __FINITE_MATH_ONLY__ + __finite_min_v<_Tp>; +#else + [] { + if constexpr (__value_exists_v<__infinity, _Tp>) + return -__infinity_v<_Tp>; + else + return __finite_min_v<_Tp>; + }(); +#endif + _V __tmp = __id_elem; + _V::_Impl::_S_masked_assign(__data(__get_mask(__x)), __data(__tmp), + __data(__get_lvalue(__x))); + return _V::abi_type::_SimdImpl::_S_reduce(__tmp, __detail::_Maximum()); + } + // }}}1 // algorithms [simd.alg] {{{ template <typename _Tp, typename _Ap> diff --git a/libstdc++-v3/include/experimental/bits/simd_builtin.h b/libstdc++-v3/include/experimental/bits/simd_builtin.h index efca65f..7f728a1 100644 --- a/libstdc++-v3/include/experimental/bits/simd_builtin.h +++ b/libstdc++-v3/include/experimental/bits/simd_builtin.h @@ -920,6 +920,7 @@ template <typename _Abi> struct _MaskImplX86; template <typename _Abi> struct _SimdImplNeon; template <typename _Abi> struct _MaskImplNeon; template <typename _Abi> struct _SimdImplPpc; +template <typename _Abi> struct _MaskImplPpc; // simd_abi::_VecBuiltin {{{ template <int _UsedBytes> @@ -959,11 +960,12 @@ template <int _UsedBytes> using _CommonImpl = _CommonImplBuiltin; #ifdef __ALTIVEC__ using _SimdImpl = _SimdImplPpc<_VecBuiltin<_UsedBytes>>; + using _MaskImpl = _MaskImplPpc<_VecBuiltin<_UsedBytes>>; #else using _SimdImpl = _SimdImplBuiltin<_VecBuiltin<_UsedBytes>>; -#endif using _MaskImpl = _MaskImplBuiltin<_VecBuiltin<_UsedBytes>>; #endif +#endif // }}} // __traits {{{ @@ -2899,7 +2901,7 @@ template <typename _Abi> _GLIBCXX_SIMD_INTRINSIC static bool _S_some_of(simd_mask<_Tp, _Abi> __k) { - const int __n_true = _S_popcount(__k); + const int __n_true = _SuperImpl::_S_popcount(__k); return __n_true > 0 && __n_true < int(_S_size<_Tp>); } diff --git a/libstdc++-v3/include/experimental/bits/simd_neon.h b/libstdc++-v3/include/experimental/bits/simd_neon.h index 8bb2116..7f472e8 100644 --- a/libstdc++-v3/include/experimental/bits/simd_neon.h +++ b/libstdc++-v3/include/experimental/bits/simd_neon.h @@ -311,8 +311,7 @@ struct _MaskImplNeonMixin }); __asint &= __bitsel; #ifdef __aarch64__ - return vpaddq_s16(vpaddq_s16(vpaddq_s16(__asint, __zero), __zero), - __zero)[0]; + return vaddvq_s16(__asint); #else return vpadd_s16( vpadd_s16(vpadd_s16(__lo64(__asint), __hi64(__asint)), __zero), @@ -328,7 +327,7 @@ struct _MaskImplNeonMixin }); __asint &= __bitsel; #ifdef __aarch64__ - return vpaddq_s32(vpaddq_s32(__asint, __zero), __zero)[0]; + return vaddvq_s32(__asint); #else return vpadd_s32(vpadd_s32(__lo64(__asint), __hi64(__asint)), __zero)[0]; @@ -351,8 +350,12 @@ struct _MaskImplNeonMixin return static_cast<_I>(__i < _Np ? 1 << __i : 0); }); __asint &= __bitsel; +#ifdef __aarch64__ + return vaddv_s8(__asint); +#else return vpadd_s8(vpadd_s8(vpadd_s8(__asint, __zero), __zero), __zero)[0]; +#endif } else if constexpr (sizeof(_Tp) == 2) { @@ -362,12 +365,20 @@ struct _MaskImplNeonMixin return static_cast<_I>(__i < _Np ? 1 << __i : 0); }); __asint &= __bitsel; +#ifdef __aarch64__ + return vaddv_s16(__asint); +#else return vpadd_s16(vpadd_s16(__asint, __zero), __zero)[0]; +#endif } else if constexpr (sizeof(_Tp) == 4) { __asint &= __make_vector<_I>(0x1, 0x2); +#ifdef __aarch64__ + return vaddv_s32(__asint); +#else return vpadd_s32(__asint, __zero)[0]; +#endif } else __assert_unreachable<_Tp>(); diff --git a/libstdc++-v3/include/experimental/bits/simd_ppc.h b/libstdc++-v3/include/experimental/bits/simd_ppc.h index b92fc19..ef52d12 100644 --- a/libstdc++-v3/include/experimental/bits/simd_ppc.h +++ b/libstdc++-v3/include/experimental/bits/simd_ppc.h @@ -30,6 +30,7 @@ #ifndef __ALTIVEC__ #error "simd_ppc.h may only be included when AltiVec/VMX is available" #endif +#include <altivec.h> _GLIBCXX_SIMD_BEGIN_NAMESPACE @@ -115,9 +116,41 @@ template <typename _Abi> }; // }}} +// _MaskImplPpc {{{ +template <typename _Abi> + struct _MaskImplPpc : _MaskImplBuiltin<_Abi> + { + using _Base = _MaskImplBuiltin<_Abi>; + + // _S_popcount {{{ + template <typename _Tp> + _GLIBCXX_SIMD_INTRINSIC static int _S_popcount(simd_mask<_Tp, _Abi> __k) + { + const auto __kv = __as_vector(__k); + if constexpr (__have_power10vec) + { + return vec_cntm(__to_intrin(__kv), 1); + } + else if constexpr (sizeof(_Tp) >= sizeof(int)) + { + using _Intrin = __intrinsic_type16_t<int>; + const int __sum = -vec_sums(__intrin_bitcast<_Intrin>(__kv), _Intrin())[3]; + return __sum / (sizeof(_Tp) / sizeof(int)); + } + else + { + const auto __summed_to_int = vec_sum4s(__to_intrin(__kv), __intrinsic_type16_t<int>()); + return -vec_sums(__summed_to_int, __intrinsic_type16_t<int>())[3]; + } + } + + // }}} + }; + +// }}} _GLIBCXX_SIMD_END_NAMESPACE #endif // __cplusplus >= 201703L #endif // _GLIBCXX_EXPERIMENTAL_SIMD_PPC_H_ -// vim: foldmethod=marker sw=2 noet ts=8 sts=2 tw=80 +// vim: foldmethod=marker foldmarker={{{,}}} sw=2 noet ts=8 sts=2 tw=100 diff --git a/libstdc++-v3/include/experimental/bits/simd_scalar.h b/libstdc++-v3/include/experimental/bits/simd_scalar.h index d5a90ef..48e13f6 100644 --- a/libstdc++-v3/include/experimental/bits/simd_scalar.h +++ b/libstdc++-v3/include/experimental/bits/simd_scalar.h @@ -182,7 +182,7 @@ struct _SimdImplScalar // _S_reduce {{{2 template <typename _Tp, typename _BinaryOperation> static constexpr inline _Tp - _S_reduce(const simd<_Tp, simd_abi::scalar>& __x, _BinaryOperation&) + _S_reduce(const simd<_Tp, simd_abi::scalar>& __x, const _BinaryOperation&) { return __x._M_data; } // _S_min, _S_max {{{2 diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/less.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/less.cc index 655515c..abb7541 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/less.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/less.cc @@ -29,10 +29,13 @@ int main() VERIFY( !(e1 < e1) ); VERIFY( !(e2 < e2) ); - VERIFY( (e1 < e2) == (e1.value() < e2.value()) ); + VERIFY( (e1 < e2) == (e1.category() < e2.category()) ); const __gnu_test::test_category cat; std::error_code e3(e2.value(), cat); VERIFY( !(e3 < e3) ); VERIFY( (e2 < e3) == (e2.category() < e3.category()) ); + + std::error_code e4(std::make_error_code(std::errc::invalid_argument)); + VERIFY( (e4 < e2) == (e4.value() < e2.value()) ); } diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc index a8dfa50..543ffce 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc @@ -34,5 +34,6 @@ int main() std::error_code e3(e2.value(), cat); VERIFY( e2 != e3 ); - return 0; + std::error_code e4(std::make_error_code(std::errc::invalid_argument)); + VERIFY( e4 != e2 ); } diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/three_way.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/three_way.cc index 448f51d..50c54be 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/three_way.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/three_way.cc @@ -33,7 +33,7 @@ test01() VERIFY( std::is_neq(e1 <=> e2) ); VERIFY( std::is_lt(e1 <=> e2) || std::is_gt(e1 <=> e2) ); - VERIFY( (e1 <=> e2) == (e1.value() <=> e2.value()) ); + VERIFY( (e1 <=> e2) == (e1.category() <=> e2.category()) ); VERIFY( e1 == e1 ); VERIFY( !(e1 == e2) ); @@ -52,6 +52,12 @@ test01() VERIFY( !(e3 < e3) ); VERIFY( (e2 < e3) == (e2.category() < e3.category()) ); + + std::error_code e4(std::make_error_code(std::errc::invalid_argument)); + + VERIFY( std::is_neq(e4 <=> e2) ); + VERIFY( std::is_lt(e4 <=> e2) || std::is_gt(e4 <=> e2) ); + VERIFY( (e4 <=> e2) == (e4.value() <=> e2.value()) ); } int main() diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/less.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/less.cc index 96f8b68..8a6b71f 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/less.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/less.cc @@ -29,6 +29,7 @@ int main() VERIFY( !(e1 < e1) ); VERIFY( !(e2 < e2) ); + // e1.category() == e2.category(), so comparison depends on values: VERIFY( (e1 < e2) == (e1.value() < e2.value()) ); const __gnu_test::test_category cat; diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/three_way.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/three_way.cc index 1898897..e26afe5 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/three_way.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/three_way.cc @@ -33,6 +33,7 @@ test01() VERIFY( std::is_neq(e1 <=> e2) ); VERIFY( std::is_lt(e1 <=> e2) || std::is_gt(e1 <=> e2) ); + // e1.category() == e2.category(), so comparison depends on values: VERIFY( (e1 <=> e2) == (e1.value() <=> e2.value()) ); VERIFY( e1 == e1 ); diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am index 5dd109b..ba5023a 100644 --- a/libstdc++-v3/testsuite/Makefile.am +++ b/libstdc++-v3/testsuite/Makefile.am @@ -191,7 +191,10 @@ check-simd: $(srcdir)/experimental/simd/generate_makefile.sh \ ${glibcxx_srcdir}/scripts/check_simd \ testsuite_files_simd \ ${glibcxx_builddir}/scripts/testsuite_flags - ${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "${glibcxx_builddir}" "$(CXXFLAGS)" | \ + @echo "WARNING: Adding -fno-tree-vrp to CXXFLAGS to work around PR98834." + @rm -f .simd.summary + @echo "Generating simd testsuite subdirs and Makefiles ..." + @${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "${glibcxx_builddir}" "$(CXXFLAGS) -fno-tree-vrp" | \ while read subdir; do \ $(MAKE) -C "$${subdir}"; \ tail -n20 $${subdir}/simd_testsuite.sum | \ diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 3900d6d..c9dd7f5 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -716,7 +716,10 @@ check-simd: $(srcdir)/experimental/simd/generate_makefile.sh \ ${glibcxx_srcdir}/scripts/check_simd \ testsuite_files_simd \ ${glibcxx_builddir}/scripts/testsuite_flags - ${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "${glibcxx_builddir}" "$(CXXFLAGS)" | \ + @echo "WARNING: Adding -fno-tree-vrp to CXXFLAGS to work around PR98834." + @rm -f .simd.summary + @echo "Generating simd testsuite subdirs and Makefiles ..." + @${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "${glibcxx_builddir}" "$(CXXFLAGS) -fno-tree-vrp" | \ while read subdir; do \ $(MAKE) -C "$${subdir}"; \ tail -n20 $${subdir}/simd_testsuite.sum | \ diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++-v3/testsuite/experimental/simd/driver.sh index aabef31..f2d31c7 100755 --- a/libstdc++-v3/testsuite/experimental/simd/driver.sh +++ b/libstdc++-v3/testsuite/experimental/simd/driver.sh @@ -138,112 +138,261 @@ if [ -n "$only" ]; then fi if [ $abi -eq 0 ]; then - abi="" + abiflag="" elif [ $abi -gt 0 -a $abi -lt 10 ]; then - abi="-DEXTENDEDTESTS=$((abi-1))" + abiflag="-DEXTENDEDTESTS=$((abi-1))" else echo "Error: The -a argument must be a value between 0 and 9 (inclusive)." >&2 exit 1 fi fail() { - echo "FAIL: $src $type $abi ($*)" | tee -a "$sum" "$log" + echo "FAIL: $src $type $abiflag ($*)" | tee -a "$sum" "$log" +} + +xpass() { + echo "XPASS: $src $type $abiflag ($*)" | tee -a "$sum" "$log" +} + +xfail() { + $quiet || echo "XFAIL: $src $type $abiflag ($*)" + echo "XFAIL: $src $type $abiflag ($*)" >> "$sum" + echo "XFAIL: $src $type $abiflag ($*)" >> "$log" } pass() { - $quiet || echo "PASS: $src $type $abi ($*)" - echo "PASS: $src $type $abi ($*)" >> "$sum" - echo "PASS: $src $type $abi ($*)" >> "$log" + $quiet || echo "PASS: $src $type $abiflag ($*)" + echo "PASS: $src $type $abiflag ($*)" >> "$sum" + echo "PASS: $src $type $abiflag ($*)" >> "$log" } unsupported() { - $quiet || echo "UNSUPPORTED: $src $type $abi ($*)" - echo "UNSUPPORTED: $src $type $abi ($*)" >> "$sum" - echo "UNSUPPORTED: $src $type $abi ($*)" >> "$log" + $quiet || echo "UNSUPPORTED: $src $type $abiflag ($*)" + echo "UNSUPPORTED: $src $type $abiflag ($*)" >> "$sum" + echo "UNSUPPORTED: $src $type $abiflag ($*)" >> "$log" +} + +write_log_and_verbose() { + echo "$*" >> "$log" + if $verbose; then + if [ -z "$COLUMNS" ] || ! type fmt>/dev/null; then + echo "$*" + else + echo "$*" | fmt -w $COLUMNS -s - || cat + fi + fi +} + +matches() { + eval "case '$1' in + $2) return 0;; esac" + return 1 +} + +test_selector() { + string="$1" + pat_type="${string%% *}" + if matches "$shorttype" "$pat_type"; then + string="${string#* }" + pat_abi="${string%% *}" + if matches "$abi" "$pat_abi"; then + string="${string#* }" + pat_triplet="${string%% *}" + [ -z "$target_triplet" ] && target_triplet=$($CXX -dumpmachine) + if matches "$target_triplet" "$pat_triplet"; then + pat_flags="${string#* }" + if matches "$CXXFLAGS" "*$pat_flags*"; then + return 0 + fi + fi + fi + fi + return 1 +} + +trap "rm -f '$log' '$sum' $exe; exit" INT +rm -f "$log" "$sum" +touch "$log" "$sum" + +read_src_option() { + local key tmp var + key="$1" + var="$2" + [ -z "$var" ] && var="$1" + local tmp="$(head -n25 "$src" | grep "^//\\s*${key}: ")" + if [ -n "$tmp" ]; then + tmp="$(echo "${tmp#//*${key}: }" | sed -e 's/ \+/ /g' -e 's/^ //' -e 's/$//')" + eval "$var=\"$tmp\"" + else + return 1 + fi +} + +if read_src_option skip; then + if test_selector "$skip"; then + # silently skip this test + exit 0 + fi +fi +if read_src_option only; then + if ! test_selector "$only"; then + # silently skip this test + exit 0 + fi +fi + +if ! $run_expensive; then + if read_src_option expensive; then + if test_selector "$expensive"; then + unsupported "skip expensive tests" + exit 0 + fi + fi +fi + +if read_src_option xfail; then + if test_selector "${xfail#* }"; then + xfail="${xfail%% *}" + else + unset xfail + fi +fi + +read_src_option timeout + +if read_src_option timeout-factor factor; then + timeout=$(awk "BEGIN { print int($timeout * $factor) }") +fi + +log_output() { + if $verbose; then + maxcol=${1:-1024} + awk " +BEGIN { count = 0 } +/^###exitstatus### [0-9]+$/ { exit \$2 } +{ + print >> \"$log\" + if (count >= 1000) { + print \"Aborting: too much output\" >> \"$log\" + print \"Aborting: too much output\" + exit 125 + } + ++count + if (length(\$0) > $maxcol) { + i = 1 + while (i + $maxcol <= length(\$0)) { + len = $maxcol + line = substr(\$0, i, len) + len = match(line, / [^ ]*$/) + if (len <= 0) { + len = match(substr(\$0, i), / [^ ]/) + if (len <= 0) len = $maxcol + } + print substr(\$0, i, len) + i += len + } + print substr(\$0, i) + } else { + print + } +} +END { close(\"$log\") } +" + else + awk " +BEGIN { count = 0 } +/^###exitstatus### [0-9]+$/ { exit \$2 } +{ + print >> \"$log\" + if (count >= 1000) { + print \"Aborting: too much output\" >> \"$log\" + print \"Aborting: too much output\" + exit 125 + } + ++count +} +END { close(\"$log\") } +" + fi } verify_compilation() { - failed=$1 - if [ $failed -eq 0 ]; then + log_output $COLUMNS + exitstatus=$? + if [ $exitstatus -eq 0 ]; then warnings=$(grep -ic 'warning:' "$log") if [ $warnings -gt 0 ]; then fail "excess warnings:" $warnings - if $verbose; then - cat "$log" - elif ! $quiet; then + if ! $verbose && ! $quiet; then grep -i 'warning:' "$log" | head -n5 fi + elif [ "$xfail" = "compile" ]; then + xpass "test for excess errors" else pass "test for excess errors" fi + return 0 else - if [ $failed -eq 124 ]; then + if [ $exitstatus -eq 124 ]; then fail "timeout: test for excess errors" else errors=$(grep -ic 'error:' "$log") - fail "excess errors:" $errors + if [ "$xfail" = "compile" ]; then + xfail "excess errors:" $errors + exit 0 + else + fail "excess errors:" $errors + fi fi - if $verbose; then - cat "$log" - elif ! $quiet; then + if ! $verbose && ! $quiet; then grep -i 'error:' "$log" | head -n5 fi - exit 0 + return 1 fi } verify_test() { - failed=$1 - if [ $failed -eq 0 ]; then - rm "$exe" - pass "execution test" + log_output $COLUMNS + exitstatus=$? + if [ $exitstatus -eq 0 ]; then + if [ "$xfail" = "run" ]; then + $keep_failed || rm "$exe" + xpass "execution test" + else + rm "$exe" + pass "execution test" + fi + return 0 else $keep_failed || rm "$exe" - if [ $failed -eq 124 ]; then + if ! $verbose && ! $quiet; then + grep -i fail "$log" | head -n5 + fi + if [ $exitstatus -eq 124 ]; then fail "timeout: execution test" + elif [ "$xfail" = "run" ]; then + xfail "execution test" else fail "execution test" fi - if $verbose; then - if [ $(cat "$log"|wc -l) -gt 1000 ]; then - echo "[...]" - tail -n1000 "$log" - else - cat "$log" - fi - elif ! $quiet; then - grep -i fail "$log" | head -n5 - fi - exit 0 - fi -} - -write_log_and_verbose() { - echo "$*" >> "$log" - if $verbose; then - echo "$*" + return 1 fi } -rm -f "$log" "$sum" -touch "$log" "$sum" - -if ! $run_expensive && [ -n "$abi" ]; then - unsupported "skip expensive tests" - exit 0 -fi - -write_log_and_verbose "$CXX $src $@ -D_GLIBCXX_SIMD_TESTTYPE=$type $abi -o $exe" -timeout $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abi -o "$exe" >> "$log" 2>&1 -verify_compilation $? +write_log_and_verbose "$CXX $src $@ -D_GLIBCXX_SIMD_TESTTYPE=$type $abiflag -o $exe" +{ + timeout --foreground $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abiflag -o "$exe" 2>&1 <&- + printf "###exitstatus### %d\n" $? +} | verify_compilation || exit 0 if [ -n "$sim" ]; then write_log_and_verbose "$sim ./$exe" - timeout $timeout $sim "./$exe" >> "$log" 2>&1 <&- else write_log_and_verbose "./$exe" timeout=$(awk "BEGIN { print int($timeout / 2) }") - timeout $timeout "./$exe" >> "$log" 2>&1 <&- fi -verify_test $? +{ + timeout --foreground $timeout $sim "./$exe" 2>&1 <&- + printf "###exitstatus### %d\n" $? +} | verify_test || exit 0 # vim: sw=2 et cc=81 si diff --git a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh index ab59705..4fb710c 100755 --- a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh +++ b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh @@ -85,67 +85,112 @@ CXX="$1" shift echo "TESTFLAGS ?=" > "$dst" -[ -n "$testflags" ] && echo "TESTFLAGS := $testflags \$(TESTFLAGS)" >> "$dst" -echo CXXFLAGS = "$@" "\$(TESTFLAGS)" >> "$dst" +echo "test_flags := $testflags \$(TESTFLAGS)" >> "$dst" +echo CXXFLAGS = "$@" "\$(test_flags)" >> "$dst" [ -n "$sim" ] && echo "export GCC_TEST_SIMULATOR = $sim" >> "$dst" cat >> "$dst" <<EOF srcdir = ${srcdir} CXX = ${CXX} DRIVER = ${driver} DRIVEROPTS ?= +driveroptions := \$(DRIVEROPTS) all: simd_testsuite.sum simd_testsuite.sum: simd_testsuite.log - @printf "\n\t\t=== simd_testsuite \$(TESTFLAGS) Summary ===\n\n"\\ + @printf "\n\t\t=== simd_testsuite \$(test_flags) Summary ===\n\n"\\ "# of expected passes:\t\t\$(shell grep -c '^PASS:' \$@)\n"\\ + "# of unexpected passes:\t\t\$(shell grep -c '^XPASS:' \$@)\n"\\ "# of unexpected failures:\t\$(shell grep -c '^FAIL:' \$@)\n"\\ + "# of expected failures:\t\t\$(shell grep -c '^XFAIL:' \$@)\n"\\ "# of unsupported tests:\t\t\$(shell grep -c '^UNSUPPORTED:' \$@)\n"\\ | tee -a \$@ EOF +matches() { + eval "case '$1' in + $2) return 0;; esac" + return 1 +} + +cxx_type() { + case "$1" in + ldouble) echo "long double";; + ullong) echo "unsigned long long";; + ulong) echo "unsigned long";; + llong) echo "long long";; + uint) echo "unsigned int";; + ushort) echo "unsigned short";; + uchar) echo "unsigned char";; + schar) echo "signed char";; + *) echo "$1";; + esac +} + +filter_types() { + only="$1" + skip="$2" + shift 2 + if [ -z "$only" -a -z "$skip" ]; then + for x in "$@"; do + cxx_type "$x" + echo "$x" + done + elif [ -z "$skip" ]; then + for x in "$@"; do + if matches "$x" "$only"; then + cxx_type "$x" + echo "$x" + fi + done + elif [ -z "$only" ]; then + for x in "$@"; do + matches "$x" "$skip" && continue + cxx_type "$x" + echo "$x" + done + else + for x in "$@"; do + matches "$x" "$skip" && continue + if matches "$x" "$only"; then + cxx_type "$x" + echo "$x" + fi + done + fi +} + all_types() { src="$1" - cat <<EOF -long double -ldouble -double -double -float -float -EOF - ([ -n "$src" ] && grep -q "test only floattypes" "$src") || \ - cat <<EOF -long long -llong -unsigned long long -ullong -unsigned long -ulong -long -long -int -int -unsigned int -uint -short -short -unsigned short -ushort -char -char -signed char -schar -unsigned char -uchar -char32_t -char32_t -char16_t -char16_t -wchar_t -wchar_t -EOF + only= + skip= + if [ -n "$src" ]; then + only="$(head -n25 "$src"| grep '^//\s*only: [^ ]* \* \* \*')" + only="${only#*: }" + only="${only%% *}" + skip="$(head -n25 "$src"| grep '^//\s*skip: [^ ]* \* \* \*')" + skip="${skip#*: }" + skip="${skip%% *}" + fi + filter_types "$only" "$skip" \ + "ldouble" \ + "double" \ + "float" \ + "llong" \ + "ullong" \ + "ulong" \ + "long" \ + "int" \ + "uint" \ + "short" \ + "ushort" \ + "char" \ + "schar" \ + "uchar" \ + "char32_t" \ + "char16_t" \ + "wchar_t" } all_tests() { @@ -196,59 +241,59 @@ EOF %-$type.log: %-$type-0.log %-$type-1.log %-$type-2.log %-$type-3.log \ %-$type-4.log %-$type-5.log %-$type-6.log %-$type-7.log \ %-$type-8.log %-$type-9.log - @cat $^ > \$@ + @cat \$^ > \$@ @cat \$(^:log=sum) > \$(@:log=sum)${rmline} EOF for i in $(seq 0 9); do cat <<EOF %-$type-$i.log: \$(srcdir)/%.cc - @\$(DRIVER) \$(DRIVEROPTS) -t "$t" -a $i -n \$* \$(CXX) \$(CXXFLAGS) + @\$(DRIVER) \$(driveroptions) -t "$t" -a $i -n \$* \$(CXX) \$(CXXFLAGS) EOF done done - echo 'run-%: export GCC_TEST_RUN_EXPENSIVE=yes' - all_tests | while read file && read name; do - echo "run-$name: $name.log" - all_types "$file" | while read t && read type; do - echo "run-$name-$type: $name-$type.log" - for i in $(seq 0 9); do - echo "run-$name-$type-$i: $name-$type-$i.log" - done - done - echo - done cat <<EOF -help: - @printf "use DRIVEROPTS=<options> to pass the following options:\n"\\ - "-q, --quiet Only print failures.\n"\\ - "-v, --verbose Print compiler and test output on failure.\n"\\ - "-k, --keep-failed Keep executables of failed tests.\n"\\ - "--sim <executable> Path to an executable that is prepended to the test\n"\\ - " execution binary (default: the value of\n"\\ - " GCC_TEST_SIMULATOR).\n"\\ - "--timeout-factor <x>\n"\\ - " Multiply the default timeout with x.\n"\\ - "--run-expensive Compile and run tests marked as expensive (default:\n"\\ - " true if GCC_TEST_RUN_EXPENSIVE is set, false otherwise).\n"\\ - "--only <pattern> Compile and run only tests matching the given pattern.\n\n" - @echo "use TESTFLAGS=<flags> to pass additional compiler flags" - @echo - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all" - @echo "... clean" - @echo "... help" +run-%: export GCC_TEST_RUN_EXPENSIVE=yes +run-%: driveroptions += -v +run-%: %.log + @rm \$^ \$(^:log=sum) + +help: .make_help.txt + @cat \$< + +EOF + dsthelp="${dst%Makefile}.make_help.txt" + cat <<EOF > "$dsthelp" +use DRIVEROPTS=<options> to pass the following options: +-q, --quiet Only print failures. +-v, --verbose Print compiler and test output on failure. +-k, --keep-failed Keep executables of failed tests. +--sim <executable> Path to an executable that is prepended to the test + execution binary (default: the value of + GCC_TEST_SIMULATOR). +--timeout-factor <x> + Multiply the default timeout with x. +--run-expensive Compile and run tests marked as expensive (default: + true if GCC_TEST_RUN_EXPENSIVE is set, false otherwise). +--only <pattern> Compile and run only tests matching the given pattern. + +use TESTFLAGS=<flags> to pass additional compiler flags + +The following are some of the valid targets for this Makefile: +... all +... clean +... help" EOF all_tests | while read file && read name; do - printf "\t@echo '... run-${name}'\n" + echo "... run-${name}" all_types | while read t && read type; do - printf "\t@echo '... run-${name}-${type}'\n" + echo "... run-${name}-${type}" for i in $(seq 0 9); do - printf "\t@echo '... run-${name}-${type}-$i'\n" + echo "... run-${name}-${type}-$i" done done - done + done >> "$dsthelp" cat <<EOF clean: diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/abs.cc b/libstdc++-v3/testsuite/experimental/simd/tests/abs.cc index df115a9..2564577 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/abs.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/abs.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include <cmath> // abs & sqrt diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc b/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc index 0874739..938f2a5 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h b/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h index 826cfc3..82016c6 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h +++ b/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h @@ -60,6 +60,7 @@ template <class T> class verify { const bool m_failed = false; + size_t m_ip = 0; template <typename T, typename = decltype(std::declval<std::stringstream&>() @@ -129,20 +130,21 @@ class verify public: template <typename... Ts> - verify(bool ok, size_t ip, const char* file, const int line, + [[gnu::always_inline]] + verify(bool ok, const char* file, const int line, const char* func, const char* cond, const Ts&... extra_info) - : m_failed(!ok) + : m_failed(!ok), m_ip(get_ip()) { if (m_failed) - { + [&] { __builtin_fprintf(stderr, "%s:%d: (%s):\nInstruction Pointer: %x\n" "Assertion '%s' failed.\n", - file, line, func, ip, cond); + file, line, func, m_ip, cond); (print(extra_info, int()), ...); - } + }(); } - ~verify() + [[gnu::always_inline]] ~verify() { if (m_failed) { @@ -152,26 +154,27 @@ public: } template <typename T> + [[gnu::always_inline]] const verify& operator<<(const T& x) const { if (m_failed) - { - print(x, int()); - } + print(x, int()); return *this; } template <typename... Ts> + [[gnu::always_inline]] const verify& on_failure(const Ts&... xs) const { if (m_failed) - (print(xs, int()), ...); + [&] { (print(xs, int()), ...); }(); return *this; } - [[gnu::always_inline]] static inline size_t + [[gnu::always_inline]] static inline + size_t get_ip() { size_t _ip = 0; @@ -220,24 +223,21 @@ template <typename T> #define COMPARE(_a, _b) \ [&](auto&& _aa, auto&& _bb) { \ - return verify(std::experimental::all_of(_aa == _bb), verify::get_ip(), \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, \ - "all_of(" #_a " == " #_b ")", #_a " = ", _aa, \ + return verify(std::experimental::all_of(_aa == _bb), __FILE__, __LINE__, \ + __PRETTY_FUNCTION__, #_a " == " #_b, #_a " = ", _aa, \ "\n" #_b " = ", _bb); \ }(force_fp_truncation(_a), force_fp_truncation(_b)) #else #define COMPARE(_a, _b) \ [&](auto&& _aa, auto&& _bb) { \ - return verify(std::experimental::all_of(_aa == _bb), verify::get_ip(), \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, \ - "all_of(" #_a " == " #_b ")", #_a " = ", _aa, \ + return verify(std::experimental::all_of(_aa == _bb), __FILE__, __LINE__, \ + __PRETTY_FUNCTION__, #_a " == " #_b, #_a " = ", _aa, \ "\n" #_b " = ", _bb); \ }((_a), (_b)) #endif #define VERIFY(_test) \ - verify(_test, verify::get_ip(), __FILE__, __LINE__, __PRETTY_FUNCTION__, \ - #_test) + verify(_test, __FILE__, __LINE__, __PRETTY_FUNCTION__, #_test) // ulp_distance_signed can raise FP exceptions and thus must be conditionally // executed @@ -245,9 +245,9 @@ template <typename T> [&](auto&& _aa, auto&& _bb) { \ const bool success = std::experimental::all_of( \ vir::test::ulp_distance(_aa, _bb) <= (_allowed_distance)); \ - return verify(success, verify::get_ip(), __FILE__, __LINE__, \ - __PRETTY_FUNCTION__, "all_of(" #_a " ~~ " #_b ")", \ - #_a " = ", _aa, "\n" #_b " = ", _bb, "\ndistance = ", \ + return verify(success, __FILE__, __LINE__, __PRETTY_FUNCTION__, \ + #_a " ~~ " #_b, #_a " = ", _aa, "\n" #_b " = ", _bb, \ + "\ndistance = ", \ success ? 0 : vir::test::ulp_distance_signed(_aa, _bb)); \ }((_a), (_b)) diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc b/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc index 6c16c67..bba1a27 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc b/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc index 60aa942a..5e50580 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/conversions.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc b/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc index c64ba0f..fe8a061 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc b/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc index 9ae946c..918182d 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc b/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc index 678e4fd..11aaa49 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc b/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc index acf8c9a..28e75d4 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,9 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// skip: ldouble * powerpc64* * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc b/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc index 04d01a5..7416952 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc b/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc index d3ad373..e9719cc 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc b/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc index 58e062e..451d3b8 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc @@ -15,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * +// timeout-factor: 2 #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/conversions.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc b/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc index 0830f90..b0dc9af 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/mathreference.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc index c5aac49..df9d38d 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc index c7b372d..8a60d5a 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" namespace stdx = std::experimental; diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc index bc84cbd..aa9c72a 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc index 2448a02..3463fda 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" // simd_mask generator functions diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc index ff33cd3..cd46d00 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc index 373b7a3..53e7041 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc index c37e57a..fb73142 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc b/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc index 2e57e8a..e7f273f 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc b/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc index 4fea097..44a70de 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc index 494d160..8e7cfc5 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc b/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc index 315b477..171bae5 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc index 0838813..1f20961 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" @@ -56,6 +57,8 @@ template <typename V> } { + COMPARE(hmin(V(1)), T(1)); + COMPARE(hmax(V(1)), T(1)); const V z([](T i) { return i + 1; }); COMPARE(std::experimental::reduce(z, [](auto a, auto b) { @@ -78,6 +81,25 @@ template <typename V> }), T(V::size() == 1 ? 117 : 2)) << "z: " << z; + COMPARE(hmin(z), T(1)); + COMPARE(hmax(z), T(V::size())); + if (V::size() > 1) + { + COMPARE(hmin(where(z > 1, z)), T(2)); + COMPARE(hmax(where(z > 1, z)), T(V::size())); + } + COMPARE(hmin(where(z < 4, z)), T(1)); + COMPARE(hmax(where(z < 4, z)), std::min(T(V::size()), T(3))); + const V zz = make_value_unknown(z); + COMPARE(hmin(zz), T(1)); + COMPARE(hmax(zz), T(V::size())); + if (V::size() > 1) + { + COMPARE(hmin(where(zz > 1, zz)), T(2)); + COMPARE(hmax(where(zz > 1, zz)), T(V::size())); + } + COMPARE(hmin(where(zz < 4, zz)), T(1)); + COMPARE(hmax(where(zz < 4, zz)), std::min(T(V::size()), T(3))); } test_values<V>({}, {1000}, [](V x) { diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc b/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc index 7856482..15b193d 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc b/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc index 725e1c3..e360dc0 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" template <typename V> diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc b/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc index 83ece72..7eee79d 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,9 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// xfail: run * * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/mathreference.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc b/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc index 208ffc8..7c3584e 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/conversions.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc b/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc index 84d760e..3ed9f86 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" template <typename V> diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc b/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc index 3fd741c..32f8ce9 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc b/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc index 74a15a7..0687662 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/test_values.h" #include "bits/verify.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/where.cc b/libstdc++-v3/testsuite/experimental/simd/tests/where.cc index 134dc7e..e955d2f 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/where.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/where.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/metahelpers.h" |