]> git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Bring EBCDIC NumericDisplay variables into IBM compliance.
authorRobert Dubner <rdubner@symas.com>
Tue, 12 Aug 2025 00:56:38 +0000 (20:56 -0400)
committerRobert Dubner <rdubner@symas.com>
Tue, 12 Aug 2025 01:22:57 +0000 (21:22 -0400)
commit9992c0a0e1b455ad5c68d7261b4bc9bfc2461f70
treed39114218d30dcc96f9322f9a6c28e946ffc9d0e
parent1afd70fa2e5455fd75e3069899e56f12fea4adbb
cobol: Bring EBCDIC NumericDisplay variables into IBM compliance.

The internal representation of Numeric Display (ND) zoned decimal variables
when operating in EBCDIC mode has been brought into compliance with IBM
conventions.  This requires changes to data input, data output, internal
conversion of zoned decimal to binary, and variable assignment.

gcc/cobol/ChangeLog:

* genapi.cc (compare_binary_binary): Formatting.
(cobol_compare): Formatting.
(mh_numeric_display): Rewrite "move ND to ND" algorithm.
(initial_from_initial): Proper initialization of EBCDIC ND variables.
* genmath.cc (fast_add): Delete comment.
* genutil.cc (get_binary_value): Modify for updated EBCDIC.

libgcobol/ChangeLog:

* common-defs.h (NUMERIC_DISPLAY_SIGN_BIT): New comment; new constant.
(EBCDIC_MINUS): New constant.
(EBCDIC_PLUS): Likewise.
(EBCDIC_ZERO): Likewise.
(EBCDIC_NINE): Likewise.
(PACKED_NYBBLE_PLUS): Likewise.
(PACKED_NYBBLE_MINUS): Likewise.
(PACKED_NYBBLE_UNSIGNED): Likewise.
(NUMERIC_DISPLAY_SIGN_BIT_ASCII): Likewise.
(NUMERIC_DISPLAY_SIGN_BIT_EBCDIC): Likewise.
(SEPARATE_PLUS): Likewise.
(SEPARATE_MINUS): Likewise.
(ZONED_ZERO): Likewise.
(ZONE_SIGNED_EBCDIC): Likewise.
* configure: Regenerate.
* libgcobol.cc (turn_sign_bit_on): Handle new EBCDIC sign convention.
(turn_sign_bit_off): Likewise.
(is_sign_bit_on): Likewise.
(int128_to_field): EBCDIC NumericDisplay conversion.
(get_binary_value_local): Likewise.
(format_for_display_internal): Likewise.
(normalize_id): Likewise.
(__gg__inspect_format_1): Convert EBCDIC negative numbers to positive.
* stringbin.cc (packed_from_combined): Quell cppcheck warning.

gcc/testsuite/ChangeLog:

* cobol.dg/group2/ALLOCATE_Rule_8_OPTION_INITIALIZE_with_figconst.out:
Change test for updated handling of Numeric Display variables.
gcc/cobol/genapi.cc
gcc/cobol/genmath.cc
gcc/cobol/genutil.cc
gcc/testsuite/cobol.dg/group2/ALLOCATE_Rule_8_OPTION_INITIALIZE_with_figconst.out
libgcobol/common-defs.h
libgcobol/configure
libgcobol/libgcobol.cc
libgcobol/stringbin.cc