Skip to content

Implementation of trigonometric functions#13

Merged
FelixKrayer merged 2 commits intomasterfrom
libFuns
Jun 30, 2022
Merged

Implementation of trigonometric functions#13
FelixKrayer merged 2 commits intomasterfrom
libFuns

Conversation

@FelixKrayer
Copy link
Copy Markdown
Collaborator

@FelixKrayer FelixKrayer commented Jun 10, 2022

Further functions can easily be added later on.

Copy link
Copy Markdown
Owner

@Dudeldu Dudeldu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why git tells me, that you almost completely recreated the base.ml file? Maybe you formatted the whole file?

@FelixKrayer
Copy link
Copy Markdown
Collaborator Author

Damn windows always causing problems... We can see, if we can fix the problem with base.ml later before we merge, I think...

@FelixKrayer
Copy link
Copy Markdown
Collaborator Author

Also another problem is, that it seems like on macos the math.h macros are implemented using different __builtin_** So I changed it to use the __builtin_** directly in the regression test, instead of the math.h macros

@Dudeldu
Copy link
Copy Markdown
Owner

Dudeldu commented Jun 11, 2022

I'm not sure wether i got this right, but this means we have an abstraction for __builtin_nan etc. but not for the math.h macros? From my point of few we would prefer it the other way around, so having an abstraction for the macros and (not necessary) for the builtins. But i can also see the problem, that on our level we do no longer see those as they have been preprocessed away in an earlier stage (on Cil level probably)....
In that case we have an abstraction for the macros that are directly mapped to a builtin and not otherwise, which is nonetheless better than nothing.

@Dudeldu
Copy link
Copy Markdown
Owner

Dudeldu commented Jun 11, 2022

Damn windows always causing problems... We can see, if we can fix the problem with base.ml later before we merge, I think...

The problem from a reviewer perspective is, that i have no idea what you actually changed in base.ml

@FelixKrayer
Copy link
Copy Markdown
Collaborator Author

I'm not sure wether i got this right, but this means we have an abstraction for __builtin_nan etc. but not for the math.h macros? From my point of few we would prefer it the other way around, so having an abstraction for the macros and (not necessary) for the builtins. But i can also see the problem, that on our level we do no longer see those as they have been preprocessed away in an earlier stage (on Cil level probably).... In that case we have an abstraction for the macros that are directly mapped to a builtin and not otherwise, which is nonetheless better than nothing.

That is correct. If I write "isnan(x)" in a regressiontest, then on Windows (and Linux I assume) goblint receives __builtin_isnan(x), where on Macos it might get something else.
(On example where I am sure of that is, that if you look inside the failed regresiontest on MacOS here, you see somewhere "Function definition missing for __builtin_fabs", while on Windows and Linux this was never called. Now I would have no problem implementing __builtin_fabs aswell, but if you look at https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html and search for "__builtin_fabs" you see that it is not actually directly conforming to C99, but implementing TS 18661-3 which seems to be an extension for C. In contrast to that, on the same page if you look for "isnan", they explicitly state that it implements the macros defined in C99, so I thought it would be fair to implement them in goblint)

@FelixKrayer
Copy link
Copy Markdown
Collaborator Author

Damn windows always causing problems... We can see, if we can fix the problem with base.ml later before we merge, I think...

The problem from a reviewer perspective is, that i have no idea what you actually changed in base.ml

ok, I will try to fix it

@FelixKrayer
Copy link
Copy Markdown
Collaborator Author

FelixKrayer commented Jun 11, 2022

Damn windows always causing problems... We can see, if we can fix the problem with base.ml later before we merge, I think...

The problem from a reviewer perspective is, that I have no idea what you actually changed in base.ml

ok, I will try to fix it

I am sorry, I can't do it right now...
If you want to have a look at it @Dudeldu , the only things I changed, is adding the following lines (line numbers are from the changed file)

@FelixKrayer
Copy link
Copy Markdown
Collaborator Author

Thank you so much for the cleanup

@FelixKrayer FelixKrayer changed the title Implementations for Library Functions WIP Implementations for Library Functions Jun 11, 2022
@FelixKrayer FelixKrayer mentioned this pull request Jun 12, 2022
@FelixKrayer FelixKrayer force-pushed the libFuns branch 2 times, most recently from bb1a7b4 to 813fee0 Compare June 15, 2022 14:01
@FelixKrayer FelixKrayer force-pushed the libFuns branch 2 times, most recently from aff6d8d to 0041432 Compare June 23, 2022 11:19
@FelixKrayer FelixKrayer changed the title WIP Implementations for Library Functions Implementation of trigonometric functions Jun 27, 2022
@FelixKrayer FelixKrayer requested review from Dudeldu and brgr June 27, 2022 17:11
Dudeldu
Dudeldu previously approved these changes Jun 28, 2022
Copy link
Copy Markdown
Owner

@Dudeldu Dudeldu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, only three very small style-related notes where you have to decide whether they make sense.

Dudeldu
Dudeldu previously approved these changes Jun 28, 2022
brgr
brgr previously approved these changes Jun 29, 2022
Copy link
Copy Markdown
Collaborator

@brgr brgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to change FloatMessage to Float now for the warnings, but I think then it should be able to be merged again.

Besides that all looks great :)

@FelixKrayer FelixKrayer dismissed stale reviews from brgr and Dudeldu via 9daccb7 June 29, 2022 15:58
@FelixKrayer
Copy link
Copy Markdown
Collaborator Author

rebased and fixed FloatMessage

@FelixKrayer FelixKrayer merged commit 4935261 into master Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants