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

Wint2 #1071

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Wint2 #1071

wants to merge 19 commits into from

Conversation

bgregoir
Copy link
Contributor

This PR introduce new types in jasmin source: siXX and uiXX.
For the compiler they are equal to wXX.
It also introduce the operator word_to_sint and word_to_uint
(int) w : is word_to_uint (for compatibility)
(uint) w : is word_to_uint
(sint) w : is word_to_sint ( NEW)
(XXsi) w : cast from wXX to siXX
(XXsi) si : cast from siYY to siXX
(XXsi) i : cast from int to sint
Same with XXui
(int) si | (sint) si : cast from siXX to int
(int) ui | (uint) si : cast from uiXX to int

New notation for uXX : wXX is not accepted and used for printing
Compilation starts by replacing all operations on siXX uiXX by corresponding wXX operations.
Extraction starts by replacing all operations on siXX uiXX by corresponding int operations.

@bgregoir bgregoir marked this pull request as draft February 28, 2025 05:47
@bgregoir bgregoir force-pushed the wint2 branch 2 times, most recently from 0e25d51 to 782d51c Compare February 28, 2025 12:05
@bgregoir bgregoir marked this pull request as ready for review February 28, 2025 15:53
Comment on lines +32 to +36
| WIword_of_int of wsize (* int → word *)
| WIint_of_word of wsize (* word/uint/sint → int, signed or unsigned interpretation *)
| WIword_of_wint of wsize (* uint/sint -> word *)
| WIwint_of_word of wsize (* word -> uint/sint *)
| WIword_ext of wsize & wsize (* Sign-extension: output-size, input-size *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| WIword_of_int of wsize (* int → word *)
| WIint_of_word of wsize (* word/uint/sint → int, signed or unsigned interpretation *)
| WIword_of_wint of wsize (* uint/sint -> word *)
| WIwint_of_word of wsize (* word -> uint/sint *)
| WIword_ext of wsize & wsize (* Sign-extension: output-size, input-size *)
| WIwint_of_int of wsize (* int → word *)
| WIint_of_wint of wsize (* word/uint/sint → int, signed or unsigned interpretation *)
| WIword_of_wint of wsize (* uint/sint -> word *)
| WIwint_of_word of wsize (* word -> uint/sint *)
| WIwint_ext of wsize & wsize (* Sign-extension: output-size, input-size *)

(note to self)

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