cobol: Improve MOVE BINARY/COMP-5 to PACKED-DECIMAL and NUMERIC-DISPLAY
These are more efficient algorithms for converting binary values to
packed-decimal and zoned decimal byte strings. There is also an
improved routine that generates GENERIC to do COBOL rounding during
such moves.
gcc/cobol/ChangeLog:
* gengen.cc (gg_abs): Use fold_build1().
* genutil.cc (scale_and_round): Remove function.
(round_this_value): New function for rounding.
* genutil.h (scale_and_round): Remove function.
(round_this_value): New declaration.
* move.cc (cobol_wider_type_with_x_signedness): New function.
(mh_binary_to_numdisp): Faster routine.
(mh_binary_to_packed): Faster routine.
(move_helper): Use the faster routines.
* cobol.dg/group1/simple-classes.cob:
* cobol.dg/group1/simple-if.cob:
* cobol.dg/group2/Rounding_from_BINARY_signable_and_negative.cob: New test.
* cobol.dg/group2/Rounding_from_BINARY_signable_and_negative.out: New test.
* cobol.dg/group2/Rounding_from_BINARY_signable_and_positive.cob: New test.
* cobol.dg/group2/Rounding_from_BINARY_signable_and_positive.out: New test.
* cobol.dg/group2/Rounding_from_BINARY_unsignable.cob: New test.
* cobol.dg/group2/Rounding_from_BINARY_unsignable.out: New test.