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

Introduce intrinsics for VM operations. #855

Closed
otrho opened this issue Mar 1, 2022 · 4 comments
Closed

Introduce intrinsics for VM operations. #855

otrho opened this issue Mar 1, 2022 · 4 comments
Assignees
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged enhancement New feature or request language feature Core language features visible to end users Needs RFC Features that require an RFC before proceeding with an implementation P: high Should be looked at if there are no critical issues left

Comments

@otrho
Copy link
Contributor

otrho commented Mar 1, 2022

See #1074

ASM blocks are very hard to optimise for and are generally error prone, as they are untyped and the author often needs to make assumptions about the compiler code generation. In an effort to minimise the need for ASM blocks in the standard library we can make compiler intrinsics which wrap useful VM opcodes such as MCP & MEQ or BAL & BURN, etc.

@adlerjohn adlerjohn added compiler General compiler. Should eventually become more specific as the issue is triaged enhancement New feature or request labels Mar 1, 2022
@mohammadfawaz
Copy link
Contributor

Relevant links:
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Other-Builtins.html#Other-Builtins
https://en.wikipedia.org/wiki/Intrinsic_function

@mohammadfawaz mohammadfawaz added the language feature Core language features visible to end users label Mar 15, 2022
@mohammadfawaz
Copy link
Contributor

We can basically have them all start with __builtin like C/C++ to minimize collision and make it clear that they are an advanced feature.

@mohammadfawaz mohammadfawaz added the P: high Should be looked at if there are no critical issues left label Apr 5, 2022
@vaivaswatha vaivaswatha self-assigned this Jun 15, 2022
@mohammadfawaz mohammadfawaz added the Needs RFC Features that require an RFC before proceeding with an implementation label Jun 27, 2022
@mohammadfawaz
Copy link
Contributor

@vaivaswatha now that #2100 is close to be merged and we have a prototype of how these things can look like, maybe it's a good time to step back a bit and write up an RFC for the full feature and its implementation. This serves multiple purposes:

  1. Thinking through the big picture and the scope of this project: what intrinsics do we want to support, What IR instructions do we need to add, Interactions with the different data types, Testing plan, etc.
  2. Document all the intrinsics in one place (addresses the last point in Introduce __eq intrinsic #2100 (comment))
  3. Uncover any overlooked issues in the existing implementation (hopefully there are none!)
  4. Lay out the benefits of this project in terms of type checking and future optimizations.

@otrho
Copy link
Contributor Author

otrho commented Sep 30, 2022

We have intrinsics and an RFC now.

@otrho otrho closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged enhancement New feature or request language feature Core language features visible to end users Needs RFC Features that require an RFC before proceeding with an implementation P: high Should be looked at if there are no critical issues left
Projects
Status: Done
Development

No branches or pull requests

4 participants