-
Notifications
You must be signed in to change notification settings - Fork 967
Define intrinsic functions #2920
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Failure is due to the definition of the
|
This changes the compiler from treating calls to sync/atomic.* functions as special calls (emitted directly at the call site) to actually defining their declarations when there is no Go SSA implementation. And rely on the inliner to inline these very small functions. This works a bit better in practice. For example, this makes it possible to use these functions in deferred function calls. This commit is a bit large because it also needs to refactor a few things to make it possible to define such intrinsic functions.
This makes them available to deferred calls, among others.
This makes it possible to //go:linkname them from other places, like in the reflect package. And is in my opinion a much cleaner solution.
47d487b
to
c425be0
Compare
Thank you for debugging! This should be fixed now. |
Reran the tinyhci checks -- they're passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Instead of changing the calls, replace the function bodies themselves. This is useful for a number of reasons, see #2920 for more information. I have removed the math intrinsics tests because they are no longer useful. Instead, I think `tinygo test math` should suffice.
Instead of changing the calls, replace the function bodies themselves. This is useful for a number of reasons, see #2920 for more information. I have removed the math intrinsics tests because they are no longer useful. Instead, I think `tinygo test math` should suffice.
Instead of changing the calls, replace the function bodies themselves. This is useful for a number of reasons, see #2920 for more information. I have removed the math intrinsics tests because they are no longer useful. Instead, I think `tinygo test math` should suffice.
Instead of changing the calls, replace the function bodies themselves. This is useful for a number of reasons, see #2920 for more information. I have removed the math intrinsics tests because they are no longer useful. Instead, I think `tinygo test math` should suffice.
Instead of changing the calls, replace the function bodies themselves. This is useful for a number of reasons, see #2920 for more information. I have removed the math intrinsics tests because they are no longer useful. Instead, I think `tinygo test math` should suffice.
Instead of changing the calls, replace the function bodies themselves. This is useful for a number of reasons, see #2920 for more information. I have removed the math intrinsics tests because they are no longer useful. Instead, I think `tinygo test math` should suffice.
This fixes #2652 by implementing various compiler intrinsics as real functions. Also see #2821 (comment) and #2805.
I think it makes sense to move a few more functions over if possible, like the system call functions and
runtime.supportsRecover
. But this can be done at a later time.