Skip to content

jets: for new atom ops#627

Merged
pkova merged 9 commits into
developfrom
jb/new-atom-jets
Oct 22, 2024
Merged

jets: for new atom ops#627
pkova merged 9 commits into
developfrom
jb/new-atom-jets

Conversation

@joemfb

@joemfb joemfb commented Apr 10, 2024

Copy link
Copy Markdown
Collaborator

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 thread pkg/noun/hashtable.c
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
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator 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.

Comment thread pkg/noun/jets/tree.c
Comment thread pkg/noun/jets/q.h
Comment thread pkg/noun/jets/c/clz.c
wor_w &= (1 << bit_w) - 1;

if ( wor_w ) {
return bit_w - (32 - c3_lz_w(wor_w));

Copy link
Copy Markdown
Collaborator

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])

Base automatically changed from next/kelvin/410 to develop October 22, 2024 13:12
@pkova pkova merged commit 3cbc3b8 into develop Oct 22, 2024
@pkova pkova deleted the jb/new-atom-jets branch October 22, 2024 13:12
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