wide icon indicating copy to clipboard operation
wide copied to clipboard

u16x16

Open RazrFalcon opened this issue 4 years ago • 7 comments

This one fits into 256bits, so it can be implemented via AVX.

RazrFalcon avatar Sep 12 '20 11:09 RazrFalcon

256-bit support has taken a back seat compared to 128-bit types simply for lack of time to do everything at once, but this would be welcomed as a PR.

Lokathor avatar Sep 12 '20 14:09 Lokathor

@RazrFalcon I might be able to do this, but where is something like this useful? I'm genuinely curious.

ronniec95 avatar Sep 14 '20 15:09 ronniec95

@ronniec95 I'm using it in my Skia port: https://github.com/RazrFalcon/tiny-skia/tree/master/src/wide

Right now, I have only a scalar implementation. And I would like to replace the custom SIMD implementation with an existing one, like this crate.

RazrFalcon avatar Sep 14 '20 19:09 RazrFalcon

I had a little look at this but was puzzled that the unsigned types seem to use signed add instructions: add_i16_m128i - I can see there's saturating unsigned adds we could use: _mm_adds_epu16. Is it that add_i16_m128i works for both? If so why do they have signed / unsigned in their naming?

gilescope avatar Jun 25 '21 08:06 gilescope

for wrapping addition, which is what the integer types in wide use, signed and unsigned uses the same bit manipulation, and thus the same hardware instruction.

Lokathor avatar Jun 25 '21 12:06 Lokathor

Ah this should not have been closed as this one is not yet implemented.

gilescope avatar Jul 20 '21 06:07 gilescope

oops!

Lokathor avatar Jul 20 '21 12:07 Lokathor