MLAS: enable SSE 4.1 path for x86 build (#8127)

This commit is contained in:
Tracy Sharpe 2021-06-23 09:38:58 -07:00 committed by GitHub
parent 45ce239929
commit cbdd59dae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View file

@ -704,6 +704,8 @@ struct MLAS_PLATFORM {
#if defined(MLAS_TARGET_AMD64_IX86)
MLAS_GEMM_FLOAT_KERNEL* GemmFloatKernel;
const MLAS_GEMM_U8X8_DISPATCH* GemmU8S8Dispatch;
const MLAS_GEMM_U8X8_DISPATCH* GemmU8U8Dispatch;
#endif
#if defined(MLAS_TARGET_AMD64)
@ -711,10 +713,8 @@ struct MLAS_PLATFORM {
MLAS_SGEMM_KERNEL_M1_ROUTINE* KernelM1TransposeBRoutine;
MLAS_SGEMM_TRANSPOSE_PACKB_BLOCK_ROUTINE* TransposePackB16x4Routine;
MLAS_GEMM_DOUBLE_KERNEL* GemmDoubleKernel;
const MLAS_GEMM_U8X8_DISPATCH* GemmU8S8Dispatch;
MLAS_GEMM_U8S8_KERNEL* GemmU8S8Kernel;
MLAS_GEMV_U8S8_KERNEL* GemvU8S8Kernel;
const MLAS_GEMM_U8X8_DISPATCH* GemmU8U8Dispatch;
MLAS_GEMM_U8U8_KERNEL* GemmU8U8Kernel;
MLAS_CONV_FLOAT_KERNEL* ConvNchwFloatKernel;
MLAS_CONV_FLOAT_KERNEL* ConvNchwcFloatKernel;

View file

@ -126,13 +126,13 @@ Return Value:
//
this->GemmFloatKernel = MlasGemmFloatKernelSse;
this->GemmU8S8Dispatch = &MlasGemmU8X8DispatchSse;
this->GemmU8U8Dispatch = &MlasGemmU8X8DispatchSse;
#if defined(MLAS_TARGET_AMD64)
this->TransposePackB16x4Routine = MlasSgemmTransposePackB16x4Sse;
this->GemmDoubleKernel = MlasGemmDoubleKernelSse;
this->GemmU8S8Dispatch = &MlasGemmU8X8DispatchSse;
this->GemmU8U8Dispatch = &MlasGemmU8X8DispatchSse;
this->ConvNchwFloatKernel = MlasConvNchwFloatKernelSse;
this->ConvNchwcFloatKernel = MlasConvNchwcFloatKernelSse;
this->ConvDepthwiseFloatKernel = MlasConvDepthwiseFloatKernelSse;
@ -170,7 +170,7 @@ Return Value:
__cpuid(1, Cpuid1[0], Cpuid1[1], Cpuid1[2], Cpuid1[3]);
#endif
#if defined(MLAS_TARGET_AMD64) && defined(_MSC_VER)
#if defined(_MSC_VER)
//
// Check if the processor supports SSE 4.1 instructions.

View file

@ -61,14 +61,12 @@ MlasGemmU8X8GetDispatch(
MLAS_UNREFERENCED_PARAMETER(BIsSigned);
#if defined(MLAS_TARGET_AMD64)
#if defined(MLAS_TARGET_AMD64_IX86)
if (BIsSigned) {
GemmU8X8Dispatch = MlasPlatform.GemmU8S8Dispatch;
} else {
GemmU8X8Dispatch = MlasPlatform.GemmU8U8Dispatch;
}
#elif defined(MLAS_SSE2_INTRINSICS)
GemmU8X8Dispatch = &MlasGemmU8X8DispatchSse;
#elif defined(MLAS_NEON64_INTRINSICS)
GemmU8X8Dispatch = MlasPlatform.GemmU8X8Dispatch;
#elif defined(MLAS_NEON32_INTRINSICS) && !defined(_MSC_VER)