-
Notifications
You must be signed in to change notification settings - Fork 1
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
rewriter: add hardcoded call gate post condition call with no args #470
Conversation
For the args, @ayrtonm and I decided we should push the caller args onto the stack at the beginning (only the 6 args in registers for now) and then pop them back into the 6 registers to call the post condition function. So for now it'll be limited to up to 6 args. Once we have that working, we'll work on also passing the target function return value as an argument as well, and more than 6 args. |
To add some other notes from our talk
|
@ayrtonm, can I merge this and split my stuff into smaller PRs? Next PR will do the 6 register args, which I'm working on now. |
Maybe just do a single PR where the commits can be reviewed individually |
8a8db26
to
94bbdb3
Compare
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 after adding an option to enable/disable the post-validation codegen.
For now, the name of the post condition checking function is `${target_name}_post_condition`, and it's hardcoded to only emit for `dav1d_get_picture`.
Even with no arguments, the stack is not 16-byte aligned, so we `sub 8` to align it.
94bbdb3
to
82a087d
Compare
…by default We still want to be able to run the rewriter on `dav1d` normally without post conditions while this is still a WIP. Or on Arm, where IA2 still lacks support for post conditions.
For now, the name of the post condition checking function is
${target_name}_post_condition
, and it's hardcoded to only emit fordav1d_get_picture
.dav1d
Call Gate Verification Discussion #465.I'm not sure how to call the function with arguments, though. I was imagining the API be that the post condition function have the same arguments as the target function and avoid
return type.It also takes 0 args for now. Later PRs will progressively add args.