summaryrefslogtreecommitdiff
path: root/libgfortran/io/write_float.def
AgeCommit message (Collapse)Author
2017-01-01 Update copyright years.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243994 138bc75d-0d04-0410-961f-82ee72b054a4
2016-09-062016-09-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/77393 * io/write_float.def (build_float_string): Recognize when the result will not fit in the user provided, star fill, and exit early. * gfortran.dg/fmt_f0_2.f90: Update test. * gfortran.dg/fmt_f0_3.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240018 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-232016-06-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/48852 * io/write.c: Cleaned up whitespace. (write_d, write_e, write_f, write_es, write_en): Use new helper function write_float_0. (write_float_0): New helper function. (get_precision, select_buffer, select_string, write_float_string): New helper functions used in remaining float writing functions. Helper function write_float_string now contains code for writing to kind=4 character internal units. (write_real): Modified to establish working buffers at this level and to use new helper functions. (write_real_g0): Likewise modified. (write_complex): Likewise modified. Gets both float strings before output so that final lengths can be determined which allows right justifying the complex number with no intervening spaces. * io/write_float.def (build_float_string): Renamed from previosly output_float, modified to use buffers passed in from higher functions, builds a null terminated string of the floating point value. Character kind=4 code eliminated. (write_infnan): Likewise modified to use incoming buffers and eliminate kind=4 related code. (OUTPUT_FLOAT_FMT_G): Deleted, functionality moved into FORMAT_FLOAT. (FORMAT_FLOAT): Renamed macro from WRITE_FLOAT. Use build_float_string. (get_float_string): Renamed from write_float, uses FORMAT_FLOAT macro. Buffer allocation removed, now at higher level. PR libgfortran/48852 * gfortran.dg/char4_iunit_1.f03: Update test. * gfortran.dg/f2003_io_5.f03: Update test. * gfortran.dg/real_const_3.f90: Update test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237735 138bc75d-0d04-0410-961f-82ee72b054a4
2016-03-302016-03-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>dominiq
Dominique d'Humieres <dominiq@lps.ens.fr> PR libgfortran/70235 * io/write_float.def: Fix PF format for negative values of the scale factor. 2016-03-30 Dominique d'Humieres <dominiq@lps.ens.fr> Jerry DeLisle <jvdelisle@gcc.gnu.org> * gfortran.dg/fmt_pf.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234600 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-04 Update copyright years.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232055 138bc75d-0d04-0410-961f-82ee72b054a4
2015-12-052015-12-05 Juoko Orava <jouko.orava@iki.fi>kargl
PR fortran/50201 * io/write_float.def: Avoid marking quadmath_snprintf as an untyped weak reference, which fixing linking with -static. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231320 138bc75d-0d04-0410-961f-82ee72b054a4
2015-11-222015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
* io/write_float.def (output_float): Move block determining room for leading zero to before checkng g0 formatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230728 138bc75d-0d04-0410-961f-82ee72b054a4
2015-08-24 PR libfortran/57496fxcoudert
* io/write_float.def: Use built-in type-generic functions defined by libgfortran.h for isfinite, isnan, and signbit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227136 138bc75d-0d04-0410-961f-82ee72b054a4
2015-02-112015-02-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/57822 * io/write_float.def (output_float): Apply fix of previous patch to correctly calculate the exponent number of digits and take care of wide character output. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220606 138bc75d-0d04-0410-961f-82ee72b054a4
2015-02-102015-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/57822 * io/write_float.def (output_float): If doing g0 editing and exponent is zero, do not emit exponent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220564 138bc75d-0d04-0410-961f-82ee72b054a4
2015-01-05 Update copyright years.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219188 138bc75d-0d04-0410-961f-82ee72b054a4
2014-11-13PR 60324 Unbounded stack allocations in libgfortran.jb
2014-11-13 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/60324 * configure: Regenerated. * configure.ac (AM_CFLAGS): Add Werror=vla. * libgfortran.h (gfc_alloca): Remove macro. (fc_strdup_notrim): New prototype. * intrinsics/access.c (access_func): Use fc_strdup rather than stack allocation. * intrinsics/chdir.c (chdir_i4_sub): Likewise. (chdir_i8_sub): Likewise. * intrinsics/chmod.c (chmod_internal): New function, move logic here. (chmod_func): Call chmod_internal. * intrinsics/env.c (getenv): Use fc_strdup rather than stack allocation. (get_environment_variable_i4): Likewise. * intrinsics/execute_command_line.c (execute_command_line): Likewise. * intrinsics/hostnm.c (hostnm_0): New function, use static buffer rather than VLA. (hostnm_i4_sub): Call hostnm_0. (hostnm_i8_sub): Likewise. (hostnm): Likewise. * intrinsics/link.c (link_internal): New function, use fc_strdup rather than stack allocation. (link_i4_sub): Call link_internal. (link_i8_sub): Likewise. (link_i4): Likewise. (link_i8): Likewise. * intrinsics/perror.c (perror_sub): Use fc_strdup rather than stack allocation. * intrinsics/random.c (random_seed_i4): Use static buffer rather than VLA, use _Static_assert to make sure it's big enough. * intrinsics/rename.c (rename_internal): New function, use fc_strdup rather than stack allocation. (rename_i4_sub): Call rename_internal. (rename_i8_sub): Likewise. (rename_i4): Likewise. (rename_i8): Likewise. * intrinsics/stat.c (stat_i4_sub_0): Use fc_strdup rather than stack allocation. (stat_i8_sub_0): Likewise. * intrinsics/symlink.c (symlnk_internal): New function, use fc_strdup rather than stack allocation. (symlnk_i4_sub): Call symlnk_internal. (symlnk_i8_sub): Likewise. (symlnk_i4): Likewise. (symlnk_i8): Likewise. * intrinsics/system.c (system_sub): Use fc_strdup rather than stack allocation. * intrinsics/unlink.c (unlink_i4_sub): Likewise. * io/file_pos.c (READ_CHUNK): Make it a macro rather than variable. * io/list_read.c (nml_get_obj_data): Use fixed stack buffer, fall back to xmalloc/free for large sizes. * io/read.c (read_f): Likewise. * io/transfer.c (MAX_READ): Make it a macro rather than variable. (WRITE_CHUNK): Likewise. * io/write_float.def (write_float): Use fixed stack buffer, fall back to xmalloc/free for large sizes. * runtime/string.c (fc_strdup_notrim): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217480 138bc75d-0d04-0410-961f-82ee72b054a4
2014-03-082014-03-08 Dominique d'Humieres <dominiq@lps.ens.fr>jvdelisle
PR libgfortran/60128 * io/write_float.def (output_float): Remove unused variable nzero_real. Replace a double space with a single one. (determine_en_precision): Fix wrong handling of the EN format. PR libfortran/60128 * gfortran.dg/fmt_en.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208423 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-212014-01-20 Jerry DeLisle <jvdelisle@gcc.gnu>jvdelisle
Dominique d'Humieres <dominiq@lps.ens.fr> * io/write_float.def (output_float): Remove inadvertent test code from previous patch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206865 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-192014-01-19 Jerry DeLisle <jvdelisle@gcc.gnu>jvdelisle
Dominique d'Humieres <dominiq@lps.ens.fr> PR libfortran/59771 PR libfortran/59774 PR libfortran/59836 * io/write_float.def (output_float): Fix wrong handling of the Fw.0 format. (output_float_FMT_G_): Fixes rounding issues with -m32. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206785 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-02Update copyright years in libgfortran/rsandifo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206296 138bc75d-0d04-0410-961f-82ee72b054a4
2013-06-032013-06-01 Tobias Burnus <burnus@net-b.de>burnus
PR fortran/57496 * io/write_float.def (ISFINITE2Q, ISFINITE2, ISFINITE2L, * ISFINITE, SIGNBIT2Q, SIGNBIT2, SIGNBIT2L, SIGNBIT, ISNAN2Q, ISNAN2, ISNAN2L, ISNAN): New macros. (output_float_FMT_G_,WRITE_FLOAT): Use them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199598 138bc75d-0d04-0410-961f-82ee72b054a4
2013-03-19Use C99 bool instead of enum try.jb
2013-03-19 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h: Include stdbool.h. (enum try): Remove. (notify_std): Change return type to bool. * intrinsics/chmod.c: Don't include stdbool.h. * intrinsics/execute_command_line.c: Likewise. * io/format.c: Likewise. * io/list_read.c (nml_parse_qualifier): Change return type to bool. (nml_read_obj): Likewise. (nml_get_obj_data): Likewise. * io/transfer.c (read_block_form): Fix comment. (write_buf): Change return type to bool. * io/write.c: Don't include stdbool.h. * io/write_float.def (output_float): Change return type to bool. (output_float_FMT_G_ ## x): Change type of result variable. * runtime/error.c (notify_std): Change return type to bool. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196791 138bc75d-0d04-0410-961f-82ee72b054a4
2013-01-14Update copyright years in libgfortran.rsandifo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195167 138bc75d-0d04-0410-961f-82ee72b054a4
2012-12-25PR fortran/55539 Fix regression in -fno-sign-zero.jb
libgfortran ChangeLog: 2012-12-26 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/55539 * io/write_float.def (output_float): Take into account decimal dot. testsuite ChangeLog: 2012-12-26 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/55539 * gfortran.dg/nosigned_zero_3.f90: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194717 138bc75d-0d04-0410-961f-82ee72b054a4
2012-03-17PR libfortran/52608 Move the removal of initial zeros.jb
2012-03-17 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/52608 * io/write_float.def (output_float): Move removal of initial zeros until after the scale factor has been applied. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185486 138bc75d-0d04-0410-961f-82ee72b054a4
2012-03-15Remove commented out debug printf:sjb
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185444 138bc75d-0d04-0410-961f-82ee72b054a4
2012-03-152012-03-15 Janne Blomqvist <jb@gcc.gnu.org>jb
PR libfortran/52434 PR libfortran/48878 PR libfortran/38199 * io/unit.c (get_internal_unit): Default to ROUND_UNSPECIFIED. (init_units): Likewise. * io/write_float.def (determine_precision): New function. (output_float): Take into account buffer with %f format, no need for our own rounding if unspecified or processor specified rounding. (DTOA): Simplify format string, add parameters. (FDTOA): New macros similar to DTOA, but using %f format. (OUTPUT_FLOAT_FMT_G): Stack allocate newf, determine correct precision and fill buffer. (EN_PREC): New macro. (determine_en_precision): New function. (WRITE_FLOAT): For G format, move buffer filling into output_float_FMT_G, use FDTOA for F format. (write_float): Increase buffer due to F format. testsuite ChangeLog: 2012-03-15 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/52434 PR libfortran/48878 PR libfortran/38199 * gfortran.dg/edit_real_1.f90: Don't assume roundTiesToAway. * gfortran.dg/round_1.f03: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185433 138bc75d-0d04-0410-961f-82ee72b054a4
2011-11-10Let the compiler decide whether to inline.jb
2011-11-10 Janne Blomqvist <jb@gcc.gnu.org> * intrinsics/cpu_time.c (__cpu_time_1): Don't force inlining. * intrinsics/random.c (rnumber_4): Remove inline attribute. (rnumber_8, rnumber_10, rnumber_16): Likewise. * intrinsics/system_clock.c (gf_gettime_mono): Likewise. * intrinsics/time_1.h (ATTRIBUTE_ALWAYS_INLINE): Remove macro. (gf_cputime): Add inline attribute for MingW version. * io/format.c (format_hash): Remove inline attribute. * io/io.h (memset4): Inline function from transfer.c and write.c moved here. * io/transfer.c (min_off): Remove inline attribute. (memset4): Move to io.h. * io/write.c (memset4): Likewise. (memcpy4): Remove inline attribute. * io/write_float.def (calculate_exp): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181260 138bc75d-0d04-0410-961f-82ee72b054a4
2011-05-052011-05-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/48787 * io/write_float.def (output_float): Adjust up and down rounding for cases where 'd' = 0. Gather common code to one location. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173408 138bc75d-0d04-0410-961f-82ee72b054a4
2011-05-012011-05-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/48787 * io/write_float.def (output_float): Gather up integer declarations and add new 'p' for scale factor. Use 'p' in place of the 'dtp' reference everywhere. For ROUND_UP scan the digit string and only perform rounding if something other than '0' is found. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173231 138bc75d-0d04-0410-961f-82ee72b054a4
2011-04-292011-04-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
Janne Blomqvist <jb@gcc.gnu.org> PR libgfortran/48488 PR libgfortran/48602 PR libgfortran/48615 PR libgfortran/48684 PR libgfortran/48787 * io/write.c (write_d, write_e, write_f, write_en, write_es): Add precision compemsation parameter to call. (set_fnode_default): Adjust default widths to assure round trip on write and read. (write_real): Adjust call to write_float. (write_real_g0): Calculate compensation for extra precision and adjust call to write_float. * io/write_float.def (output_float_FMT_G_): Use volatile rather than asm volatile to avoid optimization issue. Correctly calculate the number of blanks (nb) to be appended and simplify calculation logic. (write_float): Increase MIN_FIELD_WIDTH by one to accomodate the new default widths. Eliminate the code that attempted to reduce the the precision used in later sprintf functions. Add call parameter to compensate for extra precision. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173166 138bc75d-0d04-0410-961f-82ee72b054a4
2011-04-202011-04-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/48602 * io/write_float.def (output_float_FMT_G): Fix reversal in conditional. Use asm volatile to mark temp variable, avoiding optimization errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172753 138bc75d-0d04-0410-961f-82ee72b054a4
2011-04-182011-04-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/48602 * io/write_float.def (output_float_FMT_G): Use current rounding mode to set the rounding parameters. (output_float): Skip rounding if value is zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172634 138bc75d-0d04-0410-961f-82ee72b054a4
2011-04-16Replace sprintf with snprintfjb
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172590 138bc75d-0d04-0410-961f-82ee72b054a4
2011-04-152011-04-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/48589 * io/write_float.def (write_infnan): Set width properly for G0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172502 138bc75d-0d04-0410-961f-82ee72b054a4
2011-03-122011-03-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/48047 * io/write_float.def (write_float): Change MIN_FIELD_WIDTH to 48. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170895 138bc75d-0d04-0410-961f-82ee72b054a4
2011-03-012011-02-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/47567 * io/write_float.def (output_float): Move handling of w = 0 to after output rounding. Check for zero and set zero_flag accordingly. Set width according to zero_flag. Add better comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170585 138bc75d-0d04-0410-961f-82ee72b054a4
2011-02-242011-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/47567 * io/write_float.def (output_float): Remove special case handling of zero with width 1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170458 138bc75d-0d04-0410-961f-82ee72b054a4
2011-02-192011-02-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/47567 * io/write_float.def (output_float): Adjust width for F0.d to allow space for negative signs on zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170318 138bc75d-0d04-0410-961f-82ee72b054a4
2011-02-14 PR fortran/47642jakub
* libquadmath.texi (quadmath_snprintf): Document. (quadmath_flt128tostr): Remove. * Makefile.am (libquadmath_la_SOURCES): Add printf/*.c. Remove quadmath_io.c, gdtoa/gdtoa.c, gdtoa/g__fmt.c, gdtoa/g_Qfmt.c, gdtoa/dmisc.c and gdtoa/ulp.c. * quadmath.h (quadmath_snprintf): New prototype. (quadmath_flt128tostr): Remove. * quadmath_weak.h (quadmath_snprintf): Add. (quadmath_flt128tostr): Remove. * configure.ac: New AC_CHECK_HEADERS headers: langinfo.h, wchar.h, wctype.h, limits.h, ctype.h, printf.h, errno.h. (AC_USE_SYSTEM_EXTENSIONS): Add. (HAVE_HIDDEN_VISIBILITY, HAVE_PRINTF_HOOKS, USE_LOCALE_SUPPORT, USE_I18N_NUMBER_H): New checks. * quadmath.map (QUADMATH_1.0): Add quadmath_snprintf. Remove quadmath_flt128tostr. * printf/printf_fphex.c: New file. * printf/_itowa.h: New file. * printf/mul_n.c: New file. * printf/quadmath-printf.h: New file. * printf/submul_1.c: New file. * printf/quadmath-printf.c: New file. * printf/gmp-impl.h: New file. * printf/lshift.c: New file. * printf/fpioconst.h: New file. * printf/add_n.c: New file. * printf/cmp.c: New file. * printf/sub_n.c: New file. * printf/mul.c: New file. * printf/divrem.c: New file. * printf/addmul_1.c: New file. * printf/printf_fp.c: New file. * printf/_itoa.h: New file. * printf/fpioconst.c: New file. * printf/_i18n_number.h: New file. * printf/flt1282mpn.c: New file. * printf/rshift.c: New file. * printf/mul_1.c: New file. * quadmath_io.c: Removed. * gdtoa/gdtoa.c: Removed. * gdtoa/g__fmt.c: Removed. * gdtoa/g_Qfmt.c: Removed. * gdtoa/dmisc.c: Removed. * gdtoa/ulp.c: Removed. * config.h.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. * io/write_float.def (DTOAQ): Use quadmath_snprintf instead of quadmath_flt128tostr. * io/transfer128.c (tmp2): Initialize to quadmath_snprintf instead of quadmath_flt128tostr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170135 138bc75d-0d04-0410-961f-82ee72b054a4
2011-02-052011-02-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/47567 * io/write_float.def (output_float): Eliminate some redundant code. Adjust width for case of F0.X for values of zero and all other values. Expand cases where '*' is set to give cleaner results. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169853 138bc75d-0d04-0410-961f-82ee72b054a4
2011-01-292011-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/47434 * io/write_float.def (write_infnan): Use calculate_sign to determine if the sign should be given and check field widths accordingly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169390 138bc75d-0d04-0410-961f-82ee72b054a4
2011-01-272011-01-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/47285 * io/write_float.def (output_float): Return SUCCESS or FAILURE and use the result to set the padding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169320 138bc75d-0d04-0410-961f-82ee72b054a4
2011-01-16 PR fortran/46625jakub
* quadmath.map (QUADMATH_1.0): Remove quadmath_strtopQ and quadmath_dtoaq. Add strtoflt128 and quadmath_flt128tostr. * quadmath_weak.h (quadmath_strtopQ, quadmath_dtoaq): Remove. (strtoflt128, quadmath_flt128tostr): Add. * gdtoa/strtopQ.c (quadmath_strtopQ): Rename to... (strtoflt128): ... this. Return __float128, instead of writing to memory pointed by last argument. * quadmath.h: Use C style comments instead of C++ style. (quadmath_strtopQ, quadmath_dtoaq): Remove prototypes. (strtoflt128, quadmath_flt128tostr): Add prototypes. * libquadmath.texi (quadmath_dtoaq): Rename to quadmath_flt128tostr. (quadmath_strtopQ): Rename to strtoflt128. Adjust prototype, adjust examples. * quadmath_io.c (quadmath_dtoaq): Rename to... (quadmath_flt128tostr): ... this. libgfortran/ * io/write_float.def (DTOAQ): Use quadmath_flt128tostr instead of quadmath_dtoa. * io/transfer128.c (tmp1, tmp2): New variables, bring in strtoflt128 and quadmath_flt128tostr. (transfer_real128, transfer_real128_write, transfer_complex128, transfer_complex128_write): Remove tmp1/tmp2 variables. * io/read.c (convert_real): Use strtoflt128 instead of quadmath_strtopQ, adjust for the changed arguments and return value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168856 138bc75d-0d04-0410-961f-82ee72b054a4
2010-11-16/burnus
2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.def: Add libquadmath; build it with language=fortran. * configure.ac: Add libquadmath. * Makefile.tpl: Handle multiple libs in check-[+language+]. * Makefile.in: Regenerate. * configure: Regenerate. libquadmath/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 Initial implementation and checkin. gcc/fortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortranspec.c (find_spec_file): New function. (lang_specific_driver): Try to find .spec file and use it. * trans-io.c (iocall): Define * IOCALL_X_REAL128/COMPLEX128(,write). (gfc_build_io_library_fndecls): Build decl for __float128 I/O. (transfer_expr): Call __float128 I/O functions. * trans-types.c (gfc_init_kinds): Allow kind-16 belonging to __float128. gcc/testsuite/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortran.dg/quad_1.f90: New. * lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also compiler arguments. * lib/gfortran.exp (gfortran_link_flags): Add libquadmath to library search path; call gcc-set-multilib-library-path with arguments such that libgfortran.spec is found. (gfortran_init): Add path for libgfortran.spec to GFORTRAN_UNDER_TEST. libgomp/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * configure.ac: * configure: Regenerate. libgfortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.am: Add missing pow_r16_i4.c, add transfer128.c, link libquadmath, if used. * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add. * configure.ac: Use it, touch spec file. * gfortran.map: Add pow_r16_i4 and transfer_(real,complex)128(,write) functions. * intrinsics/cshift0.c (cshift0): Handle __float128 type. * intrinsics/erfc_scaled_inc.c: Ditto. * intrinsics/pack_generic.c (pack): Ditto * intrinsics/spread_generic.c (spread): Ditto. * intrinsics/unpack_generic.c (unpack1): Ditto. * io/read.c (convert_real): Ditto. * io/transfer.c: Update comments. * io/transfer128.c: New file. * io/write_float.def (write_float): Handle __float128 type. * libgfortran.h: #include quadmath_weak.h, define __builtin_infq and nanq. * m4/mtype.m4: Handle __float128 type. * runtime/in_pack_generic.c (internal_pack): Ditto. * runtime/in_unpack_generic.c (internal_unpack): Ditto. * kinds-override.h: New file. * libgfortran.spec.in: Ditto. * generated/pow_r16_i4.c: Generated. * Makefile.in: Regenerate. * configure: Regenerate. * config.h: Regenerate. * bessel_r10.c: Regenerate. * bessel_r16.c: Regenerate. * bessel_r4.c: Regenerate. * bessel_r8.c: Regenerate. * exponent_r16.c: Regenerate. * fraction_r16.c: Regenerate. * nearest_r16.c: Regenerate. * norm2_r10.c: Regenerate. * norm2_r16.c: Regenerate. * norm2_r4.c: Regenerate. * norm2_r8.c: Regenerate. * rrspacing_r16.c: Regenerate. * set_exponent_r16.c: Regenerate. * spacing_r16.c: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166825 138bc75d-0d04-0410-961f-82ee72b054a4
2010-09-09 * acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE,fxcoudert
LIBGFOR_CHECK_FOR_BROKEN_ISNAN, LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): Remove. * configure.ac: Remove above checks. * libgfortran.h: Define isnan, isinf, isfinite, isnormal and signbit in terms of the respective built-ins. * io/write_float.def (WRITE_FLOAT): Use signbit() instead of __builtin_signbit(). * intrinsics/c99_functions.c (tgamma): Use isnan() instead of __builtin_isnan(). * config.h.in: Regenerate. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164119 138bc75d-0d04-0410-961f-82ee72b054a4
2010-07-192010-07-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libfortran/44953 * io/unix.c (mem_alloc_w4): Return gfc_char4_t instead of char type pointer. (mem_write4): Remove cast to gfc_char4_t. * io/transfer.c (write_block): Use a gfc_char4_t pointer. (memset4): New helper function. (next_record_w): Use new helper function rather than sset for internal units. Don't attempt to pad with spaces if it is not needed. * io/unix.h: Update prototype for mem_alloc_w4. * io/write.c (memset4): Use gfc_char4_t pointer and chracter type. Don't use multiply by 4 to compute offset. (memcpy4): Likewise. (write_default_char4): Use a gfc_char4_t pointer and update memset4 and memcpy calls. (write_a): Likewise. (write_l): Likewise. (write_boz): Likewise. (write_decimal): Likewise. (write_x): Likewise. (write_char): Add support for character(kind=4) internal units that was previously missed. (write_integer): Use a gfc_char4_t pointer and update memset4 and memcpy calls. (write_character): Likewise. (write_separator): Add support for character(kind=4) internal units that was previously missed. * write_float.def (output_float): Use a gfc_char4_t pointer and update memset4 and memcpy calls. (write_infnan): Likewise. (output_float_FMT_G_): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162304 138bc75d-0d04-0410-961f-82ee72b054a4
2010-07-132010-07-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libfortran/37077 * io/read.c: Fix comment. * io/io.h (is_char4_unit): New macro. * io/unit.c (get_internal_unit): Call new function open_internal4. * io/unix.c (mem_alloc_r4): New function. (mem_alloc_w4): New function. (mem_read4): New function, temporary stub. (mem_write4): New function. (open_internal4): New function to set stream pointers to use the new mem functions. * io/transfer.c (write_block): Use new mem_alloc_w4 to access internal units of kind=4. * io/unix.h: Add prototypes for open_internal4, mem_alloc_w4, and mem_alloc_r4. * io/write.c (memset4): New helper function. (memcpy4): New helper function. (write_default_char4): Use new helper functions. (write_a): Likewise. (write_l): Likewise. (write_boz): Likewise. (write_decimal): Likewise. (write_x): Likewise. (write_integer): Likewise. * io/write_float.def (output_float): Add code blocks to handle internal unit kind=4 output utilizing gfc_char4_t pointers. (write_infnan): Use new helper functions. (OUTPUT_FLOAT_FMT_G): Update this macro likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162123 138bc75d-0d04-0410-961f-82ee72b054a4
2010-05-07Remove free_memjb
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159160 138bc75d-0d04-0410-961f-82ee72b054a4
2010-02-24 * io/write_float.def (WRITE_FLOAT): Use __builtin_signbit.ro
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157048 138bc75d-0d04-0410-961f-82ee72b054a4
2009-10-062009-10-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/35862 * write_float.def (outout_float): Fix handling of special case where no digits after the decimal point and values less than 1.0. Adjust index into digits string. (WRITE_FLOAT): Remove special case code from macro. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152483 138bc75d-0d04-0410-961f-82ee72b054a4
2009-09-292009-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libgfortran/35862 * io.h (gfc_unit): Add round_status. (format_token): Add enumerators for rounding format specifiers. * transfer.c (round_opt): New options table. (formatted_transfer_scalar_read): Add set round_status for each rounding format token. (formatted_transfer_scalar_write): Likewise. * format.c (format_lex): Tokenize the rounding format specifiers. (parse_format_list): Parse the rounding format specifiers. * write_float.def (outout_float): Modify rounding code to use new variable rchar to set the appropriate rounding. Fix some whitespace. * unit.c (get_internal_unit): Initialize rounding mode for internal units. (init_units): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152263 138bc75d-0d04-0410-961f-82ee72b054a4
2009-05-202009-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle
PR libfortran/37754 * io/write_float.def: Simplify format calculation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147725 138bc75d-0d04-0410-961f-82ee72b054a4
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145841 138bc75d-0d04-0410-961f-82ee72b054a4