Skip to content

Implement i8x16.popcnt#3286

Merged
tlively merged 1 commit intoWebAssembly:masterfrom
tlively:simd-popcnt
Oct 27, 2020
Merged

Implement i8x16.popcnt#3286
tlively merged 1 commit intoWebAssembly:masterfrom
tlively:simd-popcnt

Conversation

@tlively
Copy link
Member

@tlively tlively commented Oct 27, 2020

As proposed in WebAssembly/simd#379. Since this
instruction is still being evaluated for inclusion in the SIMD proposal, this PR
does not add support for it to the C/JS APIs or to the fuzzer. This PR also
performs a drive-by fix for unrelated instructions in c-api-kitchen-sink.c

As proposed in WebAssembly/simd#379. Since this
instruction is still being evaluated for inclusion in the SIMD proposal, this PR
does not add support for it to the C/JS APIs or to the fuzzer. This PR also
performs a drive-by fix for unrelated instructions in c-api-kitchen-sink.c
@tlively tlively requested a review from kripken October 27, 2020 00:10
return unary<16, &Literal::getLanesUI8x16, &Literal::neg>(*this);
}
Literal Literal::popcntI8x16() const {
return unary<16, &Literal::getLanesUI8x16, &Literal::popCount>(*this);
Copy link
Member

Choose a reason for hiding this comment

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

Is each lane signed or unsigned? The LLVM builtin says it's signed though

Copy link
Member Author

Choose a reason for hiding this comment

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

Signedness doesn't really make a difference for popcnt since it doesn't interpret the bits as a number. However, it's important to use the unsigned lane extraction function here because it will zero-extend each lane. If we instead used the signed lane extraction function, it would sign-extend each lane which could change the population counts.

@tlively tlively merged commit ca16f7c into WebAssembly:master Oct 27, 2020
@tlively tlively deleted the simd-popcnt branch October 27, 2020 15:58
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