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

wazevo: adds bit count instructions clz, ctz #1635

Merged
merged 3 commits into from
Aug 18, 2023
Merged

wazevo: adds bit count instructions clz, ctz #1635

merged 3 commits into from
Aug 18, 2023

Conversation

evacchi
Copy link
Contributor

@evacchi evacchi commented Aug 17, 2023

Continues #1496.

This introduces the front-end and back-end for clz, ctz (in terms of rbit+clz).

It originally also introduced popcnt for the front-end, but this requires
VCNT in the backend, which is probably worth its own separate PR.

Contextually, this also introduces a partial implementation for bitRR.

First PR to wazevo, so I am not entirely sure that the generated
code for the SSA and the backend is correct, let me know if there are errors,
I am really figuring out a lot of stuff, including the framework :)

Signed-off-by: Edoardo Vacchi [email protected]

@evacchi
Copy link
Contributor Author

evacchi commented Aug 17, 2023

Although I am not sure about its correctness, this PR may be a good starting point if you haven't dug into wazevo yet since it is really tiny @ncruces

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

Good start!

internal/engine/wazevo/backend/isa/arm64/instr.go Outdated Show resolved Hide resolved
internal/engine/wazevo/ssa/instructions.go Outdated Show resolved Hide resolved
internal/engine/wazevo/backend/isa/arm64/instr_encoding.go Outdated Show resolved Hide resolved
@mathetake
Copy link
Member

mathetake commented Aug 18, 2023

Next time let's add reference to issue #1496 in the PR description

Signed-off-by: Edoardo Vacchi <[email protected]>
@evacchi evacchi changed the title wazevo: add bit count instructions clz, ctz wazevo: adds bit count instructions clz, ctz Aug 18, 2023
Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

👍

internal/engine/wazevo/backend/isa/arm64/instr.go Outdated Show resolved Hide resolved
internal/engine/wazevo/backend/isa/arm64/instr.go Outdated Show resolved Hide resolved
Signed-off-by: Edoardo Vacchi <[email protected]>
@evacchi evacchi merged commit eb11a2c into main Aug 18, 2023
53 checks passed
@evacchi evacchi deleted the bitcount-instrs branch August 18, 2023 09:18
Copy link
Collaborator

@ncruces ncruces left a comment

Choose a reason for hiding this comment

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

👍

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