private static ArrayBitwiseOperationDelegateReturner <T> GetBitwiseOperationDelegate <T>(SIMDVectorType vectorType) where T : unmanaged { switch (vectorType) { case SIMDVectorType.Vector128: return(GetBitwiseOperationDelegateVector128 <T>); case SIMDVectorType.Vector256: return(GetBitwiseOperationDelegateVector256 <T>); } return(null); }
private static bool PerformBitwiseOperationCustomType <T>(T *origin, T *target, T mask, uint length, BitwiseOperation operation, SIMDVectorType vectorType) where T : unmanaged { switch (sizeof(T)) { case sizeof(byte): case sizeof(short): case sizeof(int): case sizeof(long): // Okay this is kinda ridiculous return(GetBitwiseOperationDelegateReturner <T>(vectorType)(operation)(origin, target, mask, length)); } // TODO: Support types with different sizes too return(false); }