BitFields icon indicating copy to clipboard operation
BitFields copied to clipboard

memo: BitManipulation class

Open ufcpp opened this issue 8 years ago • 5 comments

https://github.com/dotnet/corefx/issues/12425

BEXTR UBFX

ufcpp avatar May 10 '17 02:05 ufcpp

I see that class (it it will ever implemented) as the "backend" of this BitField class as you can see with the examples I've posted here: https://github.com/dotnet/corefxlab/issues/1085#issuecomment-272172817 it will become really complex when you have to use it for more that one bit!

fanoI avatar May 15 '17 08:05 fanoI

The most important fact in the corefx#12425 is:

ReadByte/ReadInt16/ReadInt32 => BEXTR (possibly)

I want to use the BEXTR instruction which executes (src >> start) & ((1 << len)-1) in a single instruction.

ufcpp avatar May 15 '17 13:05 ufcpp

Well but the generation of these ASM instruction should be AOT / JIT intrisics that probably that BitManipulation class will generate in future or your idea is to P/Invoke in Assembler in our library already?

fanoI avatar May 15 '17 15:05 fanoI

This is just a memo. I guess these methods might be done by JIT intrinsics like System.Numerics.Vectors. I will use them if and only if the JIT-intrinsic version is released.

ufcpp avatar May 16 '17 00:05 ufcpp

https://dotnet.myget.org/feed/dotnet-core/package/nuget/System.Runtime.Intrinsics.X86

ufcpp avatar Nov 06 '17 14:11 ufcpp