diff options
author | Robert Dubner <rdubner@symas.com> | 2025-08-08 13:04:53 -0400 |
---|---|---|
committer | Robert Dubner <rdubner@symas.com> | 2025-08-08 13:53:59 -0400 |
commit | 435e09e05c3750cad153c3c6e83134803c22c7f6 (patch) | |
tree | 20b7234399b48fd8bfd0a69bd5a5e5c66bec420b /libgcobol/stringbin.h | |
parent | e49bdf2c6c3fe9bf1c18b885727423dee5a67c44 (diff) | |
download | gcc-trunk.zip gcc-trunk.tar.gz gcc-trunk.tar.bz2 |
The legacy routine for converting a binary integer to a packed-decimal
representaion peeled two digits at a time from the bottom of an _int128 value.
These changes replace that routine with a divide-and-conquer algorithm that
runs about ten times faster.
libgcobol/ChangeLog:
* libgcobol.cc (int128_to_field): Switch to the new routine.
* stringbin.cc (packed_from_combined): Implement the new routine.
(__gg__binary_to_packed): Likewise.
* stringbin.h (__gg__binary_to_packed): Likewise.
Diffstat (limited to 'libgcobol/stringbin.h')
-rw-r--r-- | libgcobol/stringbin.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libgcobol/stringbin.h b/libgcobol/stringbin.h index 0276704..5ddb441 100644 --- a/libgcobol/stringbin.h +++ b/libgcobol/stringbin.h @@ -39,4 +39,9 @@ bool __gg__binary_to_string_internal( char *result, int digits, __int128 value); +extern "C" +void __gg__binary_to_packed( unsigned char *result, + int digits, + __int128 value); + #endif |