COBOL ADD/SUBTRACT refactored for performance.
COBOL ADD and SUBTRACT operations moved from library calls to direct GENERIC for speed.
The implementation of COBOL’s ADD and SUBTRACT operations has been significantly refactored for improved performance. Previously, these operations relied on library routines; now, they are implemented directly within the GENERIC intermediate representation. This change involves new helper functions for addition and adjusts existing ones to utilize the new direct implementation, while also removing unused test cases.
In Details
This commit refactors the COBOL front-end's implementation of ADD and SUBTRACT operations, moving them from library calls to direct GENERIC code generation. New functions like determine_excess_rdigits and add_phase_1 are introduced to handle the arithmetic logic more efficiently. This aims to improve the performance of arithmetic operations generated for COBOL programs by avoiding function call overhead. Several test cases related to PR126612 and RT3611 have been removed.
- GENERIC
- An intermediate representation (IR) used within GCC. It's a higher-level representation than GIMPLE, designed to be largely machine-independent, facilitating various compiler optimizations.
- COBOL
- A compiled high-level programming language that is designed for business applications. GCC includes a front-end for compiling COBOL programs.
- library routines
- Pre-compiled pieces of code that perform specific tasks, which can be called by other programs to avoid reimplementing common functionality. In this context, it refers to routines called by the COBOL compiler for arithmetic operations.