Skip to content

Commit

Permalink
Implement the remaining BMI1/2 intrinsic (dotnet/coreclr#21480)
Browse files Browse the repository at this point in the history
* Add tests for BMI1/2 intrinsic

* Implement the remaining BMI1/2 intrinsic

* Fix emitDispIns for BMI instruction

Signed-off-by: dotnet-bot <[email protected]>
  • Loading branch information
FeiPengIntel authored and dotnet-bot committed Dec 22, 2018
1 parent dd01a42 commit f10130e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal X64() { }
/// BEXTR r64a, reg/m64, r64b
/// This intrinisc is only available on 64-bit processes
/// </summary>
public static ulong BitFieldExtract(ulong value, byte start, byte length) => BitFieldExtract(value, start, length);
public static ulong BitFieldExtract(ulong value, byte start, byte length) => BitFieldExtract(value, (ushort)(start | (length << 8)));

/// <summary>
/// unsigned __int64 _bextr2_u64 (unsigned __int64 a, unsigned __int64 control)
Expand Down Expand Up @@ -83,7 +83,7 @@ internal X64() { }
/// unsigned int _bextr_u32 (unsigned int a, unsigned int start, unsigned int len)
/// BEXTR r32a, reg/m32, r32b
/// </summary>
public static uint BitFieldExtract(uint value, byte start, byte length) => BitFieldExtract(value, start, length);
public static uint BitFieldExtract(uint value, byte start, byte length) => BitFieldExtract(value, (ushort)(start | (length << 8)));

/// <summary>
/// unsigned int _bextr2_u32 (unsigned int a, unsigned int control)
Expand Down

0 comments on commit f10130e

Please sign in to comment.