Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p_standard_unit seems wrong with 22.0 compilers #663

Open
briot opened this issue Dec 14, 2020 · 1 comment
Open

p_standard_unit seems wrong with 22.0 compilers #663

briot opened this issue Dec 14, 2020 · 1 comment

Comments

@briot
Copy link

briot commented Dec 14, 2020

As part of a code generator, I am manipulating fixed point types. With more recent compiler wavefronts (supporting 128 bit integers), we have the following definition in system.ads:

 Max_Mantissa          : constant := Standard'Max_Integer_Size - 1;
  Fine_Delta            : constant := 2.0 ** (-Max_Mantissa);

where it used to be

Max_Mantissa          : constant := 63;
Fine_Delta            : constant := 2.0 ** (-Max_Mantissa);

My code generator is chocking at the moment because it doesn't know about the max_integer_size attribute. So I am trying to use p_standard_unit (from any node), which doesn't seem to include that definition either.

(presumably related: call p_eval_as_int on the expression for Fine_Delta raises an exception).

I also noticed that p_standard_unit doesn't include the new Long_Long_Long_Integer (which I do not need at this stage, but that shows it isn't up-to-date with the compiler).

Thanks
Manu

@Roldak
Copy link
Contributor

Roldak commented Feb 7, 2022

Hi Manu,

This is to let you know that we added Long_Long_Long_Integer to LAL's standard definition. We also added name resolution support for the Max_Integer_Size attribute, but for now there is unfortunately no way to evaluate it since its result is target dependent and LAL is target independent: therefore p_eval_as_int will continue to fail with Unhandled attribute ref: Max_Integer_Size.

We'll keep this issue open and flag it as an enhancement request to keep that issue in mind, but clearly this is non-trivial and might take a while to get into LAL.

Best regards,

Romain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants