Define fixed-size modes for standard types in Algol68
Algol68 compiler now defines fixed-size modes for standard types, improving type handling and dispatching for real number operations.
The Algol68 compiler has been updated to define fixed-size modes for standard data types. This change standardizes how these types are represented and handled, particularly in the context of real number operations. The code dispatching for built-in functions like a68_real_pow, a68_real_round, and a68_real_entier now relies on type equality rather than just precision, leading to more robust and accurate behavior.
In Details
In gcc/algol68/a68-lang.cc, the a68_build_a68_type_nodes function now explicitly defines fixed-sized modes for standard Algol68 types. Concurrently, gcc/algol68/a68-low-reals.cc updates the dispatching logic for real number builtins (a68_real_pow, a68_real_round, a68_real_entier) to use type equality checks instead of precision comparisons. This ensures that operations are dispatched based on the exact type rather than just its size, which is crucial for correctly handling different floating-point representations.
- a68
- Refers to the Algol68 compiler front-end within GCC.
- Algol68
- A general-purpose programming language notable for its use of novel concepts such as array processing, 'go to' restrictions, and built-in parallel processing. It influenced many later languages.
- fixed sized modes
- Data types with a precisely defined size in memory (e.g., 32-bit integer, 64-bit float).
- standard types
- Built-in data types provided by the language, such as integers and floating-point numbers.
- dispatch
- The process of selecting which function or code block to execute based on the types or properties of the input data.