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

jets: for new atom ops #627

Open
wants to merge 9 commits into
base: next/kelvin/410
Choose a base branch
from
Open

jets: for new atom ops #627

wants to merge 9 commits into from

Conversation

joemfb
Copy link
Member

@joemfb joemfb commented Apr 10, 2024

Adds jets for the operations in urbit/urbit#6961, to support urbit/urbit#6932.

@joemfb joemfb requested a review from a team as a code owner April 10, 2024 03:22
Comment on lines 54 to 58
static c3_w
_ch_popcount(c3_w num_w)
{
return __builtin_popcount(num_w);
return c3_pc_w(num_w);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just remove this function entirely, if it only calls an alias to a built-in?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was just minimizing the diff, but it'd be better to refactor and this is probably a fine place to do so.

pkg/noun/jets/tree.c Show resolved Hide resolved
pkg/noun/jets/q.h Show resolved Hide resolved
wor_w &= (1 << bit_w) - 1;

if ( wor_w ) {
return bit_w - (32 - c3_lz_w(wor_w));
Copy link
Contributor

Choose a reason for hiding this comment

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

They come out to the same thing, but I think the relationship is a lot clearer when expressed as:

[# leading 0s] - (32 - [# bits])

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