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

Document FunC calling convention #782

Open
anton-trunov opened this issue Oct 3, 2024 · 1 comment
Open

Document FunC calling convention #782

anton-trunov opened this issue Oct 3, 2024 · 1 comment

Comments

@anton-trunov
Copy link

Is your feature request related to a problem? Please describe.

I believe the calling convention is not documented for FunC, which makes unclear how to write asm-functions, because assembly instructions expect certain TVM stack configurations (the order) which is important for multi-argument instructions.

Describe the solution you'd like

Document the order of function arguments and return values for tensor types.

Additional context

No response

@anton-trunov
Copy link
Author

anton-trunov commented Oct 3, 2024

As far as I understand, FunC pushes function arguments in the order of function parameters declaration, so the stack order is reversed, i.e. for a function like the following one

int bin(int x, int y) { return y - x; }

the y is argument will be at the top of the TVM stack.

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

No branches or pull requests

1 participant