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

Remove packing for bools. #5449

Merged
merged 7 commits into from
Dec 3, 2024
Merged

Remove packing for bools. #5449

merged 7 commits into from
Dec 3, 2024

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented Nov 8, 2024

Overview

On trunk, primitive operations return a 'tag', then we run a separate branch instruction which returns the equivalent Unison bool datatype.

This change alters primitive ops which return bools to simply put the correct unison bool directly onto the stack, saving an instruction on each boolean op.

Implementation notes

  • Alter primitive ops to push bools directly to the stack
  • Add some missing instructions to avoid the need for multiple instructions, e.g. NEQN instead of EQLN >>> NOTB
  • Remove all the now-unnecessary branches.

Test coverage

Existing transcripts

@ChrisPenner ChrisPenner changed the base branch from trunk to cp/more-instructions November 8, 2024 23:16
@ChrisPenner ChrisPenner marked this pull request as ready for review November 20, 2024 16:41
Base automatically changed from cp/more-instructions to trunk December 3, 2024 17:24
@aryairani aryairani merged commit d0b3720 into trunk Dec 3, 2024
48 checks passed
@aryairani aryairani deleted the cp/better-bools branch December 3, 2024 17:36
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.

3 participants