]> git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Implement faster zoned decimal to binary conversion.
authorRobert Dubner <rdubner@symas.com>
Wed, 13 Aug 2025 02:13:59 +0000 (22:13 -0400)
committerRobert Dubner <rdubner@symas.com>
Wed, 13 Aug 2025 02:23:47 +0000 (22:23 -0400)
commit67e0490922691305699fb17922e44bce304e0505
treec4a8de67694e6c086127bd3501fc90f70160d7c0
parentf622df9af2e7c1da35cf0c9b895dacc1fa75107a
cobol: Implement faster zoned decimal to binary conversion.

Replace " value *= 10; value += digit" routines with a new one that does two
digits at a time and avoids __int128 calculations until they are necessary.

These changes also clean up the conversion behavior when a digit is not valid.

gcc/cobol/ChangeLog:

* genutil.cc (get_binary_value): Use the new routine.

libgcobol/ChangeLog:

* libgcobol.cc (int128_to_field): Use the new routine.
(get_binary_value_local): Use the new routine.
(format_for_display_internal): Formatting.
(__gg__get_file_descriptor): Likewise.
* stringbin.cc (string_from_combined): Formatting.
(packed_from_combined): Likewise.
(int_from_string): New routine.
(__gg__numeric_display_to_binary): Likewise.
* stringbin.h (__gg__numeric_display_to_binary): Likewise.
gcc/cobol/genutil.cc
libgcobol/libgcobol.cc
libgcobol/stringbin.cc
libgcobol/stringbin.h