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

from1.0: fix signed register type #3117

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

vhavel
Copy link

@vhavel vhavel commented Mar 9, 2022

Signed p4_14 Register is currently incorrectly translated into unsigned p4_16 Register due to missing signedness handling.

@vhavel vhavel marked this pull request as ready for review March 9, 2022 09:38
@mihaibudiu
Copy link
Contributor

Can you add a test too?

@vhavel vhavel force-pushed the vh/fix_fromv1_register_sign branch from cd30bbb to a2365cd Compare March 9, 2022 16:20
@vhavel
Copy link
Author

vhavel commented Mar 9, 2022

Thanks. Test added, before this change p4c fails on this p4 program with

 register_signed.p4(50): Type of argument 'meta.meta.register_tmp' (int<32>) does not match type of parameter 'result' (bit<32>).

@vhavel vhavel force-pushed the vh/fix_fromv1_register_sign branch from a2365cd to 445daf6 Compare March 9, 2022 22:04
@mihaibudiu mihaibudiu merged commit a6b9aad into p4lang:main Mar 10, 2022
@vhavel vhavel deleted the vh/fix_fromv1_register_sign branch March 10, 2022 09:39
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.

2 participants