aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
AgeCommit message (Collapse)AuthorFilesLines
2004-09-09ra-build.c (copy_insn_p, [...]): Use gcc_assert and gcc_unreachable instead ↵Nathan Sidwell1-64/+53
of abort. * ra-build.c (copy_insn_p, remember_move, defuse_overlap_p_1, live_out_1, prune_hardregs_for_mode, init_one_web_common, reinit_one_web, add_subweb, add_subweb_2, init_web_parts, record_conflict, compare_and_free_webs, init_webs_defs_uses, parts_to_webs_1, parts_to_webs, reset_conflicts, check_conflict_numbers, remember_web_was_spilled, handle_asm_insn, ra_build_free): Use gcc_assert and gcc_unreachable instead of abort. * ra-colorize.c (push_list, put_web, reset_lists, put_web_at_end, put_move, remove_move, combine, select_spill, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias, restore_conflicts_from_coalesce, sort_and_combine_web_pairs, check_uncoalesced_moves): Likewise. * ra-rewrite.c (spill_coalescing, slots_overlap_p, emit_loads, reloads_to_loads, rewrite_program2, emit_colors): Likewise. * ra.c (first_hard_reg, create_insn_info, find_subweb, init_ra, check_df): Likewise. * real.c (do_add, do_multiply, do_divide, do_compare, do_fix_trunc, real_arithmetic, real_compare, real_exponent, real_ldexp, real_identical, real_to_integer, real_to_integer2, real_to_decimal, real_to_hexadecimal, real_from_integer, ten_to_ptwo, ten_to_mptwo, real_digit, real_nan, real_maxval, round_for_format, real_convert, real_to_target, real_from_target, real_hash, encode_ieee_single, encode_ieee_double, encode_ieee_extended, encode_ieee_quad, encode_vax_f, encode_vax_d, encode_vax_g, encode_i370_single, encode_i370_double, encode_c4x_single, encode_c4x_extended): Likewise. * recog.c (validate_change, validate_replace_rtx_1, asm_operand_ok, extract_insn, peep2_next_insn, peep2_reg_dead_p, peep2_find_free_register, peephole2_optimize, store_data_bypass_p, if_test_bypass_p): Likewise. * reg-stack.c (record_label_references, get_asm_operand_n_inputs, stack_result, remove_regno_note, get_hard_regnum, emit_pop_insn, emit_swap_insn, swap_to_top, move_for_stack_reg, subst_stack_regs_pat, subst_asm_stack_regs, change_stack, compensate_edge, convert_regs_1): Likewise. * regclass.c (init_reg_sets, init_reg_sets_1, memory_move_secondary_cost): Likewise. * regrename.c (note_sets, clear_dead_regs, scan_rtx_reg, scan_rtx): Likewise. * reload.c (push_secondary_reload, find_valid_class, push_reload, operands_match_p, decompose, immune_p, find_reloads, find_reloads_toplev, find_reloads_address_1, subst_reloads, copy_replacements, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (compute_use_by_pseudos, replace_pseudos_in, reload, count_pseudo, find_reg, eliminate_regs, eliminate_regs_in_insn, verify_initial_elim_offsets, finish_spills, clear_reload_reg_in_use, reload_reg_free_p, reload_reg_reaches_end_p, reloads_conflict, choose_reload_regs, merge_assigned_reloads, emit_input_reload_insns, do_output_reload, fixup_abnormal_edges): Likewise. * reorg.c (stop_search_p, emit_delay_sequence, get_jump_flags, fill_slots_from_thread, relax_delay_slots): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtl.c (copy_rtx, rtx_equal_p): Likewise. * rtlanal.c (insn_dependent_p, reg_overlap_mentioned_p, dead_or_set_p, find_reg_fusage, remove_note, replace_rtx, subreg_lsb_1, subreg_regno_offset, subreg_offset_representable_p, find_first_parameter_load, can_hoist_insn_p, hoist_update_store, hoist_insn_after, hoist_insn_to_edge, nonzero_bits1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sbitmap.c (sbitmap_difference): Likewise. * sched-deps.c (add_dependence, sched_analyze_1, sched_analyze_2, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, schedule_ebb): Likewise. * sched-rgn.c (debug_regions, compute_trg_info, schedule_region, schedule_insns): Likewise. * sched-vis.c (print_pattern): Likewise. * sdbout.c (sdbout_symbol, sdbout_toplevel_data): Likewise. * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_ternary_operation, simplify_immed_subreg, simplify_subreg, simplify_gen_subreg): Likewise. * sreal.c (copy, sreal_sub, sreal_div): Likewise. * stmt.c (force_label_rtx, expand_goto, expand_asm_operands, resolve_operand_name_1, expand_return, expand_decl, expand_anon_union_decl, emit_case_bit_tests, expand_case): Likewise. * stor-layout.c (put_pending_size, smallest_mode_for_size, int_mode_for_mode, layout_decl, finish_builtin_struct, layout_type, set_sizetype, get_mode_bounds): Likewise. From-SVN: r87244
2004-07-25c-common.c: Rename all identifiers named `class' to `cl'.Bernardo Innocenti1-81/+81
* c-common.c: Rename all identifiers named `class' to `cl'. * c-decl.c: Likewise. * c-common.h: Likewise. * c-parse.in: Likewise. * c-typeck.c: Likewise. * genmodes.c: Likewise. * real.c: Likewise. * real.h: Likewise. * recog.c: Likewise. * recog.h: Likewise. * regrename.c: Likewise. * tree.h: Likewise. From-SVN: r85153
2004-06-17Bug 14610Zack Weinberg1-35/+116
Bug 14610 * Makefile.in (min-insn-modes.o): Correct dependencies. * real.c (encode_ieee_extended, decode_ieee_extended): Always produce/consume 12-byte little-endian Intel format. (encode_ieee_extended_128, decode_ieee_extended_128): Delete. (encode_ieee_extended_motorola, decode_ieee_extended_motorola) (encode_ieee_extended_intel_96, decode_ieee_extended_intel_96) (encode_ieee_extended_intel_128, decode_ieee_extended_intel_128): New functions which convert between 12-byte little-endian Intel format and the desired format. (ieee_extended_motorola_format, ieee_extended_intel_96_round_53_format) (ieee_extended_intel_96_format, ieee_extended_intel_128_format): Update. testsuite: * gcc.dg/ia64-float80-1.c, gcc.dg/ia64-float80-2.c: New testcases. From-SVN: r83295
2004-06-14* real.c: Fix bit count in head comment.Eric Botcazou1-1/+1
From-SVN: r83133
2004-06-07real.c (real_copysign): New function to implement libm's copysign.Roger Sayle1-0/+8
* real.c (real_copysign): New function to implement libm's copysign. * real.h (real_copysign): Prototype here. * fold-const.c (tree_expr_nonnegative_p): The result of sqrt, sqrtf and sqrtl can be negative, as sqrt(-0.0) = -0.0. Correct whitespace. * builtins.c (fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit): Add function prototypes. (fold_builtin_copysign): New function to fold copysign, copysignf and copysignl. Optimize copysign(x,x) as x. Evaluate copysign of constant arguments at compile-time using real_copysign. Fold copysign(X,Y) as fabs(X) if Y is always non-negative. (fold_builtin_1): Correct minor whitespace/style issues. Call fold_builtin_copysign for BUILT_IN_COPYSIGN{,F,L}. * gcc.dg/builtins-41.c: New test case. * gcc.dg/builtins-42.c: New test case. From-SVN: r82721
2004-05-28re PR rtl-optimization/15649 (ICE with __builtin_isgreater and -ffast-math)Paolo Bonzini1-0/+2
gcc/ChangeLog: 2004-05-27 Paolo Bonzini <bonzini@gnu.org> Roger Sayle <roger@eyesopen.com> PR rtl-optimization/15649 Add LTGT_EXPR and improve pretty-printing of unordered comparisons. * c-common.c (c_common_truthvalue_conversion): Handle LTGT_EXPR. * c-typeck.c (build_binary_op): Likewise. * dojump.c (do_jump): Likewise. * expr.c (expand_expr_real_1, do_store_flag): Likewise. * predict.c (tree_predict_by_opcode): Likewise. * real.c (real_compare): Likewise. * tree-cfg.c (verify_expr): Likewise. * tree-inline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. Handle ORDERED_EXPR, UNORDERED_EXPR. (op_symbol): Print unordered comparisons differently than ordered ones. * tree.def (LTGT_EXPR): New '<' tree code. * doc/c-tree.texi (Expressions): Document floating-point comparison nodes. Fold comparisons between floating point values. * fold-const.c (enum comparison_code): New, from #define'd constants. Define compcodes for unordered comparisons and for invalid transformations. (invert_tree_comparison): Add "honor_nans" parameter. (fold_truthop): Revamp to work on floating-point types too. (comparison_to_compcode): Support unordered comparisons. Use new enum comparison_code. (compcode_to_comparison): Likewise. (combine_compcodes): New function. (invert_truthvalue): Let invert_tree_comparison decide whether it is valid to fold the comparison. Fold ORDERED and UNORDERED even if flag_unsafe_math_optimizations is off, and the remaining even if flag_unsafe_math_optimizations is off but we are under -fno-trapping-math. (fold_relational_const): Integer modes do not honor NaNs. gcc/testsuite/ChangeLog: 2004-05-27 Paolo Bonzini <bonzini@gnu.org> * gcc.c-torture/compare-fp-1.c, gcc.c-torture/compare-fp-2.c, gcc.c-torture/compare-fp-3.c, gcc.c-torture/compare-fp-4.c, gcc.c-torture/compare-fp-3.x, gcc.c-torture/compare-fp-4.x, gcc.c-torture/pr15649-1.c: New. Co-Authored-By: Roger Sayle <roger@eyesopen.com> From-SVN: r82365
2004-03-22real.h (struct real_value): Use the same type for all bitfields.Alexandre Oliva1-77/+79
* real.h (struct real_value): Use the same type for all bitfields. Rename exp to uexp. (REAL_EXP, SET_REAL_EXP): New accessor macros for uexp. Adjust all uses of exp... * builtins.c: ... here, ... * emit-rtl.c: ... here, and ... * real.c: ... and here. From-SVN: r79802
2004-03-12* real.c (encode_ibm_extended): Do round low word.Alan Modra1-3/+2
From-SVN: r79321
2004-03-04real.c (encode_ibm_extended): Don't bother rounding low double.Alan Modra1-1/+3
* real.c (encode_ibm_extended): Don't bother rounding low double. * c-cppbuiltin.c (builtin_define_float_constants): Tweak MAX when fmt->pnan < fmt->p. From-SVN: r78900
2004-02-10re PR c/14088 (Hexfloat constants with uppercase 0X prefix fail)Danny Smith1-1/+1
PR c/14088 real.c (real_from_string): Look for 'X' as well as 'x' in hexfloat strings. From-SVN: r77619
2004-02-08real.c (encode_ibm_extended): Normalize the input value before converting it ↵Richard Sandiford1-4/+9
to a double. * real.c (encode_ibm_extended): Normalize the input value before converting it to a double. Handle the case where a normal value rounds to infinity. From-SVN: r77498
2004-01-23real.c (real_floor, real_ceil): Tweak to allow input and output arguments to ↵Roger Sayle1-7/+25
overlap. * real.c (real_floor, real_ceil): Tweak to allow input and output arguments to overlap. (real_round): New function to implement round(3m) semantics. * real.h (real_round): Prototype here. * builtins.c (fold_builtin_round): New function to constant fold round, roundf and roundl. (fold_builtin): Call fold_builtin_round for BUILT_IN_ROUND{,F,L}. * gcc.dg/builtins-29.c: New test case. From-SVN: r76428
2004-01-12real.c: Update copyright date.Geoffrey Keating1-1/+1
* real.c: Update copyright date. * emit-rtl.c: Likewise. * rtl.h: Likewise. * dwarf2out.c: Likewise. * config/rs6000/darwin-ldouble.c: Likewise. * config/rs6000/rs6000.md: Likewise. From-SVN: r75742
2004-01-10darwin-ldouble.c: Add big comment explaining exactly what is expected as a ↵Geoffrey Keating1-45/+15
'long double'. * config/rs6000/darwin-ldouble.c: Add big comment explaining exactly what is expected as a 'long double'. (_xlqadd): When a value to be returned is representable as a 'double', just return it directly, do not construct it using a union. Also, correct final fixup. (_xlqmul): Likewise. (_xlqdiv): Likewise. * real.c (encode_ibm_extended): Make consistent with darwin-ldouble.c. From-SVN: r75629
2003-11-03* real.c (encode_ieee_single): Ensure proper promotion.Alexander Kabaev1-1/+2
From-SVN: r73232
2003-10-30* real.c (encode_ieee_extended): Back out previous patch.Jan Hubicka1-5/+0
From-SVN: r73105
2003-10-30real.c (encode_ieee_extended): Initialize whole array.Jan Hubicka1-0/+5
* real.c (encode_ieee_extended): Initialize whole array. * reg-stack.c (move_for_stack_reg0: Use always XFmode. * i386-modes.def: Change definitions of TFmode and XFmode. * i386.c (classify_argument): Rename TFmodes to XFmodes; add new TFmode code. (construct_container): Allow constructing of TFmode integer containers. (ix86_return_in_memory): XFmode is not returned in memory. (init_ext_80387_constants): Always use XFmode. (print_operand): Likewise. (ix86_prepare_fp_compare_regs): Likewise. (split_to_parts): Deal with TFmode. (split_long_move): Simplify. (ix86_init_mmx_sse_builtins): Add __float80, __float128. (ix86_memory_move_cost): Do not confuse TFmode. * i386.h (LONG_DOUBLE_TYPE_SIZE): Set to 96. (IS_STACK_MODE): TFmode is not stack mode. (HARD_REGNO_NREGS, CLASS_MAX_NREGS): Deal nicely with XFmode. (VALID_SSE_REG_MODE): Allow TFmode. (VALID_FP_MODE_P): Disallow TFmode. (VALID_INT_MODE_P): Allow TFmode in 64bit mode. * i386.md (TFmode patterns): Kill. (movtf, motf_rex64): New patterns. From-SVN: r73099
2003-10-29* real.c (do_divide): Initialize result with a 0.Hans-Peter Nilsson1-0/+2
From-SVN: r73066
2003-10-13Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.o with ↵Zack Weinberg1-18/+0
min-insn-modes.o. * Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.o with min-insn-modes.o. (STAGESTUFF): Add min-insn-modes.c. (genobjs): Add genmodes.o. (print-rtl.o, print-rtl1.o): Depend on $(TM_P_H). (insn-modes.o): Depend on $(TM_H) not $(GTM_H); also real.h. (min-insn-modes.c, min-insn-modes.o): New rules. (s-modes): Also generate min-insn-modes.c. ($(BUILD_PREFIX_1)insn-modes.o): Kill. * genmodes.c (struct mode_data): Add format field. (blank_mode, validate_mode, complete_mode): Update to match. (make_scalar_mode): Separate into make_int_mode and make_float_mode. (_SCALAR_MODE): Kill. (FLOAT_MODE, FRACTIONAL_FLOAT_MODE): Add format argument. (emit_insn_modes_c_header): Adjust. (emit_min_insn_modes_c_header, emit_real_format_for_mode) (emit_min_insn_modes_c): New functions. (emit_insn_modes_c): Call emit_real_format_for_mode. (main): Add -m option to generate min-insn-modes.c. * machmode.h: Update documentation. Add format argument to all uses of FLOAT_MODE. * real.c: Don't define real_format_for_mode here. * dwarfout.c: Move default definition of PRINT_REG... * defaults.h: ...here. * print-rtl.c: Include tm_p.h. (DEBUG_PRINT_REG, DEBUG_REGISTER_NAMES, debug_reg_names, reg_names): Kill. (print_rtx): Use PRINT_REG, not DEBUG_PRINT_REG. But surround this entire block with #ifndef GENERATOR_FILE. * regclass.c: Unconditionally define reg_names. * config/mips/mips.h, config/rs6000/rs6000.h, config/sh/sh.h Don't define DEBUG_REGISTER_NAMES. * config/rs6000/darwin.h: Don't use DEBUG_REGISTER_NAMES in redefinition of REGISTER_NAMES. * config/i386/i386.h: Don't define DEBUG_PRINT_REG. * combine.c: Change all preprocessor conditionals on EXTRA_CC_MODES to use SELECT_CC_MODE instead; rearrange a bit for clarity. * genopinit.c: Remove mention of EXTRA_CC_MODES in comment. * configure.in: Don't define EXTRA_CC_MODES. * configure, config.in: Regenerate. * doc/tm.texi: Remove documentation of EXTRA_CC_MODES. * config/arc/arc.c, config/m32r/m32r.c, config/sparc/sparc.c: May assume that GET_MODE_CLASS is accurate for extra CC modes at all times. * config/i860/i860.h (INIT_CUMULATIVE_ARGS): Pass correct number of arguments to aggregate_value_p. * genmodes.c (RESET_FLOAT_FORMAT, reset_float_format): New. * machmode.def: Explain ARCH-modes.def. Document RESET_FLOAT_FORMAT. Improve commentary on various mode clusters. Do not define OI, PQI, PHI, PSI, PDI, QF, HF, TQF, XF, or TF modes here. Remove backward-compatibility definition of CC. * config/alpha/alpha-modes.def: New file; define TF mode. * config/arc/arm-modes.def: Define XF mode. * config/c4x/c4x-modes.def: Define QF and HF modes. Unset float format for SF and DF modes. * config/dsp16xx/dsp16xx-modes.def: New file; define HF mode. * config/i386/i386-modes.def: Define XF and TF modes. * config/i960/i960-modes.def: Define TF mode. * config/ia64/ia64-modes.def: Define TF and OI modes. * config/m68k/m68k-modes.def: New file; define XF mode. * config/mips/mips-modes.def: New file; define TF mode, reset formats for SF and DF modes. * config/pa/pa-modes.def: Define TF mode. * config/rs6000/rs6000.c: Define TF and PSI modes. * config/s390/s390-modes.def: Define OI mode. * config/sh/sh-modes.def: New file; define PSI mode. * config/sparc/sparc-modes.def: Define TF mode. * config/vax/vax-modes.def: New file; reset formats for SF and DF modes. * config/c4x/c4x.c (c4x_override_options): No need to mess with real_format_for_mode or set REAL_MODE_FORMATs. (c4x_immed_int_constant): Don't apply GET_MODE_CLASS to rtx variable. * config/i386/i386.c (override_options): No need to set REAL_MODE_FORMATs here. * config/i960/i960.c (i960_initialize): Likewise. * config/m68k/m68k.c (m68k_override_options): Likewise. * config/ia64/ia64.c (ia64_override_options): Set REAL_MODE_FORMAT for TFmode only if not the default. * config/mips/mips.c (override_options): Likewise. * config/vax/vax.c (override_optionms): Set REAL_MODE_FORMAT for DFmode only if not the default. * config/i370/i370.h (RET_REG): Don't consider TFmode. * config/m68hc11/m68hc11.c (print_operand): Don't consider XFmode. * config/dsp16xx/dsp16xx.c (hard_regno_mode_ok): #if 0 out use of modes that don't appear anywhere in the machine description. * config/arc/arc-modes.def, config/arm/arm-modes.def * config/c4x/c4x-modes.def, config/frv/frv-modes.def * config/i386/i386-modes.def, config/i960/i960-modes.def * config/ia64/ia64-modes.def, config/mmix/mmix-modes.def * config/pa/pa-modes.def, config/pdp11/pdp11-modes.def * config/rs6000/rs6000-modes.def, config/s390/s390-modes.def * config/sparc/sparc-modes.def: Convert to new style for declaring extra CC modes. From-SVN: r72440
2003-10-06real.h (REAL_MODE_FORMAT): New macro.Zack Weinberg1-6/+6
* real.h (REAL_MODE_FORMAT): New macro. * c-cppbuiltin.c, optabs.c, real.c, config/alpha/alpha.c * config/c4x/c4x.c, config/i370/i370.c, config/i386/freebsd.h * config/i386/i386.c, config/i960/i960.c, config/ia64/ia64.c * config/m68k/m68k.c, config/mips/mips.c, config/rs6000/rs6000.c * config/vax/vax.c: Use REAL_MODE_FORMAT instead of referring directly to real_format_for_mode array, wherever possible. From-SVN: r72168
2003-09-29* real.c (real_sqrt): Use get_canonical_qnan directly.Zack Weinberg1-2/+1
From-SVN: r71919
2003-09-22* real.c: Fix several nits in the head comment.Eric Botcazou1-9/+9
From-SVN: r71642
2003-09-10real.c: Update URL to VAX floating point docs.Jerry Quinn1-2/+2
* real.c: Update URL to VAX floating point docs. (decode_vax_d): Extract 8 exponent bits instead of 7. From-SVN: r71294
2003-08-27* real.c (do_multiply): Initialize with memset.Jason Merrill1-1/+1
From-SVN: r70863
2003-07-06jump.c: Convert prototypes to ISO C90.Andreas Jaeger1-477/+288
* jump.c: Convert prototypes to ISO C90. * langhooks-def.h: Likewise. Add extern to prototypes. * langhooks.c: Likewise. * langhooks.h: Likewise. * lcm.c: Likewise. * local-alloc.c: Likewise. * loop-init.c: Likewise. * loop-unroll.c: Likewise. * loop-unswitch.c: Likewise. * loop.c: Likewise. * loop.h: Likewise. Add extern to prototypes. * machmode.h: Likewise. * main.c: Likewise. * mbchar.c: Likewise. * mbchar.h: Likewise. * mkdeps.c: Likewise. * mkdeps.h: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * output.h: Likewise. * gccspec.c: Likwise. * postreload.c: Likewise. * prefix.c: Likewise. * prefix.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * real.h: Likewise. * recog.c: Likewise. * recog.h: Likewise. * reg-stack.c: Likewise. * regclass.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * resource.h: Likewise. * rtl-error.c: Likewise. * rtl.c: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. From-SVN: r68998
2003-07-03real.c (real_trunc, [...]): New functions to implement trunc, floor and ceil ↵Roger Sayle1-0/+46
respectively. * real.c (real_trunc, real_floor, real_ceil): New functions to implement trunc, floor and ceil respectively. * real.h (real_trunc, real_floor, real_ceil): Prototype here. * builtins.c (integer_valued_real_p): New function to test if a floating point expression has an integer valued result. (fold_trunc_transparent_mathfn): Optimize foo(foo(x)) as foo(x) where foo is an integer rounding function. Similarly, optimize foo(bar(x)) as bar(x), and foo((double)(int)x) as (double)(int)x when both foo and bar are integer rounding functions and we don't need to honor errno. (fold_builtin_trunc, fold_builtin_floor, fold_builtin_ceil): New functions to fold trunc, floor and ceil. (fold_builtin): Use fold_builtin_trunc to fold BUILT_IN_TRUNC*, fold_builtin_floor to fold BUILT_IN_FLOOR* and fold_builtin_ceil to fold BUILT_IN_CEIL*. * fold-const.c (tree_expr_nonnegative_p): Handle FLOAT_EXPR and the remaining integer rounding functions. * gcc.dg/builtins-25.c: New testcase. * gcc.dg/builtins-26.c: New testcase. From-SVN: r68903
2003-06-25real.h (ieee_extended_intel_96_round_53_format): New.Richard Henderson1-0/+19
* real.h (ieee_extended_intel_96_round_53_format): New. * real.c (ieee_extended_intel_96_round_53_format): New. * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Use it for XFmode and TFmode. From-SVN: r68445
2003-06-12ChangeLog: Follow spelling conventions.Kazu Hirata1-2/+2
* ChangeLog: Follow spelling conventions. * ChangeLog.2: Likewise. * c-decl.c: Likewise. * cfgloop.h: Likewise. * cgraph.c: Likewise. * coverage.c: Likewise. * cppcharset.c: Likewise. * cpphash.h: Likewise. * cpplex.c: Likewise. * cpplib.c: Likewise. * dbxout.c: Likewise. * df.c: Likewise. * dwarf2out.c: Likewise. * dwarfout.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gengtype.c: Likewise. * ggc.h: Likewise. * opts.c: Likewise. * real.c: Likewise. * reload.c: Likewise. * stmt.c: Likewise. From-SVN: r67849
2003-05-23real.c (real_maxval): New function to return the largest finite value ↵Roger Sayle1-0/+27
representable in a given mode (i.e. * real.c (real_maxval): New function to return the largest finite value representable in a given mode (i.e. FLT_MAX and DBL_MAX). * real.h (real_maxval): Prototype here. * fold-const.c (fold_inf_compare): Transform comparisons against +-Infinity into comparisons against DBL_MAX (or equivalent). * gcc.c-torture/execute/ieee/inf-2.c: New test case. From-SVN: r67112
2003-05-06real.c (real_powi): New function to calculate the value of a real raised to ↵Roger Sayle1-12/+68
an integer power, i.e. * real.c (real_powi): New function to calculate the value of a real raised to an integer power, i.e. pow(x,n) for int n. (real_sqrt): Convert to using the faster do_add, do_multiply and do_divide API for consistency with the rest of real.c. * real.h (real_powi): Prototype here. * builtins.c (fold_builtin): Avoid local variable mode when evaluating sqrt at compile time. Attempt to evaluate pow at compile-time, by checking for an integral exponent. * gcc.dg/builtins-14.c: New test case. From-SVN: r66515
2003-04-23real.c (do_add): Change to return a bool indicating that the result of the ↵Roger Sayle1-35/+52
operation may be... * real.c (do_add): Change to return a bool indicating that the result of the operation may be inexact due to loss of precision. (do_multiply): Likewise. (do_divide): Likewise. From-SVN: r65980
2003-04-02* real.c (decode_ieee_single): Fix decoding of SNaN bit.Andreas Schwab1-1/+2
From-SVN: r65161
2003-04-01real.h (EXP_BITS): Make room for...Alexandre Oliva1-25/+160
* real.h (EXP_BITS): Make room for... (struct real_value): ... added canonical bit. (struct real_format): Added pnan. (mips_single_format, mips_double_format, mips_extended_format, mips_quad_format): New. * real.c: Copy p to pnan in all formats. (get_canonical_qnan, get_canonical_snan): Set canonical bit. (real_nan): Use pnan to compute significand's shift. (real_identical): Disregard significand in canonical NaNs. (real_hash): Likewise. Take signalling into account. (encode_ieee_single, encode_ieee_double, encode_ieee_quad): Disregard significand bits in canonical NaNs. Set all bits of canonical NaN if !qnan_msb_set. (encode_ibm_extended, decode_ibm_extended): Likewise. Use qnan_msb_set to tell the base double format. (ibm_extended_format): Use 53 as pnan. (mips_single_format, mips_double_format, mips_extended_format, mips_quad_format): Copied from the corresponding ieee/ibm formats, with qnan_msb_set false. * config/mips/iris6.h (MIPS_TFMODE_FORMAT): Use mips_extended_format. * config/mips/linux64.h (MIPS_TFMODE_FORMAT): Use mips_quad_format. * config/mips/mips.c (override_options): Use mips_single_format and mips_double_format. Default TFmode to mips_quad_format. * config/mips/t-linux64 (tp-bit.c): Define QUIET_NAN_NEGATED. * config/mips/t-irix6: Likewise. * config/mips/t-mips (fp-bit.c, dp-bit.c): Likewise. * config/fp-bit.c (pack_d, unpack_d): Obey it. From-SVN: r65146
2003-03-31real.c (real_identical): Reorg so as to not compare signalling for normals.Richard Henderson1-5/+7
* real.c (real_identical): Reorg so as to not compare signalling for normals. From-SVN: r65111
2003-03-31emit-rtl.c (dconstm2, dconsthalf): New real constants.Roger Sayle1-5/+3
* emit-rtl.c (dconstm2, dconsthalf): New real constants. (init_emit_once): Initialize dconstm2 and dconsthalf here. * real.h (dconstm2, dconsthalf): Add prototypes here. * real.c (real_sqrt): Use dconsthalf rather than local copy. * builtins.c (fold_builtin): When optimizing sqrt(exp(x)) as exp(x/2.0) remember to fold the division if possible. Fold sin(0.0) as 0.0, cos(0.0) as 1.0, pow(x,1.0) as x, pow(x,-1.0) as 1.0/x, pow(x,2.0) as x*x, pow(x,-2.0) as 1.0/(x*x) and pow(x,0.5) as sqrt(x). * gcc.dg/builtins-3.c: Add new tests for sin and cos. * gcc.dg/builtins-7.c: New test case. * gcc.dg/builtins-8.c: New test case. From-SVN: r65088
2003-03-27real.h (struct real_value): Add signalling.Richard Henderson1-47/+34
* real.h (struct real_value): Add signalling. (EXP_BITS): Decrement. * real.c (get_canonical_qnan): Don't set MSB-1. (get_canonical_snan): Likewise. Set signalling. (real_identical): Compare signalling. (round_for_format): Remove force-one-bit on code. (real_nan): Likewise. Set signalling. (encode_ieee_single): Add force-one-bit code; honor signalling. (encode_ieee_double, encode_ieee_extended, encode_ieee_quad): Likewise. (decode_ieee_single): Set signalling. (decode_ieee_double, decode_ieee_extended, decode_ieee_quad): Likewise. From-SVN: r64935
2003-02-26Update commentary.Richard Henderson1-0/+8
From-SVN: r63484
2003-02-25real.c (real_to_integer2): Force overflow result only for unsigned overflow.Richard Henderson1-1/+1
* real.c (real_to_integer2): Force overflow result only for unsigned overflow. From-SVN: r63421
2003-01-27real.c (ibm_extended_format): Add 53 to minimum exponent.Alexandre Oliva1-3/+18
* real.c (ibm_extended_format): Add 53 to minimum exponent. (encode_ibm_extended): Adjust. From-SVN: r61875
2003-01-15real.c (real_sqrt): Return a bool result indicating whether a floating point ↵Roger Sayle1-7/+9
exception or trap... * real.c (real_sqrt): Return a bool result indicating whether a floating point exception or trap should be raised. * real.h (real_sqrt): Update function prototype. * builtins.c (fold_builtin): Only fold non-trapping square roots unless we're ignoring errno and trapping math. From-SVN: r61337
2002-12-25output.h: Fix comment typos.Kazu Hirata1-1/+1
* output.h: Fix comment typos. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * ra-build.c: Likewise. * ra-colorize.c: Likewise. * ra-debug.c: Likewise. * ra-rewrite.c: Likewise. * ra.c: Likewise. * ra.h: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regclass.c: Likewise. From-SVN: r60502
2002-12-16Merge basic-improvements-branch to trunkZack Weinberg1-0/+100
From-SVN: r60174
2002-11-17real.c (real_to_decimal): Fix buffer overrun when buffer size is smaller ↵Graham Stott1-5/+5
than representation. * real.c (real_to_decimal): Fix buffer overrun when buffer size is smaller than representation. From-SVN: r59200
2002-11-16hard-reg-set.h: Follow spelling conventions.Kazu Hirata1-3/+3
* hard-reg-set.h: Follow spelling conventions. * real.c: Likewise. * target.h: Likewise. From-SVN: r59173
2002-10-27combine.c: Fix comment formatting.Kazu Hirata1-1/+1
* combine.c: Fix comment formatting. * loop.c: Likewise. * real.c: Likewise. * regclass.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * reg-stack.c: Likewise. * reload1.c: Likewise. * reload.c: Likewise. * reload.h: Likewise. * unroll.c: Likewise. From-SVN: r58583
2002-10-25real.c (real_to_decimal): If the >1 tens reduction loop results in a ↵Richard Henderson1-9/+17
negative exponent... * real.c (real_to_decimal): If the >1 tens reduction loop results in a negative exponent, fall into the <1 pten computation. From-SVN: r58538
2002-10-21real.c (sticky_rshift_significand): Return inexact, don't or it in immediately.Richard Henderson1-18/+66
* real.c (sticky_rshift_significand): Return inexact, don't or it in immediately. (sub_significands): Accept incomming carry. (div_significands, rtd_divmod): Update for sub_significands change. (round_for_format): Update for sticky_rshift_significand change. (do_add): Don't involve the inexact bit in addition, do give the inexact bit as the subtraction carry-in. (encode_internal, decode_internal, real_internal_format): New. * real.h (real_internal_format): Declare. From-SVN: r58396
2002-10-19real.c (do_add): Fix 0+0 sign corner case.Brad Lucier1-4/+4
* real.c (do_add): Fix 0+0 sign corner case. (do_divide): Fix Inf/0 corner case. From-SVN: r58322
2002-10-18real.c (cmp_significand_0, [...]): New.Richard Henderson1-75/+270
* real.c (cmp_significand_0, rtd_divmod, ten_to_mptwo): New. (real_to_decimal): Re-implement using the logic from the gcc 3.2 etoasc. Comment heavily. (div_significands): Simplify loop startup and comparison logic. From-SVN: r58295
2002-10-15real.c (real_to_decimal): Accept BUF_SIZE and CROP_TRAILING_ZEROS as arguments.Richard Henderson1-20/+44
gcc/ * real.c (real_to_decimal): Accept BUF_SIZE and CROP_TRAILING_ZEROS as arguments. Bound DIGITS by the available buffer size. (real_to_hexadecimal): Likewise. * real.h (real_to_decimal, real_to_hexadecimal): Update prototypes. (REAL_VALUE_TO_DECIMAL): Remove. * c-common.c, c-pretty-print.c, print-rtl.c, print-tree.c, sched-vis.c, config/arc/arc.c, config/c4x/c4x.c, config/fr30/fr30.c, config/i370/i370.h, config/i386/i386.c, config/i960/i960.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/sun2o4.h, config/m68k/sun3.h, config/mips/mips.c, config/ns32k/ns32k.c, config/pdp11/pdp11.h, config/vax/vax.h: Update all callers to use real_to_decimal directly, and with the proper arguments. * doc/tm.texi (REAL_VALUE_TO_DECIMAL): Remove. gcc/cp/ * error.c (dump_expr): Use real_to_decimal directly, and with the new arguments. gcc/f/ * target.h (ffetarget_print_real1, ffetarget_print_real2): Use real_to_decimal directly, and with the new arguments. From-SVN: r58187