wide icon indicating copy to clipboard operation
wide copied to clipboard

Adding replace and extract methods

Open ImUrX opened this issue 3 years ago • 7 comments

Seems like a fine addition to the library, I been using a lot of my time in here even though stdsimd/portable-simd will happen someday lol. Do you have any recommendations on how to do it on the x86 arch?

ImUrX avatar Aug 05 '21 17:08 ImUrX

I think x86 only supports this with i16 actually :(

Lokathor avatar Aug 05 '21 17:08 Lokathor

sad :(, wasm supports all of them so i think the only way on sse is to cast it 2 times? Dont know how efficient the code will be after getting compiled

ImUrX avatar Aug 05 '21 18:08 ImUrX

It would probably be a significant hiccup in the processing speed of any function.

Lokathor avatar Aug 05 '21 18:08 Lokathor

is there any way to get the 2 v128 in i64x4 from outside the lib?

ImUrX avatar Aug 05 '21 22:08 ImUrX

you could use bytemuck to cast the simd value to an array of scalar values.

Lokathor avatar Aug 08 '21 21:08 Lokathor

I believe v128 isn't actually supported by bytemuck yet, maybe I should create a PR. (Of course you can always manually impl it on a newtype though)

CryZe avatar Aug 08 '21 21:08 CryZe

oh v not u.

yeah bytemuck would need a patch to support that

Lokathor avatar Aug 08 '21 21:08 Lokathor