diff options
| author | merry <MerryMage@users.noreply.github.com> | 2020-06-05 11:58:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-05 20:58:27 +1000 |
| commit | f8cd072b62808c8da06549807cc263003f0049b7 (patch) | |
| tree | 630749551fb53adc3687edd63945361292f93927 /ARMeilleure/Optimizations.cs | |
| parent | bcb7761eacaf9e40cc506648fec1eed58c23eff0 (diff) | |
Faster crc32 implementation (#1294)
* Add Pclmulqdq intrinsic
* Implement crc32 in terms of pclmulqdq
* Address PR comments
Diffstat (limited to 'ARMeilleure/Optimizations.cs')
| -rw-r--r-- | ARMeilleure/Optimizations.cs | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/ARMeilleure/Optimizations.cs b/ARMeilleure/Optimizations.cs index b486c5d2..fa06a410 100644 --- a/ARMeilleure/Optimizations.cs +++ b/ARMeilleure/Optimizations.cs @@ -8,15 +8,16 @@ namespace ARMeilleure public static bool FastFP { get; set; } = true; - public static bool UseSseIfAvailable { get; set; } = true; - public static bool UseSse2IfAvailable { get; set; } = true; - public static bool UseSse3IfAvailable { get; set; } = true; - public static bool UseSsse3IfAvailable { get; set; } = true; - public static bool UseSse41IfAvailable { get; set; } = true; - public static bool UseSse42IfAvailable { get; set; } = true; - public static bool UsePopCntIfAvailable { get; set; } = true; - public static bool UseAvxIfAvailable { get; set; } = true; - public static bool UseAesniIfAvailable { get; set; } = true; + public static bool UseSseIfAvailable { get; set; } = true; + public static bool UseSse2IfAvailable { get; set; } = true; + public static bool UseSse3IfAvailable { get; set; } = true; + public static bool UseSsse3IfAvailable { get; set; } = true; + public static bool UseSse41IfAvailable { get; set; } = true; + public static bool UseSse42IfAvailable { get; set; } = true; + public static bool UsePopCntIfAvailable { get; set; } = true; + public static bool UseAvxIfAvailable { get; set; } = true; + public static bool UseAesniIfAvailable { get; set; } = true; + public static bool UsePclmulqdqIfAvailable { get; set; } = true; public static bool ForceLegacySse { @@ -24,14 +25,15 @@ namespace ARMeilleure set => HardwareCapabilities.ForceLegacySse = value; } - internal static bool UseSse => UseSseIfAvailable && HardwareCapabilities.SupportsSse; - internal static bool UseSse2 => UseSse2IfAvailable && HardwareCapabilities.SupportsSse2; - internal static bool UseSse3 => UseSse3IfAvailable && HardwareCapabilities.SupportsSse3; - internal static bool UseSsse3 => UseSsse3IfAvailable && HardwareCapabilities.SupportsSsse3; - internal static bool UseSse41 => UseSse41IfAvailable && HardwareCapabilities.SupportsSse41; - internal static bool UseSse42 => UseSse42IfAvailable && HardwareCapabilities.SupportsSse42; - internal static bool UsePopCnt => UsePopCntIfAvailable && HardwareCapabilities.SupportsPopcnt; - internal static bool UseAvx => UseAvxIfAvailable && HardwareCapabilities.SupportsAvx && !ForceLegacySse; - internal static bool UseAesni => UseAesniIfAvailable && HardwareCapabilities.SupportsAesni; + internal static bool UseSse => UseSseIfAvailable && HardwareCapabilities.SupportsSse; + internal static bool UseSse2 => UseSse2IfAvailable && HardwareCapabilities.SupportsSse2; + internal static bool UseSse3 => UseSse3IfAvailable && HardwareCapabilities.SupportsSse3; + internal static bool UseSsse3 => UseSsse3IfAvailable && HardwareCapabilities.SupportsSsse3; + internal static bool UseSse41 => UseSse41IfAvailable && HardwareCapabilities.SupportsSse41; + internal static bool UseSse42 => UseSse42IfAvailable && HardwareCapabilities.SupportsSse42; + internal static bool UsePopCnt => UsePopCntIfAvailable && HardwareCapabilities.SupportsPopcnt; + internal static bool UseAvx => UseAvxIfAvailable && HardwareCapabilities.SupportsAvx && !ForceLegacySse; + internal static bool UseAesni => UseAesniIfAvailable && HardwareCapabilities.SupportsAesni; + internal static bool UsePclmulqdq => UsePclmulqdqIfAvailable && HardwareCapabilities.SupportsPclmulqdq; } }
\ No newline at end of file |
