summaryrefslogtreecommitdiff
path: root/gcc/real.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 14610zack2004-06-171-35/+116
| | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83295 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c: Fix bit count in head comment.ebotcazou2004-06-141-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83133 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_copysign): New function to implement libm's copysign.sayle2004-06-071-0/+8
| | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82721 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/ChangeLog:bonzini2004-05-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82365 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.h (struct real_value): Use the same type for allaoliva2004-03-221-77/+79
| | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79802 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (encode_ibm_extended): Do round low word.amodra2004-03-111-3/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79321 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (encode_ibm_extended): Don't bother rounding low double.amodra2004-03-041-1/+3
| | | | | | | | * c-cppbuiltin.c (builtin_define_float_constants): Tweak MAX when fmt->pnan < fmt->p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78900 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c/14088dannysmith2004-02-101-1/+1
| | | | | | | | real.c (real_from_string): Look for 'X' as well as 'x' in hexfloat strings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77619 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (encode_ibm_extended): Normalize the input value beforersandifo2004-02-081-4/+9
| | | | | | | | converting it to a double. Handle the case where a normal value rounds to infinity. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77498 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_floor, real_ceil): Tweak to allow input and outputsayle2004-01-231-7/+25
| | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76428 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c: Update copyright date.geoffk2004-01-121-1/+1
| | | | | | | | | | | * emit-rtl.c: Likewise. * rtl.h: Likewise. * dwarf2out.c: Likewise. * config/rs6000/darwin-ldouble.c: Likewise. * config/rs6000/rs6000.md: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75742 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/rs6000/darwin-ldouble.c: Add big comment explaininggeoffk2004-01-101-45/+15
| | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75629 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (encode_ieee_single): Ensure proper promotion.ljrittle2003-11-031-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73232 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (encode_ieee_extended): Back out previous patch.hubicka2003-10-301-5/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73105 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (encode_ieee_extended): Initialize whole array.hubicka2003-10-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73099 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (do_divide): Initialize result with a 0.hp2003-10-291-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73066 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.ozack2003-10-131-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72440 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.h (REAL_MODE_FORMAT): New macro.zack2003-10-061-6/+6
| | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72168 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_sqrt): Use get_canonical_qnan directly.zack2003-09-291-2/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71919 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c: Fix several nits in the head comment.ebotcazou2003-09-221-9/+9
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71642 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c: Update URL to VAX floating point docs.wilson2003-09-111-2/+2
| | | | | | | (decode_vax_d): Extract 8 exponent bits instead of 7. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71294 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (do_multiply): Initialize with memset.jason2003-08-271-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70863 138bc75d-0d04-0410-961f-82ee72b054a4
* * jump.c: Convert prototypes to ISO C90.aj2003-07-061-477/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68998 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_trunc, real_floor, real_ceil): New functionssayle2003-07-031-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68903 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.h (ieee_extended_intel_96_round_53_format): New.ljrittle2003-06-251-0/+19
| | | | | | | | | * real.c (ieee_extended_intel_96_round_53_format): New. * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Use it for XFmode and TFmode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68445 138bc75d-0d04-0410-961f-82ee72b054a4
* * ChangeLog: Follow spelling conventions.kazu2003-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67849 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_maxval): New function to return the largest finitesayle2003-05-231-0/+27
| | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67112 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_powi): New function to calculate the value ofsayle2003-05-061-12/+68
| | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66515 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (do_add): Change to return a bool indicating that thesayle2003-04-231-35/+52
| | | | | | | | | result of the operation may be inexact due to loss of precision. (do_multiply): Likewise. (do_divide): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65980 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (decode_ieee_single): Fix decoding of SNaN bit.schwab2003-04-021-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65161 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.h (EXP_BITS): Make room for...aoliva2003-04-011-25/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65146 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_identical): Reorg so as to not comparerth2003-03-311-5/+7
| | | | | | | signalling for normals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65111 138bc75d-0d04-0410-961f-82ee72b054a4
* * emit-rtl.c (dconstm2, dconsthalf): New real constants.sayle2003-03-311-5/+3
| | | | | | | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65088 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.h (struct real_value): Add signalling.rth2003-03-271-47/+34
| | | | | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64935 138bc75d-0d04-0410-961f-82ee72b054a4
* Update commentary.rth2003-02-261-0/+8
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63484 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_to_integer2): Force overflow result only forrth2003-02-251-1/+1
| | | | | | | unsigned overflow. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63421 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (ibm_extended_format): Add 53 to minimum exponent.aoliva2003-01-271-3/+18
| | | | | | | (encode_ibm_extended): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61875 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_sqrt): Return a bool result indicating whethersayle2003-01-151-7/+9
| | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61337 138bc75d-0d04-0410-961f-82ee72b054a4
* * output.h: Fix comment typos.kazu2002-12-251-1/+1
| | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60502 138bc75d-0d04-0410-961f-82ee72b054a4
* Merge basic-improvements-branch to trunkzack2002-12-161-0/+100
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60174 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_to_decimal): Fix buffer overrun when buffer sizegrahams2002-11-171-5/+5
| | | | | | | is smaller than representation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59200 138bc75d-0d04-0410-961f-82ee72b054a4
* * hard-reg-set.h: Follow spelling conventions.kazu2002-11-161-3/+3
| | | | | | | | * real.c: Likewise. * target.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59173 138bc75d-0d04-0410-961f-82ee72b054a4
* * combine.c: Fix comment formatting.kazu2002-10-271-1/+1
| | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58583 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_to_decimal): If the >1 tens reduction loop resultsrth2002-10-251-9/+17
| | | | | | | in a negative exponent, fall into the <1 pten computation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58538 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (sticky_rshift_significand): Return inexact, don'trth2002-10-221-18/+66
| | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58396 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (do_add): Fix 0+0 sign corner case.rth2002-10-191-4/+4
| | | | | | | (do_divide): Fix Inf/0 corner case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58322 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (cmp_significand_0, rtd_divmod, ten_to_mptwo): New.rth2002-10-181-75/+270
| | | | | | | | | (real_to_decimal): Re-implement using the logic from the gcc 3.2 etoasc. Comment heavily. (div_significands): Simplify loop startup and comparison logic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58295 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/rth2002-10-161-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58187 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.h (SIGNIFICAND_BITS): Add one more word.rth2002-10-041-38/+49
| | | | | | | | | | | | | (CONST_DOUBLE_FORMAT): Accomodate 6 words. * real.c (times_pten): New. (real_to_decimal, real_from_string): Use it. (sticky_rshift_significand): Use & to find modulus. (rshift_significand, lshift_significand): Likewise. (do_divide): Apply sticky bit after normalization. (real_to_decimal, real_to_hexadecimal): Fix sign of Inf and NaN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57811 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.c (real_to_decimal): Crop trailing zeros for DIGITS < 0.rth2002-10-021-5/+19
| | | | | | | | | (real_to_hexadecimal): Likewise. * print-rtl.c (print_rtx): If we are linked with real.c, don't dump the XWINT fields of a floating point CONST_DOUBLE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57719 138bc75d-0d04-0410-961f-82ee72b054a4