Skip to content

Conversation

kroening
Copy link
Collaborator

@kroening kroening commented Sep 5, 2024

Relations are special-cased in 1800-2017 11.8.2.

If both operands are signed, both are sign-extended to the max width.

Otherwise, both are zero-extended to the max width. In particular, signed operands are then not sign extended, which a typecast would do.

@kroening kroening force-pushed the typecheck_relation branch 3 times, most recently from 039ecf4 to 2575d4f Compare September 6, 2024 21:08
Relations are special-cased in 1800-2017 11.8.2.

If both operands are signed, both are sign-extended to the max width.

Otherwise, both are zero-extended to the max width.  In particular, signed
operands are then _not_ sign extended, which a typecast would do.
@kroening kroening marked this pull request as ready for review September 6, 2024 21:11
@tautschnig tautschnig merged commit 2e283cc into main Sep 9, 2024
8 checks passed
@tautschnig tautschnig deleted the typecheck_relation branch September 9, 2024 21:03
Romy15200 pushed a commit to Romy15200/nws that referenced this pull request Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants