aboutsummaryrefslogtreecommitdiff
path: root/gcc/genopinit.c
AgeCommit message (Collapse)AuthorFilesLines
2007-12-10genopinit.c: Include tm_p.h in generated file.Kaz Kojima1-0/+1
* genopinit.c: Include tm_p.h in generated file. * config/arm/neon.md (vec_set<mode>_internal): Use INTVAL to extract the integer from operands[2]. (vec_setv2di_internal): Likewise. * config/arm/arm.c (arm_size_return_regs): Make return type unsigned. (arm_init_neon_builtins): Move code after declarations. From-SVN: r130736
2007-09-07stdfix.h: New file.Chao-ying Fu1-2/+42
* ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-08-09optabs.c (expand_widen_pattern_expr): Use optabs accestors.Jan Hubicka1-153/+153
* optabs.c (expand_widen_pattern_expr): Use optabs accestors. (expand_ternary_op): Likewise. (expand_vec_shift_expr): Likewise. (expand_binop_directly): Likewise. (expand_binop): Likewise. (sign_expand_binop): Likewise. (expand_twoval_unop): Likewise. (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise. (widen_clz): Likewise. (widen_bswap): Likewise. (expand_parity): Likewise. (expand_unop): Likewise. (expand_abs_nojump): Likewise. (expand_copysign): Likewise. (emit_no_conflict_block): Likewise. (emit_libcall_block): Likewise. (can_compare_p): Likewise. (prepare_cmp_insn): Likewise. (emit_cmp_and_jump_insn_1): Likewise. (prepare_float_lib_cmp): Likewise. (emit_conditional_add): Likewise. (gen_add2_insn): Likewise. (have_add2_insn): Likewise. (gen_sub2_insn): Likewise. (have_sub2_insn): Likewise. (can_extend_p): Likewise. (can_fix_p): Likewise. (can_float_p): Likewise. (expand_float): Likewise. (expand_fix): Likewise. (expand_sfix_optab): Likewise. (new_optab): Likewise. (new_convert_optab): Likewise. (init_libfuncs): Likewise. (init_interclass_conv_libfuncs): Likewise. (init_intraclass_conv_libfuncs): Likewise. (set_conv_libfunc): Likewise. (init_optabs): Likewise. (debug_optab_libfuncs): Likewise. (gen_cond_trap): Likewise. * optabs.h (optab_handler, convert_optab_hanlder): New. * genopinit.c: Update optabs generation table. * reload.c (find_reloads_address_1): Use optabs accestors. * builtins.c (expand_builtin_mathfn): Likewise. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Likewise. * dojump.c (do_jump): Likewise. * expr.c (convert_move): Likewise. (move_by_pieces): Likewise. (move_by_pieces_ninsns): Likewise. (can_store_by_pieces): Likewise. (store_by_pieces_1): Likewise. (emit_move_via_integer): Likewise. (emit_move_complex): Likewise. (emit_move_ccmode): Likewise. (emit_move_insn_1): Likewise. (emit_single_push_insn): Likewise. (store_constructor): Likewise. (expand_expr_real_1): Likewise. (do_store_flag): Likewise. * ada/misc.c (gnat_compute_largest_alignment): Likewise. (enumerate_modes): Likewise. * tree-vectorizer.c (vect_supportable_dr_alignment): Likewise. (supportable_widening_operation): Likewise. (supportable_narrowing_operation): Likewise. * expmed.c (store_bit_field_1): Likewise. (extract_bit_field_1): Likewise. (expand_mult_highpart_optab): Likewise. (expand_smod_pow2): Likewise. (expand_divmod): Likewise. (emit_store_flag): Likewise. * tree-vect-patterns.c (vect_pattern_recog_1): Likewise. * tree-ssa-loop-prefetch.c (nontemporal_store_p): Likewise. * tree-vect-transform.c (vect_model_reduction_cost): Likewise. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Likewise. (vectorizable_operation): Likewise. (vect_strided_store_supported): Likewise. (vectorizable_store): Likewise. (vect_strided_load_supported): Likewise. (vectorizable_load): Likewise. * combine.c (simplify_comparison): Likewise. * tree-vect-generic.c (type_for_widest_vector_mode): Likewise. (expand_vector_operations_1): Likewise. * config/spu/spu.c (spu_expand_mov): Likewise. (spu_emit_vector_compare): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Likewise. * stmt.c (add_case_node): Likewise. * reload1.c (gen_reload): From-SVN: r127317
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-5/+4
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2007-07-21* genopinit.c (optabs): Missed commit from my previous commit.Uros Bizjak1-1/+1
From-SVN: r126814
2007-07-09optabs.h: Added declaration for signbit_optab.Wolfgang Gellerich1-0/+1
2007-07-09 Wolfgang Gellerich <gellerich@de.ibm.com> * optabs.h: Added declaration for signbit_optab. * optabs.c: (init_optabs): Added initialization for signbit_optab. * genoptinit.c (optabs): Added entry for signbit insns. * builtins.c (expand_builtin_signbit): Added code to use a signbit insn, if available. * config/s390/s390.h (S390_TDC_SIGNBIT_SET): New constant. * config/s390/s390.md (signbit<mode>2): New expander. From-SVN: r126495
2007-06-10tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL.Zdenek Dvorak1-0/+1
* tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL. * tree-predcom.c (mark_virtual_ops_for_renaming): Exported. * tree-ssa-loop-prefetch.c: Include optabs.h. (FENCE_FOLLOWING_MOVNT): New macro. (struct mem_ref): Add independent_p and storent_p fields. (record_ref): Initalize the new fields. (gather_memory_references_ref): Return true if the reference could be analysed. (gather_memory_references): Check whether all memory accesses in loop were recorded. (should_issue_prefetch_p): Return false for nontemporal stores. (nontemporal_store_p, mark_nontemporal_store, emit_mfence_after_loop, may_use_storent_in_loop_p, mark_nontemporal_stores): New functions. (determine_loop_nest_reuse): Detect independent memory references. (loop_prefetch_arrays): Call mark_nontemporal_stores. * tree-flow.h (mark_virtual_ops_for_renaming): Declare. * Makefile.in (tree-ssa-loop-prefetch.o): Add OPTABS_H dependency. * config/i386/i386.h (x86_mfence): Declare. (FENCE_FOLLOWING_MOVNT): Return x86_mfence. * config/i386/i386.c (x86_mfence): New variable. (ix86_init_mmx_sse_builtins): Initialize x86_mfence. * tree-pretty-print.c (dump_generic_node): Mark nontemporal stores. * optabs.c (init_optabs): Initialize storent_optab. * optabs.h (enum optab_index): Add OTI_storent. (storent_optab): Declare. * genopinit.c (optabs): Add initialization for storent_optab. * tree.h (MOVE_NONTEMPORAL): New macro. * expr.c (expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, expand_expr_real_1): Propagate nontemporality of the expanded store. (emit_storent_insn): New function. * expr.h (expand_assignment, store_expr): Declaration changed. * function.c (assign_parm_setup_reg): Pass false as nontemporality to expand_assignment. * stmt.c (expand_asm_expr): Ditto. * calls.c (initialize_argument_information): Pass false as nontemporality to store_expr. * config/i386/sse.md (storentv4sf, storentv2df, storentv2di, storentsi): New. * gcc.dg/tree-ssa/prefetch-7.c: New test. From-SVN: r125604
2007-05-17re PR tree-optimization/24659 (Conversions are not vectorized)Uros Bizjak1-1/+7
PR tree-optimization/24659 * optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi, OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi, OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and OTI_vec_pack_ufix_trunc. (vec_unpacks_float_hi_optab): Define new macro. (vec_unpacks_float_lo_optab): Ditto. (vec_unpacku_float_hi_optab): Ditto. (vec_unpacku_float_lo_optab): Ditto. (vec_pack_sfix_trunc_optab): Ditto. (vec_pack_ufix_trunc_optab): Ditto. * genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[s|u]fix_trunc_optab using vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns * tree-vectorizer.c (supportable_widening_operation): Handle FLOAT_EXPR and CONVERT_EXPR. Update comment. (supportable_narrowing_operation): New function. * tree-vectorizer.h (supportable_narrowing_operation): Prototype. * tree-vect-transform.c (vectorizable_conversion): Handle (nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases. (vect_gen_widened_results_half): Move before vectorizable_conversion. (vectorizable_type_demotion): Call supportable_narrowing_operation() to check for target support. * optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab for VEC_PACK_FIX_TRUNC_EXPR. (expand_binop): Special case mode of the result for vec_pack_[u|s]fix_trunc_optab. (init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[u|s]fix_trunc_optab. * tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR, VEC_PACK_FIX_TRUNC_EXPR): New tree codes. * tree-pretty-print.c (dump_generic_node): Handle VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and VEC_PACK_FIX_TRUNC_EXPR. (op_prio): Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander. (vec_unpacks_float_lo_v8hi): Ditto. (vec_unpacku_float_hi_v8hi): Ditto. (vec_unpacku_float_lo_v8hi): Ditto. (vec_unpacks_float_hi_v4si): Ditto. (vec_unpacks_float_lo_v4si): Ditto. (vec_pack_sfix_trunc_v2df): Ditto. * doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]: Document. [VEC_UNPACK_FLOAT_LO_EXPR]: Ditto. [VEC_PACK_FIX_TRUNC_EXPR]: Ditto. * doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document. [vec_pack_ufix_trunc]: Ditto. [vec_unpacks_float_hi]: Ditto. [vec_unpacks_float_lo]: Ditto. [vec_unpacku_float_hi]: Ditto. [vec_unpacku_float_lo]: Ditto. testsuite/ChangeLog: PR tree-optimization/24659 * gcc.dg/vect/vect-floatint-conversion-2.c: New test. * gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float, not vect_int target. * gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float, not vect_int target. Loop is vectorized for vect_intfloat_cvt targets. * gcc.dg/vect/vect-intfloat-conversion-3.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4a.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4b.c: New test. From-SVN: r124784
2007-05-08md.texi (msub@var{m}@var{n}4, [...]): Document.Chao-ying Fu1-0/+2
* doc/md.texi (msub@var{m}@var{n}4, usub@var{m}@var{n}4): Document. * optabs.h (OTI_smsub_widen, OTI_umsub_widen): New optab_indexes. (smsub_widen_optab, umsub_widen_optab): Define. * optabs.c (init_optabs): Initialize smsub_widen_optab and umsub_widen_optab. * genopinit.c (optabs): Fill in smsub_widen_optab and umsub_widen_optab. * expr.c (expand_expr_real_1): Try to use smsub_widen_optab and umsub_widen_optab to implement multiply-subtract sequences. * config/mips/mips.md (*msac<u>_di): Rename to... (<u>msubsidi4): ...this. Extend condition to include GENERATE_MADD_MSUB and TARGET_DSPR2. Change the constraint of operand 0 to "ka" and use the three-operand form of msub<u> for TARGET_DSPR2. * config/mips/mips-dspr2.md (mips_msub, mips_msubu): Convert to define_expands. From-SVN: r124558
2007-04-242007-xx-xx Chao-ying Fu <fu@mips.com> Richard Sandiford <richard@nildram.co.uk>Richard Sandiford1-0/+2
gcc/ 2007-xx-xx Chao-ying Fu <fu@mips.com> Richard Sandiford <richard@nildram.co.uk> * doc/md.texi (madd@var{m}@var{n}4, umadd@var{m}@var{n}4): Document. * optabs.h (OTI_smadd_widen, OTI_umadd_widen): New optab_indexes. (smadd_widen_optab, umadd_widen_optab): Define. * optabs.c (init_optabs): Initialize smadd_widen_optab and umadd_widen_optab. * genopinit.c (optabs): Fill in smadd_widen_optab and umadd_widen_optab. * expr.c (expand_expr_real_1): Try to use smadd_widen_optab and umadd_widen_optab to implement multiply-add sequences. * config/mips/mips.md (*<su>mul_acc_di): Rename to... (<u>maddsidi4): ...this. Extend condition to include GENERATE_MADD_MSUB and TARGET_DSPR2. Change the constraint of operand 0 to "ka" and use the three-operand form of madd<u> for TARGET_DSPR2. * config/mips/mips-dspr2.md (mips_madd, mips_maddu): Convert to define_expands. * config/mips/constraints.md (ka): New register constraint. gcc/testsuite/ 2007-xx-xx Richard Sandiford <richard@nildram.co.uk> * gcc.target/mips/madd-1.c, gcc.target/mips/madd-2.c, * gcc.target/mips/madd-3.c, gcc.target/mips/madd-4.c, * gcc.target/mips/maddu-1.c, gcc.target/mips/maddu-2.c, * gcc.target/mips/maddu-3.c, gcc.target/mips/maddu-4.c: New tests. From-SVN: r124095
2007-04-22re PR tree-optimization/24659 (Conversions are not vectorized)Uros Bizjak1-2/+3
2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * optabs.h (enum optab_index) [OTI_vec_unpacks_hi, OTI_vec_unpacks_lo]: Update comment to mention floating point operands. (vec_pack_trunc_optab): Rename from vec_pack_mod_optab. * genopinit.c (optabs): Rename vec_pack_mod_optab to vec_pack_trunc_optab. * tree-vect-transform.c (vectorizable_type_demotion): Do not fail early for scalar floating point operands for NOP_EXPR. (vectorizable_type_promotion): Ditto. * optabs.c (optab_for_tree_code) [VEC_PACK_TRUNC_EXPR]: Return vec_pack_trunc_optab. (expand_binop): Rename vec_float_trunc_optab to vec_pack_mod_optab. * tree.def (VEC_PACK_TRUNC_EXPR): Rename from VEC_PACK_MOD_EXPR. * tree-pretty-print.c (dump_generic_node) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. (op_prio) [VEC_PACK_TRUNC_EXPR]: Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_hi_v4sf): New expander. (vec_unpacks_lo_v4sf): Ditto. (vec_pack_trunc_v2df): Ditto. (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. (vec_pack_trunc_v2di): Rename from vec_pack_mod_v2di. * config/rs6000/altivec.md (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. * doc/c-tree.texi (Expression trees) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. This expression also represent packing of floating point operands. [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR]: These expression also represent unpacking of floating point operands. * doc/md.texi (Standard Names) [vec_pack_trunc]: Update documentation. [vec_unpacks_hi]: Ditto. [vec_unpacks_lo]: Ditto. testsuite/ChangeLog: 2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * gcc.dg/vect/vect-float-extend-1.c: New test. * gcc.dg/vect/vect-float-truncate-1.c: New test. From-SVN: r124045
2007-02-20optabs.h (enum optab_index): Add new OTI_scalb.Kaveh R. Ghazi1-0/+1
* optabs.h (enum optab_index): Add new OTI_scalb. (scalb_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize scalb_optab. * genopinit.c (optabs): Implement scalb_optab using scalb?f3 patterns. * builtins.c (expand_builtin_mathfn_2, expand_builtin): Handle BUILT_IN_SCALB{,F,L}, BUILT_IN_SCALBN{,F,L} and BUILT_IN_SCALBLN{,F,L}. (expand_builtin): Expand BUILT_IN_SCALB{,F,L}, BUILT_IN_SCALBN{,F,L} and BUILT_IN_SCALBLN{,F,L} using expand_builtin_mathfn_2 if flag_unsafe_math_optimizations is set. * config/i386/i386.md (scalbxf3, scalb<mode>3): New expanders to implement scalbf, scalb and scalbl built-ins as inline x87 intrinsics. testsuite/ChangeLog * gcc.dg/builtins-34.c: Add scalb/scalbn/scalbln cases. From-SVN: r122162
2007-01-31optabs.h (enum optab_index): Add new OTI_isinf.Uros Bizjak1-0/+1
* optabs.h (enum optab_index): Add new OTI_isinf. (isinf_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize isinf_optab. * genopinit.c (optabs): Implement isinf_optab using isinf?f2 patterns. * builtins.c (mathfn_built_in): Handle BUILT_IN_ISINF{,F,L}. (expand_builtin_interclass_mathfn): Expand BUILT_IN_ISINF{,F,L} using isinf_optab. (expand_builtin): Expand BUILT_IN_ISINF{,F,L} using expand_builtin_interclass_mathfn. * reg_stack.c (subst_stack_regs_pat): Handle UNSPEC_FXAM. * config/i386/i386.md (UNSPEC_FXAM): New constant. (fxam<mode>2_i387): New insn pattern. (isinf<mode>2) New expander to implement isinf, isinff and isinfl built-in functions as x87 inline asm. testsuite/ChangeLog: * gcc.dg/builtins-63.c: New test. From-SVN: r121419
2006-11-22c-tree.texi: Document new tree codes.Ira Rosen1-0/+4
* doc/c-tree.texi: Document new tree codes. * doc/md.texi: Document new optabs. * tree-pretty-print.c (dump_generic_node): Handle print of new tree codes. * optabs.c (optab_for_tree_code, init_optabs): Handle new optabs. * optabs.h (optab_index): Add new. (vec_extract_even_optab, vec_extract_odd_optab, vec_interleave_high_optab, vec_interleave_low_optab): New optabs. * genopinit.c (vec_extract_even_optab, vec_extract_odd_optab, vec_interleave_high_optab, vec_interleave_low_optab): Initialize new optabs. * expr.c (expand_expr_real_1): Add implementation for new tree codes. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving along with macros for their access. * tree-data-ref.h (first_location_in_loop, data_reference): Update comment. * tree-vect-analyze.c (toplev.h): Include. (vect_determine_vectorization_factor): Fix indentation. (vect_insert_into_interleaving_chain, vect_update_interleaving_chain, vect_equal_offsets): New functions. (vect_analyze_data_ref_dependence): Add argument for interleaving check. Check for interleaving if it's true. (vect_check_dependences): New function. (vect_analyze_data_ref_dependences): Call vect_check_dependences for every ddr. Call vect_analyze_data_ref_dependence with new argument. (vect_update_misalignment_for_peel): Update for interleaving. (vect_verify_datarefs_alignment): Check only first data-ref for interleaving. (vect_enhance_data_refs_alignment): Update for interleaving. Check only first data-ref for interleaving. (vect_analyze_data_ref_access): Check interleaving, update interleaving data. (vect_analyze_data_refs): Call compute_data_dependences_for_loop with different parameters. * tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR, VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes. * tree-inline.c (estimate_num_insns_1): Add cases for new codes. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Update step in case of interleaving. (vect_strided_store_supported, vect_permute_store_chain): New functions. (vectorizable_store): Handle strided stores. (vect_strided_load_supported, vect_permute_load_chain, vect_transform_strided_load): New functions. (vectorizable_load): Handle strided loads. (vect_transform_stmt): Add argument. Handle strided stores. Check that vectorized stmt exists for patterns. (vect_gen_niters_for_prolog_loop): Update calculation for interleaving. (vect_transform_loop): Remove stmt_vec_info for strided stores after whole chain vectorization. * config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD, UNSPEC_INTERHI, UNSPEC_INTERLO): New constants. (vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>, vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf, vec_interleave_high<mode>, vec_interleave_low<mode>): Implement. From-SVN: r119088
2006-11-08[multiple changes]Dorit Nuzman1-1/+11
2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-01Add missing genopinit.c change for revision 118361.Geoffrey Keating1-0/+1
From-SVN: r118363
2006-10-29genopinit.c (optabs): Change lfloor_optab and lceil_optab to conversion optabs.Richard Guenther1-2/+2
2006-10-29 Richard Guenther <rguenther@suse.de> * genopinit.c (optabs): Change lfloor_optab and lceil_optab to conversion optabs. * optabs.c (init_optabs): Initialize lfloor_optab and lceil_optab as conversion optab. * optabs.h (enum optab_index): Remove OTI_lfloor and OTI_lceil. (enum convert_optab_index): Add COI_lfloor and COI_lceil. (lfloor_optab, lceil_optab): Adjust defines. * builtins.c (expand_builtin_int_roundingfn): Adjust for lfloor and lceil optabs now being conversion optabs. * config/i386/i386-protos.h (ix86_expand_lfloorceil): Declare. * config/i386/i386.c (ix86_expand_sse_compare_and_jump): New static helper function. (ix86_expand_lfloorceil): New function to expand lfloor and lceil inline. * config/i386/i386.md (lfloor<mode>2): Split into ... (lfloorxf<mode>2): ... x87 variant (lfloor<mode>di2, lfloor<mode>si2): ... and SSE variants using ix86_expand_lfloorceil. (lceil<mode>2, lceilxf<mode>2, lceil<mode>di2, lceil<mode>si2): Likewise. * doc/md.texi (lfloorMN, lceilMN): Document. * gcc.target/i386/math-torture/lfloor.c: New testcase. * gcc.target/i386/math-torture/lceil.c: Likewise. From-SVN: r118143
2006-10-28re PR target/28806 (lround is not expanded inline to SSE conversion sequence)Richard Guenther1-0/+1
2006-10-28 Richard Guenther <rguenther@suse.de> PR target/28806 * builtins.c (expand_builtin_int_roundingfn_2): Expand BUILT_IN_LROUND and BUILT_IN_LLROUND from here. (expand_builtin): Adjust likewise. * genopinit.c (optabs[]): Add lround optab. * optabs.c (init_optabs): Initialize lround_optab. * optabs.h (enum convert_optab_index): Add COI_lround. (lround_optab): Define. * config/i386/i386-protos.h (ix86_expand_lround): Declare. * config/i386/i386.c (ix86_sse_copysign_to_positive): New static function. (ix86_expand_lround): New function. * config/i386/i386.md (lround<mode>di2, lround<mode>si2): New expanders. * doc/md.texi (lroundMN2): Document. * gcc.target/i386/math-torture/lround.c: New testcase. From-SVN: r118105
2006-10-25optabs.h (enum optab_index): Remove OTI_lrint.Richard Guenther1-1/+1
2006-10-25 Richard Guenther <rguenther@suse.de> * optabs.h (enum optab_index): Remove OTI_lrint. (enum convert_optab_index): Add COI_lrint. (lrint_optab): Adjust. (expand_sfix_optab): Declare. * optabs.c (expand_sfix_optab): New function. (init_optabs): Init lrint_optab as conversion optab. * genopinit.c (lrint_optab): Change to a conversion optab. * builtins.c (expand_builtin_int_roundingfn_2): Adjust to expansion via conversion optab. * config/i386/i386.md (*fistdi2_1): Remove flag_unsafe_math_optimizations guard. (fistdi2, fistdi2_with_temp, *fist<mode>2_1, fist<mode>2, fist<mode>2_with_temp): Likewise. (lrint<mode>2): Split into... (lrintxf<mode>2): ... x87 part (lrint<mode>di2, lrint<mode>si2): ... and SSE parts. * config/i386/sse.md (sse_cvtss2si_2, sse_cvtss2_siq_2, sse2_cvtsd2si_2, sse2_cvtsd2siq_2): New insns for UNSPEC_FIX_NOTRUNC matching non-vector float modes. * doc/md.texi (lrintMN2): Document. From-SVN: r118029
2006-10-25optabs.h (enum optab_index): Rename OTI_drem to OTI_remainder.Uros Bizjak1-1/+1
* optabs.h (enum optab_index): Rename OTI_drem to OTI_remainder. (remainder_optab): Define corresponding macro. (drem_optab): Remove. * optabs.c (init_optabs): Initialize remainder_optab. Remove drem_optab initialization. * genopinit.c (optabs): Implement remainder_optab using remainder?f3 patterns. Remove drem_optab. * builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_REMAINDER{,F,L} using remainder_optab. (expand_builtin): Expand BUILT_IN_REMAINDER{,F,L} using expand_builtin_mathfn_2. (expand_builtin) [BUILT_IN_FMOD, BUILT_IN_DREM]: Do not depend on flag_unsafe_math_optimizations. * config/i386/i386.md ("remaindersf3", "remainderdf3") ("remainderxf3"): Renamed from "drem{s,d,x}f3" expanders. Do not depend on flag_unsafe_math_optimizations. Use truncxf?f expander instead of truncxf?f_i387_noop. ("fpremxf4", "fprem1xf4"): Do not depend on flag_unsafe_math_optimizations. ("fmodsf3", "fmoddf3", "fmodxf3"): Do not depend on flag_unsafe_math_optimizations. Use truncxf?f expander instead of truncxf?f_i387_noop. * doc/md.texi (fmod, remainder): Document standard named pattern. testsuite/ChangeLog: * gcc.dg/builtins-40.c: Also check remainder(), remainderf() and remainderl() built-in functions. Remove -ffast-math from dg-options. From-SVN: r118024
2006-01-23r110124@banpei: zack | 2006-01-22 14:45:55 -0800Zack Weinberg1-7/+0
r110124@banpei: zack | 2006-01-22 14:45:55 -0800 * gensupport.c: Define get_insn_name and record_insn_name here. (read_md_rtx): Call record_insn_name as appropriate. * genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c * genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c * genpreds.c, genrecog.c: Don't define get_insn_name nor record_insn_name. * Makefile.in (BUILD_SUPPORT, BUILD_PRINT): Fold into BUILD_RTL. (BUILD_VARRAY): Delete. (genprognormal): Rename genprogmd. Fold in all programs from genprognoprint; also attrtab. (build/genattrtab): Just mention genautomata.o and varray.o. Reorganize a bit, add comments to make the categories clearer. From-SVN: r110120
2006-01-19Makefile.in (tree-vect-patterns.o): Add rule for new file.Dorit Nuzman1-1/+5
* Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2005-12-19optabs.c (init_floating_libfuncs): Handle decimal float modes.Jon Grimm1-1/+3
* optabs.c (init_floating_libfuncs): Handle decimal float modes. (init_optabs): Handle libfuncs for decimal float. * genopinit.c (gen_insn): Handle MODE_DECIMAL_FLOAT. * stor-layout.c (int_mode_for_mode): Likewise. * simplify-rtx.c (simplify_immed_subreg): Likewise. (simplify_unary_operation_1): Skip optimisations for decimal float modes. * varasm.c (output_constant_pool_2): Handle MODE_DECIMAL_FLOAT. * emit-rtl.c (gen_const_vector): Add assertion check. (init_emit_once): Populate const_tiny_rtx with constants in each decimal float mode. * expmed.c (extract_high_half, expand_mult_highpart_optab, expand_mult_highpart): Assert that mode is not a scalar float mode. * expr.c (convert_move): Handle conversion between decimal and binary floats of the same size. * convert.c (convert_to_real): Consider decimal float types when folding. * dwarf2out.c (base_type_die): Use DW_ATE_decimal_float to describe decimal floating point types. Co-Authored-By: Ben Elliston <bje@au.ibm.com> Co-Authored-By: Janis Johnson <janis187@us.ibm.com> From-SVN: r108762
2005-11-22optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of explicitly ↵Ben Elliston1-1/+1
testing GET_MODE_CLASS (x) ==... * optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of explicitly testing GET_MODE_CLASS (x) == MODE_FLOAT. * genopinit.c (gen_insn): Likewise. * reload.c (find_equiv_reg): Likewise. * loop.c (load_mems): Likewise. * rtlanal.c (may_trap_p_1, canonicalize_condition): Likewise. * cse.c (find_comparison_args, fold_rtx): Likewise. * dwarf2out.c (add_const_value_attribute): Likewise. * expr.c (convert_move): Likewise. * recog.c (general_operand, register_operand): Likewise. * reg-stack.c (replace_reg): Likewise. * tree-vect-generic.c (type_for_widest_vector_mode): Likewise. * c-common.c (handle_vector_size_attribute): Likewise. * simplify-rtx.c (simplify_const_unary_operation): Likewise. (simplify_binary_operation_1): Likewise. (simplify_const_binary_operation): Likewise. (simplify_relational_operation): Likewise. (simplify_const_relational_operation): Likewise. (simplify_immed_subreg): Likewise. * emit-rtl.c (gen_lowpart_common): Likewise. * expmed.c (expand_mult): Likewise. * stor-layout.c (layout_type): Likewise. From-SVN: r107322
2005-11-20expr.c (expand_expr_real): Use usmul_optab for widening signed * unsigned ↵Bernd Schmidt1-0/+1
multiplies. * expr.c (expand_expr_real): Use usmul_optab for widening signed * unsigned multiplies. * genopinit.c (optabs): Add usmul_widen_optab. * optabs.c (init_optabs): Likewise. * optabs.h (enum optab_index): Add OTI_usmul_widen. (usmul_widen_optab): Define. * config/bfin/bfin.md (usmulhisi3): New pattern. * doc/md.texi (usmulqihi3, usmulhisi3, usmulsidi3): Document. From-SVN: r107258
2005-07-12builtins.c: (expand_builtin_memcmp, expand_builtin_strncmp): ↵Adrian Straetling1-0/+1
s/cmpstrsi/cmpstrnsi 2005-07-12 Adrian Straetling <straetling@de.ibm.com> * builtins.c: (expand_builtin_memcmp, expand_builtin_strncmp): s/cmpstrsi/cmpstrnsi (expand_builtin_strcmp): Rewrite to support both 'cmpstrsi' and 'cmpstrnsi'. * optabs.c: (prepare_cmp_insn): Add availability of 'cmpstrn'. (init_optabs): Initialize cmpstrn_optab. * optabs.h: (enum insn_code cmpstrn_optab): Declare. * genopinit.c: (optabs[]): Add 'cmpstrn' to initialisation. * expr.c: (enum insn_code cmpstrn_optab): Declare. * config/i386/i386.md: s/cmpstr/cmpstrn * config/c4x/c4x.md: s/cmpstr/cmpstrn * doc/md.texi: Update documentation. From-SVN: r101916
2005-06-28builtins.c: (expand_builtin_memset): Rewrite to support ↵Adrian Straetling1-1/+1
'set_storage_via_setmem'. 2006-06-28 Adrian Straetling <straetling@de.ibm.com> * builtins.c: (expand_builtin_memset): Rewrite to support 'set_storage_via_setmem'. * expr.c: (enum insn_code setmem_optab): Define. (enum insn_code clrmem_optab): Remove. (set_storage_via_setmem): New function. (clear_storage_via_setmem): Remove. (clear_storage): Replace call to "clear_storage_via_clrmem" with "set_storage_via_setmem". * expr.h: (set_storage_via_setmem): Declare. (CLEAR_RATIO): Redefine using HAVE_setmemM. * optabs.h: (enum insn_code setmem_optab): Declare. (enum insn_code clrmem_optab): Remove. * optabs.c: (init_optabs): Initialize setmem_optab. (enum insn_code clrmem_optab): Remove. * genopinit.c: (otabs): Likewise. * doc/md.texi: Document new standard pattern 'setmem'. Remove 'clrmem'. * config/alpha/alpha.c: (alpha_expand_block_clear): Adjust 'operands' ordering. * config/frv/frv.c: (frv_expand_block_clear): Likewise. * config/rs6000/rs6000.c: (expand_block_clear): Likewise. * config/alpha/alpha.md: ("clrmemqi", "clrmemdi"): Rename to "setmemM". FAIL on operands[2]!=const0_rtx. Adjust 'operands' ordering. * config/avr/avr.md: ("clrmemhi"): Likewise. * config/frv/frv.md: ("clrmemsi"): Likewise. * config/i386/i386.md: ("clrmemsi", "clrmemdi"): Likewise. * config/pa/pa.md: ("clrmemsi", "clrmemdi"): Likewise. * config/rs6000/rs6000.md: ("clrmemsi"): Likewise. * config/s390/s390.md: ("clrmem<mode>"): Likewise. From-SVN: r101386
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101317
2005-06-21genopinit.c (vec_shl_optab, [...]): Initialize new optabs.Dorit Nuzman1-1/+4
* genopinit.c (vec_shl_optab, vec_shr_optab): Initialize new optabs. (reduc_plus_optab): Removed. Replcaed with... (reduc_splus_optab, reduc_uplus_optab): Initialize new optabs. * optabs.c (optab_for_tree_code): Return reduc_splus_optab or reduc_uplus_optab instead of reduc_plus_optab. (expand_vec_shift_expr): New function. (init_optabs): Initialize new optabs. Remove initialization of reduc_plus_optab. (optab_for_tree_code): Return vec_shl_optab/vec_shr_optab for VEC_LSHIFT_EXPR/VEC_RSHIFT_EXPR. * optabs.h (OTI_reduc_plus): Removed. Replaced with... (OTI_reduc_splus, OTI_reduc_uplus): New. (reduc_plus_optab): Removed. Replcaed with... (reduc_splus_optab, reduc_uplus_optab): New optabs. (vec_shl_optab, vec_shr_optab): New optabs. (expand_vec_shift_expr): New function declaration. * tree.def (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. * expr.c (expand_expr_real_1): Handle new tree-codes. * tree-pretty-print.c (dump_generic_node, op_symbol, op_prio): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Add assert. * tree-vect-transform.c (vect_create_epilog_for_reduction): Add two alternatives for generating reduction epilog code. (vectorizable_reduction): Don't fail of direct reduction support is not available. (vectorizable_target_reduction_pattern): Likewise. * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, reduc_umax_v4si, reduc_smin_v4si, reduc_smin_v4sf, reduc_umin_v4si, reduc_plus_v4si, reduc_plus_v4sf): Removed. (vec_shl_<mode>, vec_shr_<mode>, altivec_vsumsws_nomode, reduc_splus_<mode>, reduc_uplus_v16qi): New. From-SVN: r101231
2005-06-18tree.def (REDUC_MAX_EXPR, [...]): New tree-codes.Dorit Nuzman1-1/+6
* tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): New tree-codes. * optabs.h (OTI_reduc_smax, OTI_reduc_umax, OTI_reduc_smin, OTI_reduc_umin, OTI_reduc_plus): New optabs for reduction. (reduc_smax_optab, reduc_umax_optab, reduc_smin_optab, reduc_umin_optab, reduc_plus_optab): New optabs for reduction. * expr.c (expand_expr_real_1): Handle new tree-codes. * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio, op_symbol): Handle new tree-codes. * optabs.c (optab_for_tree_code): Handle new tree-codes. (init_optabs): Initialize new optabs. * genopinit.c (optabs): Define handlers for new optabs. * tree-vect-analyze.c (vect_analyze_operations): Fail vectorization in case of a phi that is marked as relevant. Call vectorizable_reduction. (vect_mark_relevant): Phis may be marked as relevant. (vect_mark_stmts_to_be_vectorized): The use corresponding to the reduction variable in a reduction stmt does not mark its defining phi as relevant. Update documentation accordingly. (vect_can_advance_ivs_p): Skip reduction phis. * tree-vect-transform.c (vect_get_vec_def_for_operand): Takes additional argument. Handle reduction. (vect_create_destination_var): Update call to vect_get_new_vect_var. Handle non-vector argument. (get_initial_def_for_reduction): New function. (vect_create_epilog_for_reduction): New function. (vectorizable_reduction): New function. (vect_get_new_vect_var): Handle new vect_var_kind. (vectorizable_assignment, vectorizable_operation, vectorizable_store, vectorizable_condition): Update call to vect_get_new_vect_var. (vect_transform_stmt): Call vectorizable_reduction. (vect_update_ivs_after_vectorizer): Skip reduction phis. (vect_transform_loop): Skip if stmt is both not relevant and not live. * tree-vectorizer.c (reduction_code_for_scalar_code): New function. (vect_is_simple_reduction): Was empty - added implementation. * tree-vectorizer.h (vect_scalar_var): New enum vect_var_kind value. (reduc_vec_info_type): New enum vect_def_type value. * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, reduc_umax_v4si, reduc_smin_v4si, reduc_umin_v4sf, reduc_smin_v4sf, reduc_plus_v4si, reduc_plus_v4sf): New define_expands. * tree-vect-analyze.c (vect_determine_vectorization_factor): Remove ENABLE_CHECKING around gcc_assert. * tree-vect-transform.c (vect_do_peeling_for_loop_bound, (vect_do_peeling_for_alignment, vect_transform_loop, vect_get_vec_def_for_operand): Likewise. From-SVN: r101155
2005-04-14re PR middle-end/14311 (builtins for atomic operations needed)Richard Henderson1-1/+24
PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-11* builtins.def (BUILT_IN_LCEIL, BUILT_IN_LCEILF, BUILT_IN_LCEILL)Uros Bizjak1-0/+1
(BUILT_IN_LLCEIL, BUILT_IN_LLCEILF, BUILT_IN_LLCEILL): New. * optabs.h (enum optab_index): Add new OTI_lceil. (lceil_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize lceil_optab. * genopinit.c (optabs): Implement lceil_optab using lceilsi2 and lceildi2 patterns. * builtins.c (expand_builtin_int_roundingfn): Handle BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L}. (fold_builtin_int_roundingfn): Handle BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L}. (fold_builtin_1): Fold BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L} using fold_builtin_int_roundingfn. (mathfn_built_in): Handle BUILT_IN LCEIL and BUILT_IN_LLCEIL. (expand_builtin): Expand BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L} using expand_builtin_int_roundingfn. * convert.c (convert_to_integer): Convert (long int)ceil{,f,l}, into lceil built-in function and (long long int)ceil{,f,l} into llceil built-in function. * fold-const.c (tree_expr_nonnegative_p): Add BUILT_IN_LCEIL and BUILT_IN_LLCEIL. testsuite: * gcc.dg/builtins-53.c: Also check (int)ceil* and (long long int)ceil*. From-SVN: r97964
2005-04-09* builtins.def (BUILT_IN_LFLOOR, BUILT_IN_LFLOORF, BUILT_IN_LFLOORL)Uros Bizjak1-0/+1
(BUILT_IN_LLFLOOR, BUILT_IN_LLFLOORF, BUILT_IN_LLFLOORL): New. * optabs.h (enum optab_index): Add new OTI_lfloor. (lfloor_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize lfloor_optab. * genopinit.c (optabs): Implement lfloor_optab using lfloorsi2 and lfloordi2 patterns. * builtins.c (expand_builtin_int_roundingfn): New prototype. (expand_builtin_int_roundingfn): New function. (fold_builtin_int_roundingfn): New prototype. (fold_builtin_int_roundingfn): New function, renamed from fold_builtin_lround. Handle BUILT_IN_LROUND{,F,L}, BUILT_IN_LLROUND{,F,L} and BUILT_IN_LFLOOR{,F,L}, BUILT_IN_LLFLOOR{,F,L}. (fold_builtin_1): Fold BUILT_IN_LFLOOR{,F,L} and BUILT_IN_LLFLOOR{,F,L} using fold_builtin_int_roundingfn. (mathfn_built_in): Handle BUILT_IN LFLOOR and BUILT_IN_LLFLOOR. (expand_builtin): Expand BUILT_IN_LFLOOR{,F,L} and BUILT_IN_LLFLOOR{,F,L} using expand_builtin_int_roundingfn. * convert.c (convert_to_integer): Convert (long int)floor{,f,l}, into lfloor built-in function and (long long int)floor{,f,l} into llfloor built-in function. * fold-const.c (tree_expr_nonnegative_p): Add BUILT_IN_LFLOOR and BUILT_IN_LLFLOOR. testsuite: * gcc.dg/builtins-53.c: New test. From-SVN: r97886
2005-03-24optabs.h (enum optab_index): Remove OTI_llrint.Uros Bizjak1-1/+0
* optabs.h (enum optab_index): Remove OTI_llrint. (llrint_optab): Remove macro. * optabs.c (init_optabs): Remove llrint_optab initialization. * genopinit.c (optabs): Remove llrint_optab implementation. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LLRINT{,F,L} using lrint_optab. From-SVN: r96983
2005-03-21optabs.h (enum optab_index): Add new OTI_lrint and OTI_llrint.Uros Bizjak1-0/+2
* optabs.h (enum optab_index): Add new OTI_lrint and OTI_llrint. (lrint_optab, llrint_optab): Define corresponding macros. * optabs.c (init_optabs): Initialize lrint_optab and llrint_optab. * genopinit.c (optabs): Implement lrint_optab using lrintsi2 pattern and llrint_optab using llrintdi2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LRINT{,F,L} using lrint_optab and BUILT_IN_LLRINT{,F,L} using llrint_optab. (expand_builtin): Expand BUILT_IN_LRINT{,F,L} and BUILT_IN_LLRINT{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. testsuite: * gcc.dg/builtins-46.c: Also check lrint* and llrint*. From-SVN: r96802
2005-02-12optabs.h (enum optab_index): Add new OTI_ldexp.Uros Bizjak1-0/+1
* optabs.h (enum optab_index): Add new OTI_ldexp. (ldexp_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize ldexp_optab. * genopinit.c (optabs): Implement ldexp_optab using ldexp?f3 patterns. * builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_LDEXP{,F,L} using ldexp_optab. (expand_builtin): Expand BUILT_IN_LDEXP{,F,L} using expand_builtin_mathfn_2 if flag_unsafe_math_optimizations is set. * config/i386/i386.md (ldexpsf3, ldexpdf3, ldexpxf3): New expanders to implement ldexpf, ldexp and ldexpl built-ins as inline x87 intrinsics. testsuite: * gcc.dg/builtins-34.c: Also check ldexp*. From-SVN: r94931
2005-01-27builtins.c (expand_builtin_copysign): New.Richard Henderson1-0/+1
* builtins.c (expand_builtin_copysign): New. (expand_builtin): Call it. * genopinit.c (optabs): Add copysign_optab. * optabs.c (init_optabs): Initialize it. (expand_copysign): New. * optabs.h (OTI_copysign, copysign_optab): New. (expand_copysign): Declare. * config/alpha/alpha.md (UNSPEC_COPYSIGN): New. (copysignsf3, ncopysignsf3, copysigndf3, ncopysigndf3): New. * config/i386/i386.c (ix86_build_signbit_mask): Split from ... (ix86_expand_fp_absneg_operator): ... here. (ix86_split_copysign): New. * config/i386/i386-protos.h: Update. * config/i386/i386.md (UNSPEC_COPYSIGN): New. (copysignsf3, copysigndf3): New. * config/ia64/ia64.md (UNSPEC_COPYSIGN): New. (copysignsf3, ncopysignsf3): New. (copysigndf3, ncopysigndf3): New. (copysignxf3, ncopysignxf3): New. * config/ia64/ia64.c (rtx_needs_barrier): Handle UNSPEC_COPYSIGN. From-SVN: r94357
2005-01-22genopinit.c (optabs): Use smin/smax for floating point too.Richard Henderson1-5/+3
* genopinit.c (optabs): Use smin/smax for floating point too. * doc/md.texi: Update to match. Clarify that floating point results are undefined for +0/-0 and NaN. * doc/rtl.texi: Likewise. * rtl.def (SMIN, SMAX): Likewise * tree.def (MIN_EXPR, MAX_EXPR): Likewise. * config/alpha/alpha.md (smaxdf3, smindf3, smaxsf3, sminsf3): Add leading 's' to the name. * config/ia64/ia64.md (smaxsf3, sminsf3, smaxdf3, smindf3, smaxxf3, sminxf3): Likewise. * config/rs6000/rs6000.md (smaxdf3, smindf3, smaxsf3, sminsf3): Likewise. From-SVN: r94083
2004-12-22optabs.h (OTI_movmisalign, [...]): New.Richard Henderson1-0/+1
* optabs.h (OTI_movmisalign, movmisalign_optab): New. * optabs.c (init_optabs): Create it. * genopinit.c (optabs): Initialize it. * expr.c (expand_expr_real_1) <MISALIGNED_INDIRECT_REF>: Use it. * tree-vectorizer.c (vect_supportable_dr_alignment): Likewise. * target-def.h (TARGET_VECTORIZE_MISALIGNED_MEM_OK): Remove. * target.h (vectorize.misaligned_mem_ok): Remove. * targhooks.c (default_vect_misaligned_mem_ok): Remove. * doc/md.texi (movmisalign): New. * doc/tm.texi (TARGET_VECTORIZE_MISALIGNED_MEM_OK): Remove. From-SVN: r92537
2004-12-09genopinit.c (vec_realign_store_optab): Initialization removed.Dorit Naishlos1-1/+0
2004-12-09 Dorit Naishlos <dorit@il.ibm.com> * genopinit.c (vec_realign_store_optab): Initialization removed. * optabs.c (optab_for_tree_code): REALIGN_STORE_EXPR case removed. * optabs.h (optab_index): OTI_vec_realign_store Removed. (vec_realign_store_optab): Removed. * target-def.h (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Removed. * target.h (builtin_mask_for_store): Removed. * tree.def (REALIGN_STORE_EXPR): Removed. * config/rs6000/rs6000.c (rs6000_builtin_mask_for_store): Removed. (altivec_builtin_mask_for_store): Removed. (altivec_init_builtins): Removed initialization of altivec_builtin_mask_for_store. * doc/tm.texi (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): New. From-SVN: r91932
2004-09-27expr.c (expand_expr_real_1): Handle VEC_COND_EXPR.Devang Patel1-1/+3
* expr.c (expand_expr_real_1): Handle VEC_COND_EXPR. * genopinit.c (optabs): New entry for vcond_gen_code and vcondu_gen_code. * optabs.c (vcond_gen_code, vcondu_gen_code): New optabs. (get_rtx_code): New function. (vector_compare_rtx): New function. (init_optabs): Initialize vcond_gen_code and vcondu_gen_code. (expand_vec_cond_expr_p): New function. (expand_vec_cond_expr): New function. (get_vcond_icode): New function. * optabs.h (expand_vec_cond_expr, expand_vec_cond_expr_p): New externs. (vcond_gen_code, vcondu_gen_code): Same. From-SVN: r88209
2004-09-23tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes.Dorit Naishlos1-1/+3
2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-09Makefile.in (gengtype): Use $(BUILD_ERRORS).Nathan Sidwell1-1/+1
* Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-04builtins.c (expand_builtin_mathfn): Handle BUILT_IN_RINT{,F,L} using rint_optab.Uros Bizjak1-1/+2
2004-09-04 Uros Bizjak <uros@kss-loka.si> * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_RINT{,F,L} using rint_optab. (expand_builtin): Expand BUILT_IN_RINT{,F,L} using expand_builtin_mathfn. * genopinit.c (optabs): Rename trunc_optab to btrunc_optab. Use btrunc?f patterns for btrunc_optab. Implement rint_optab using rint?f patterns. * optabs.c (init_optabs): Initialize rint_optab. * optabs.h (enum optab_index): Rename OTI_trunc to OTI_btrunc. Add new OTI_rint. (btrunc_optab): Rename macro from trunc_optab. (rint_optab): Define corresponding macro. * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FRNDINT_FLOOR, UNSPEC_FRNDINT_CEIL, UNSPEC_FRNDINT_TRUNC, UNSPEC_FRNDINT_MASK_PM. * config/i386/i386-protos.h (emit_i387_cw_initialization): Change prototype. Add new int parameter. * config/i386/i386.c (emit_i387_cw_initialization): Handle new rounding modes. * config/i386/i386.h (enum fp_cw_mode): Delete. (MODE_NEEDED): Handle new rounding modes. (EMIT_MODE_SET): Change condition to handle new rounding modes. * config/i386/i386.md (UNSPEC_FRNDINT_FLOOR, UNSPEC_FRNDINT_CEIL, UNSPEC_FRNDINT_TRUNC, UNSPEC_FRNDINT_MASK_PM): New unspecs to represent different rounding modes of frndint insn. (type): Add frndint type. (i387, length, memory): Handle this type. (i387_cw): New attribute definition. (*fix_truncdi_1, fix_truncdi_nomemory, fix_truncdi_memory, *fix_truncsi_1, fix_truncsi_nomemory, fix_truncsi_memory, *fix_trunchi_1, fix_trunchi_nomemory, fix_trunchi_memory): Add "i387_cw" attribute defined to "trunc". (x86_fnstcw_1): Remove comment. (*frndintxf2): Rename insn definition to frndintxf2. Move insn definition near rint?f2 expanders. (rintdf2, rintsf2, rintxf2): New expanders to implement rint, rintf and rintl built-ins as inline x87 intrinsics. (frndintxf2_floor): New pattern to implement floor rounding mode with frndint x87 instruction. (floordf2, floorsf2, floorxf2): New expanders to implement floor, floorf and floorl built-ins as inline x87 intrinsics. (frndintxf2_ceil): New pattern to implement ceil rounding mode with frndint x87 instruction. (ceildf2, ceilsf2, ceilxf2): New expanders to implement ceil, ceilf and ceill built-ins as inline x87 intrinsics. (frndintxf2_trunc): New pattern to implement trunc rounding mode with frndint x87 instruction. (btruncdf2, btruncsf2, btruncxf2): New expanders to implement trunc, truncf and truncl built-ins as inline x87 intrinsics. (frndintxf2_mask_pm): New pattern to implement rounding mode with exceptions with frndint x87 instruction. (nearbyintdf2, nearbyintsf2, nearbyintxf2): New expanders to implement nearbyint, nearbyintf and nearbyintl built-ins as inline x87 intrinsics. * testsuite/gcc.dg/builtins-46.c: New. From-SVN: r87076
2004-08-03gensupport.c (init_md_reader_args_cb): Renamed from init_md_reader_args.Zack Weinberg1-3/+0
* gensupport.c (init_md_reader_args_cb): Renamed from init_md_reader_args. Add third option, callback function for parsing program-specific options. Add diagnosis of incorrect number of input files. (init_md_reader): Fold into init_md_reader_args_cb. (init_md_reader_args): Now a thin wrapper around init_md_reader_args_cb. * gensupport.h: Update prototypes. * genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c * genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c * genrecog.c: No need to diagnose lack of an input file; init_md_reader_args will handle it. * genconditions.c: Likewise, and use init_md_reader_args. * genconstants.c: Likewise, and no need to call read_md_rtx. From-SVN: r85511
2004-08-02* genopinit.c (gen_insn): Check for MODE_COMPLEX_FLOAT patterns for $F.J"orn Rennecke1-0/+1
From-SVN: r85435
2004-07-07builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to ↵Alexandre Oliva1-2/+2
clrmem*. gcc/ChangeLog: * builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. * expr.c: Likewise. * expr.h: Likewise. * genopinit.c: Likewise. * integrate.c: Likewise. * local-alloc.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * config/alpha/alpha.h: Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm-protos.h: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.md: Likewise. * config/c4x/c4x.c: Likewise. * config/c4x/c4x.md: Likewise. * config/frv/frv.md: Likewise. * config/i386/i386-protos.h: Likewise. * config/i386/i386.c: Likewise. * config/i386/i386.h: Likewise. * config/i386/i386.md: Likewise. * config/i860/i860.c: Likewise. * config/i860/i860.md: Likewise. * config/ip2k/ip2k.md: Likewise. * config/ip2k/libgcc.S: Likewise. * config/ip2k/t-ip2k: Likewise. * config/m32r/m32r.c: Likewise. * config/m32r/m32r.md: Likewise. * config/mcore/mcore.md: Likewise. * config/mips/mips.c: Likewise. * config/mips/mips.md: Likewise. * config/ns32k/ns32k.c: Likewise. * config/ns32k/ns32k.h: Likewise. * config/ns32k/ns32k.md: Likewise. * config/pa/pa.c: Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.h: Likewise. * config/pdp11/pdp11.md: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rs6000/rs6000.md: Likewise. * config/s390/s390-protos.h: Likewise. * config/s390/s390.c: Likewise. * config/s390/s390.md: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/t-sh: Likewise. * config/sparc/sparc.h: Likewise. * config/vax/vax.md: Likewise. * config/xtensa/xtensa.c: Likewise. * config/xtensa/xtensa.md: Likewise. * doc/invoke.texi: Likewise. * doc/md.texi: Likewise. * doc/rtl.texi: Likewise. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/builtins/mempcpy-2.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. From-SVN: r84222
2004-05-07optabs.h (enum optab_index): Add new OTI_log1p.Uros Bizjak1-0/+1
* optabs.h (enum optab_index): Add new OTI_log1p. (log1p_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize log1p_optab. * genopinit.c (optabs): Implement log1p_optab using log1p?f2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOG1P{,F,L} using log1p_optab. (expand_builtin): Expand BUILT_IN_LOG1P{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FYL2XP1. * config/i386/i386.c (ix86_emit_i387_log1p): New function. * config/i386/i386-protos.h (ix86_emit_i387_log1p): Prototype here. * config/i386/i386.md (UNSPEC_FYL2XP1): New unspec to represent x87's fyl2xp1 instruction. (*fyl2x_xf3): Rename insn definition to fyl2x_xf3. (fyl2xp1_xf3): New pattern to implement fyl2xp1 x87 instruction. (log1psf2, log1pdf2, log1pxf2): New expanders to implement log1pf, log1p and log1pl built-ins as inline x87 intrinsics. * testsuite/gcc.dg/builtins-33.c: Also check log1p*. From-SVN: r81606
2004-05-06optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem.Uros Bizjak1-0/+2
* optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem. (fmod_optab): Define corresponding macros. * optabs.c (init_optabs): Initialize fmod_optab and drem_optab. * genopinit.c (optabs): Implement fmod_optab and drem_optab using fmod?f3 and drem?f3 patterns. * builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_FMOD{,F,L} using fmod_optab and BUILT_IN_DREM{,F,L} using drem_optab. (expand_builtin): Expand BUILT_IN_FMOD{,F,L} and BUILT_IN_DREM{,F,L} using expand_builtin_mathfn_2 if flag_unsafe_math_optimizations is set. * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FPREM_F, UNSPEC_FPREM_U, UNSPEC_FPREM1_F and UNSPEC_FPREM1_U. * config/i386/i386.c (ix86_emit_fp_unordered_jump): New function. * config/i386/i386-protos.h (ix86_emit_fp_unordered_jump): Prototype here. * config/i386/i386.md (UNSPEC_FPREM_F, UNSPEC_FPREM_U, UNSPEC_FPREM1_F, UNSPEC_FPREM1_U): New unspecs to represent x87's fprem and fprem1 instructions. (*x86_fnstsw_1): Change input parameter to (reg:CCFP 18). Rename insn definition to x86_fnstsw_1. (fpremxf4, fprem1xf4): New patterns to implement fprem and fprem1 x87 instructions. (fmodsf3, fmoddf3, fmodxf3): New expanders to implement fmodf, fmod and fmodl built-ins as inline x87 intrinsics. (dremsf3, dremdf3, dremxf3): New expanders to implement dremf, drem and dreml built-ins as inline x87 intrinsics. * testsuite/gcc.dg/builtins-40.c: New test. From-SVN: r81555
2004-05-03optabs.h (enum optab_index): Add new OTI_expm1.Uros Bizjak1-0/+1
2004-05-03 Uros Bizjak <uros@kss-loka.si> * optabs.h (enum optab_index): Add new OTI_expm1. (expm1_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize expm1_optab. * genopinit.c (optabs): Implement expm1_optab using expm1?f2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_EXPM1{,F,L} using expm1_optab. (expand_builtin): Expand BUILT_IN_EXPM1{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. * config/i386/i386.md (expm1df2, expm1sf2, expm1xf2): New expanders to implement expm1, expm1f and expm1l built-ins as inline x87 intrinsics. testsuite: * gcc.dg/builtins-34.c: Also check expm1*. From-SVN: r81425