Mercurial > hg > octave-lyh
changeset 17423:3856298f1ff8
eliminate unimplemented vax and cray floating point formats
* mach-info.h
* test/io.tst: Delete vaxd, vaxg, and cray from list of architectures
in fopen test.
# HG changeset patch
# User John W. Eaton <jwe@octave.org>
# Date 1379028062 14400
# Thu Sep 12 19:21:02 2013 -0400
# Node ID ea2763020ac1aa15ad0d43d787b61ff3b8469209
# Parent e89e86e1a5518c11058930fec5e907e60e31251b
eliminate unimplemented vax and cray floating point formats
* mach-info.h (oct_mach_info::float_format): Delete flt_fmt_vaxd,
flt_fmt_vaxg, and flt_fmt_cray enum values.
* ls-mat4.cc (float_format_to_mopt_digit, mopt_digit_to_float_format):
Delete cases for vaxd, vaxg, and cray floating point formats.
* lo-ieee.cc (octave_ieee_init): Likewise.
* mach-info.cc (get_float_format,
oct_mach_info::string_to_float_format,
oct_mach_info::float_format_as_string): Likewise.
* oct-stream.cc: Delete explicit template instantiation for do_write.
(octave_stream::write, do_read): Delete checks for vaxd and vaxg
floating point formats.
* pr-output.cc (pr_any_float): Don't check for cray or unknonwn float
formats.
* data-conv.cc (VAX_D_double_to_IEEE_little_double,
VAX_G_double_to_IEEE_little_double, Cray_to_IEEE_little_double,
IEEE_big_float_to_IEEE_little_float, VAX_D_float_to_IEEE_little_float,
VAX_G_float_to_IEEE_little_float, Cray_to_IEEE_little_float,
IEEE_little_double_to_IEEE_big_double,
VAX_D_double_to_IEEE_big_double, VAX_G_double_to_IEEE_big_double,
Cray_to_IEEE_big_double, IEEE_little_float_to_IEEE_big_float,
VAX_D_float_to_IEEE_big_float, VAX_G_float_to_IEEE_big_float,
Cray_to_IEEE_big_float, IEEE_little_double_to_VAX_D_double,
IEEE_big_double_to_VAX_D_double, VAX_G_double_to_VAX_D_double,
Cray_to_VAX_D_double, IEEE_little_float_to_VAX_D_float,
IEEE_big_float_to_VAX_D_float, VAX_G_float_to_VAX_D_float,
Cray_to_VAX_D_float, IEEE_little_double_to_VAX_G_double,
IEEE_big_double_to_VAX_G_double, VAX_D_double_to_VAX_G_double,
Cray_to_VAX_G_double, IEEE_little_float_to_VAX_G_float,
IEEE_big_float_to_VAX_G_float, VAX_D_float_to_VAX_G_float,
Cray_to_VAX_G_float): Delete.
(do_double_format_conversion): Eliminate unimplemented vaxd, vaxg, and
cray conversions.
* file-io.cc (Ffopen, Ffread): Fix doc strings.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 12 Sep 2013 19:21:02 -0400 |
parents | e89e86e1a551 |
children | 6690dba6078a |
files | libinterp/corefcn/file-io.cc libinterp/corefcn/ls-mat4.cc libinterp/corefcn/oct-stream.cc libinterp/corefcn/pr-output.cc liboctave/system/mach-info.cc liboctave/system/mach-info.h liboctave/util/data-conv.cc liboctave/util/lo-ieee.cc test/io.tst |
diffstat | 9 files changed, 5 insertions(+), 468 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/file-io.cc +++ b/libinterp/corefcn/file-io.cc @@ -670,15 +670,6 @@ \n\ @item ieee-le\n\ IEEE little endian format.\n\ -\n\ -@item vaxd\n\ -VAX D floating format.\n\ -\n\ -@item vaxg\n\ -VAX G floating format.\n\ -\n\ -@item cray\n\ -Cray floating format.\n\ @end table\n\ \n\ @noindent\n\ @@ -1563,15 +1554,6 @@ \n\ @item \"ieee-le\"\n\ IEEE little endian.\n\ -\n\ -@item @qcode{\"vaxd\"}\n\ -VAX D floating format.\n\ -\n\ -@item @qcode{\"vaxg\"}\n\ -VAX G floating format.\n\ -\n\ -@item @qcode{\"cray\"}\n\ -Cray floating format.\n\ @end table\n\ \n\ @noindent\n\
--- a/libinterp/corefcn/ls-mat4.cc +++ b/libinterp/corefcn/ls-mat4.cc @@ -194,17 +194,8 @@ break; case 2: - flt_fmt = oct_mach_info::flt_fmt_vax_d; - break; - case 3: - flt_fmt = oct_mach_info::flt_fmt_vax_g; - break; - case 4: - flt_fmt = oct_mach_info::flt_fmt_cray; - break; - default: flt_fmt = oct_mach_info::flt_fmt_unknown; break; @@ -228,18 +219,6 @@ retval = 1; break; - case oct_mach_info::flt_fmt_vax_d: - retval = 2; - break; - - case oct_mach_info::flt_fmt_vax_g: - retval = 3; - break; - - case oct_mach_info::flt_fmt_cray: - retval = 4; - break; - default: break; }
--- a/libinterp/corefcn/oct-stream.cc +++ b/libinterp/corefcn/oct-stream.cc @@ -3079,14 +3079,10 @@ max_size = 32; } - // FIXME -- byte order for Cray? - bool swap = false; if (oct_mach_info::words_big_endian ()) - swap = (from_flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian - || from_flt_fmt == oct_mach_info::flt_fmt_vax_g - || from_flt_fmt == oct_mach_info::flt_fmt_vax_g); + swap = (from_flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian); else swap = (from_flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian); @@ -3495,38 +3491,6 @@ return retval; } -template bool -do_write (std::ostream&, const octave_int8&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - -template bool -do_write (std::ostream&, const octave_uint8&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - -template bool -do_write (std::ostream&, const octave_int16&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - -template bool -do_write (std::ostream&, const octave_uint16&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - -template bool -do_write (std::ostream&, const octave_int32&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - -template bool -do_write (std::ostream&, const octave_uint32&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - -template bool -do_write (std::ostream&, const octave_int64&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - -template bool -do_write (std::ostream&, const octave_uint64&, oct_data_conv::data_type, - oct_mach_info::float_format, bool, bool); - template <class T> octave_idx_type octave_stream::write (const Array<T>& data, octave_idx_type block_size, @@ -3548,14 +3512,10 @@ bool do_float_conversion = (flt_fmt != native_flt_fmt); - // FIXME -- byte order for Cray? - bool swap = false; if (oct_mach_info::words_big_endian ()) - swap = (flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian - || flt_fmt == oct_mach_info::flt_fmt_vax_g - || flt_fmt == oct_mach_info::flt_fmt_vax_g); + swap = (flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian); else swap = (flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian);
--- a/libinterp/corefcn/pr-output.cc +++ b/libinterp/corefcn/pr-output.cc @@ -1459,9 +1459,6 @@ // Unless explicitly asked for, always print in big-endian // format. - // FIXME -- is it correct to swap bytes for VAX - // formats and not for Cray? - // FIXME -- will bad things happen if we are // interrupted before resetting the format flags and fill // character? @@ -1475,9 +1472,7 @@ = os.flags (std::ios::right | std::ios::hex); if (hex_format > 1 - || flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian - || flt_fmt == oct_mach_info::flt_fmt_cray - || flt_fmt == oct_mach_info::flt_fmt_unknown) + || flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian) { for (size_t i = 0; i < sizeof (double); i++) os << std::setw (2) << static_cast<int> (tmp.i[i]); @@ -1496,15 +1491,10 @@ equiv tmp; tmp.d = d; - // FIXME -- is it correct to swap bytes for VAX - // formats and not for Cray? - oct_mach_info::float_format flt_fmt = oct_mach_info::native_float_format (); - if (flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian - || flt_fmt == oct_mach_info::flt_fmt_cray - || flt_fmt == oct_mach_info::flt_fmt_unknown) + if (flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian) { for (size_t i = 0; i < sizeof (double); i++) PRINT_CHAR_BITS (os, tmp.i[i]);
--- a/liboctave/system/mach-info.cc +++ b/liboctave/system/mach-info.cc @@ -75,14 +75,6 @@ { oct_mach_info::float_format retval = oct_mach_info::flt_fmt_unknown; -#if defined (CRAY) - - // FIXME -- this should be determined automatically. - - native_float_fmt = oct_mach_info::flt_fmt_cray; - -#else - float_params fp[5]; INIT_FLT_PAR (fp[0], oct_mach_info::flt_fmt_ieee_big_endian, @@ -97,18 +89,6 @@ 0, 1017118720, 0, 1018167296); - INIT_FLT_PAR (fp[2], oct_mach_info::flt_fmt_vax_d, - 128, 0, - -32769, -1, - 9344, 0, - 9344, 0); - - INIT_FLT_PAR (fp[3], oct_mach_info::flt_fmt_vax_g, - 16, 0, - -32769, -1, - 15552, 0, - 15552, 0); - INIT_FLT_PAR (fp[4], oct_mach_info::flt_fmt_unknown, 0, 0, 0, 0, @@ -133,8 +113,6 @@ } while (fp[++i].fp_fmt != oct_mach_info::flt_fmt_unknown); -#endif - return retval; } @@ -214,12 +192,6 @@ retval = oct_mach_info::flt_fmt_ieee_big_endian; else if (s == "ieee-le" || s == "l") retval = oct_mach_info::flt_fmt_ieee_little_endian; - else if (s == "vaxd" || s == "d") - retval = oct_mach_info::flt_fmt_vax_d; - else if (s == "vaxg" || s == "g") - retval = oct_mach_info::flt_fmt_vax_g; - else if (s == "cray" || s == "c") - retval = oct_mach_info::flt_fmt_cray; else if (s == "unknown") retval = oct_mach_info::flt_fmt_unknown; else @@ -244,18 +216,6 @@ retval = "ieee-le"; break; - case flt_fmt_vax_d: - retval = "vaxd"; - break; - - case flt_fmt_vax_g: - retval = "vaxg"; - break; - - case flt_fmt_cray: - retval = "cray"; - break; - default: break; }
--- a/liboctave/system/mach-info.h +++ b/liboctave/system/mach-info.h @@ -40,9 +40,6 @@ flt_fmt_unknown, flt_fmt_ieee_little_endian, flt_fmt_ieee_big_endian, - flt_fmt_vax_d, - flt_fmt_vax_g, - flt_fmt_cray }; static bool instance_ok (void);
--- a/liboctave/util/data-conv.cc +++ b/liboctave/util/data-conv.cc @@ -545,191 +545,23 @@ } static void -VAX_D_double_to_IEEE_little_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX D float", "IEEE little endian format"); -} - -static void -VAX_G_double_to_IEEE_little_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "IEEE little endian format"); -} - -static void -Cray_to_IEEE_little_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("Cray", "IEEE little endian format"); -} - -static void IEEE_big_float_to_IEEE_little_float (void *d, octave_idx_type len) { swap_bytes<4> (d, len); } static void -VAX_D_float_to_IEEE_little_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX D float", "IEEE little endian format"); -} - -static void -VAX_G_float_to_IEEE_little_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "IEEE little endian format"); -} - -static void -Cray_to_IEEE_little_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("Cray", "IEEE little endian format"); -} - -static void IEEE_little_double_to_IEEE_big_double (void *d, octave_idx_type len) { swap_bytes<8> (d, len); } static void -VAX_D_double_to_IEEE_big_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX D float", "IEEE big endian format"); -} - -static void -VAX_G_double_to_IEEE_big_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "IEEE big endian format"); -} - -static void -Cray_to_IEEE_big_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("Cray", "IEEE big endian format"); -} - -static void IEEE_little_float_to_IEEE_big_float (void *d, octave_idx_type len) { swap_bytes<4> (d, len); } -static void -VAX_D_float_to_IEEE_big_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX D float", "IEEE big endian format"); -} - -static void -VAX_G_float_to_IEEE_big_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "IEEE big endian format"); -} - -static void -Cray_to_IEEE_big_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("Cray", "IEEE big endian format"); -} - -static void -IEEE_little_double_to_VAX_D_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE little endian", "VAX D"); -} - -static void -IEEE_big_double_to_VAX_D_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE big endian", "VAX D"); -} - -static void -VAX_G_double_to_VAX_D_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "VAX D"); -} - -static void -Cray_to_VAX_D_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("Cray", "VAX D"); -} - -static void -IEEE_little_float_to_VAX_D_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE little endian", "VAX D"); -} - -static void -IEEE_big_float_to_VAX_D_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE big endian", "VAX D"); -} - -static void -VAX_G_float_to_VAX_D_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "VAX D"); -} - -static void -Cray_to_VAX_D_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("Cray", "VAX D"); -} - -static void -IEEE_little_double_to_VAX_G_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE little endian", "VAX G"); -} - -static void -IEEE_big_double_to_VAX_G_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE big endian", "VAX G"); -} - -static void -VAX_D_double_to_VAX_G_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX D float", "VAX G"); -} - -static void -Cray_to_VAX_G_double (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "VAX G"); -} - -static void -IEEE_little_float_to_VAX_G_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE little endian", "VAX G"); -} - -static void -IEEE_big_float_to_VAX_G_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("IEEE big endian", "VAX G"); -} - -static void -VAX_D_float_to_VAX_G_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX D float", "VAX G"); -} - -static void -Cray_to_VAX_G_float (void * /* d */, octave_idx_type /* len */) -{ - gripe_data_conversion ("VAX G float", "VAX G"); -} - void do_double_format_conversion (void *data, octave_idx_type len, oct_mach_info::float_format from_fmt, @@ -747,18 +579,6 @@ IEEE_big_double_to_IEEE_little_double (data, len); break; - case oct_mach_info::flt_fmt_vax_d: - VAX_D_double_to_IEEE_little_double (data, len); - break; - - case oct_mach_info::flt_fmt_vax_g: - VAX_G_double_to_IEEE_little_double (data, len); - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_IEEE_little_double (data, len); - break; - default: gripe_unrecognized_float_fmt (); break; @@ -775,74 +595,6 @@ case oct_mach_info::flt_fmt_ieee_big_endian: break; - case oct_mach_info::flt_fmt_vax_d: - VAX_D_double_to_IEEE_big_double (data, len); - break; - - case oct_mach_info::flt_fmt_vax_g: - VAX_G_double_to_IEEE_big_double (data, len); - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_IEEE_big_double (data, len); - break; - - default: - gripe_unrecognized_float_fmt (); - break; - } - break; - - case oct_mach_info::flt_fmt_vax_d: - switch (from_fmt) - { - case oct_mach_info::flt_fmt_ieee_little_endian: - IEEE_little_double_to_VAX_D_double (data, len); - break; - - case oct_mach_info::flt_fmt_ieee_big_endian: - IEEE_big_double_to_VAX_D_double (data, len); - break; - - case oct_mach_info::flt_fmt_vax_d: - break; - - case oct_mach_info::flt_fmt_vax_g: - VAX_G_double_to_VAX_D_double (data, len); - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_VAX_D_double (data, len); - break; - - default: - gripe_unrecognized_float_fmt (); - break; - } - break; - - case oct_mach_info::flt_fmt_vax_g: - switch (from_fmt) - { - case oct_mach_info::flt_fmt_ieee_little_endian: - IEEE_little_double_to_VAX_G_double (data, len); - break; - - case oct_mach_info::flt_fmt_ieee_big_endian: - IEEE_big_double_to_VAX_G_double (data, len); - break; - - case oct_mach_info::flt_fmt_vax_d: - VAX_D_double_to_VAX_G_double (data, len); - break; - - case oct_mach_info::flt_fmt_vax_g: - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_VAX_G_double (data, len); - break; - default: gripe_unrecognized_float_fmt (); break; @@ -874,18 +626,6 @@ IEEE_big_float_to_IEEE_little_float (data, len); break; - case oct_mach_info::flt_fmt_vax_d: - VAX_D_float_to_IEEE_little_float (data, len); - break; - - case oct_mach_info::flt_fmt_vax_g: - VAX_G_float_to_IEEE_little_float (data, len); - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_IEEE_little_float (data, len); - break; - default: gripe_unrecognized_float_fmt (); break; @@ -902,74 +642,6 @@ case oct_mach_info::flt_fmt_ieee_big_endian: break; - case oct_mach_info::flt_fmt_vax_d: - VAX_D_float_to_IEEE_big_float (data, len); - break; - - case oct_mach_info::flt_fmt_vax_g: - VAX_G_float_to_IEEE_big_float (data, len); - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_IEEE_big_float (data, len); - break; - - default: - gripe_unrecognized_float_fmt (); - break; - } - break; - - case oct_mach_info::flt_fmt_vax_d: - switch (from_fmt) - { - case oct_mach_info::flt_fmt_ieee_little_endian: - IEEE_little_float_to_VAX_D_float (data, len); - break; - - case oct_mach_info::flt_fmt_ieee_big_endian: - IEEE_big_float_to_VAX_D_float (data, len); - break; - - case oct_mach_info::flt_fmt_vax_d: - break; - - case oct_mach_info::flt_fmt_vax_g: - VAX_G_float_to_VAX_D_float (data, len); - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_VAX_D_float (data, len); - break; - - default: - gripe_unrecognized_float_fmt (); - break; - } - break; - - case oct_mach_info::flt_fmt_vax_g: - switch (from_fmt) - { - case oct_mach_info::flt_fmt_ieee_little_endian: - IEEE_little_float_to_VAX_G_float (data, len); - break; - - case oct_mach_info::flt_fmt_ieee_big_endian: - IEEE_big_float_to_VAX_G_float (data, len); - break; - - case oct_mach_info::flt_fmt_vax_d: - VAX_D_float_to_VAX_G_float (data, len); - break; - - case oct_mach_info::flt_fmt_vax_g: - break; - - case oct_mach_info::flt_fmt_cray: - Cray_to_VAX_G_float (data, len); - break; - default: gripe_unrecognized_float_fmt (); break;
--- a/liboctave/util/lo-ieee.cc +++ b/liboctave/util/lo-ieee.cc @@ -73,9 +73,6 @@ } break; - case oct_mach_info::flt_fmt_cray: - case oct_mach_info::flt_fmt_vax_d: - case oct_mach_info::flt_fmt_vax_g: default: // If the format is unknown, then you will probably not have a // useful system, so we will abort here. Anyone wishing to
--- a/test/io.tst +++ b/test/io.tst @@ -319,7 +319,7 @@ %!error <format TEMPLATE must be a string> sprintf (1) %!test -%! arch_list = {"native"; "ieee-le"; "ieee-be"; "vaxd"; "vaxg"; "cray"}; +%! arch_list = {"native"; "ieee-le"; "ieee-be"}; %! warning ("off", "Octave:fopen-mode"); %! status = 1; %!