Zero out bits 63:32 of scalar float operations with SSE intrinsics (#273)
This commit is contained in:
@ -9,6 +9,18 @@ namespace ChocolArm64.Instruction
|
||||
{
|
||||
static class AVectorHelper
|
||||
{
|
||||
private static readonly Vector128<float> Zero32_128Mask;
|
||||
|
||||
static AVectorHelper()
|
||||
{
|
||||
if (!Sse2.IsSupported)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
Zero32_128Mask = Sse.StaticCast<uint, float>(Sse2.SetVector128(0, 0, 0, 0xffffffff));
|
||||
}
|
||||
|
||||
public static void EmitCall(AILEmitterCtx Context, string Name64, string Name128)
|
||||
{
|
||||
bool IsSimd64 = Context.CurrOp.RegisterSize == ARegisterSize.SIMD64;
|
||||
@ -448,6 +460,17 @@ namespace ChocolArm64.Instruction
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector128<float> VectorZero32_128(Vector128<float> Vector)
|
||||
{
|
||||
if (Sse.IsSupported)
|
||||
{
|
||||
return Sse.And(Vector, Zero32_128Mask);
|
||||
}
|
||||
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector128<sbyte> VectorSingleToSByte(Vector128<float> Vector)
|
||||
{
|
||||
|
Reference in New Issue
Block a user