ippcpsgx_disp00399.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "ippcp.h"
  2. #define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg
  3. #ifndef NULL
  4. #ifdef __cplusplus
  5. #define NULL 0
  6. #else
  7. #define NULL ((void *)0)
  8. #endif
  9. #endif
  10. #if defined (_M_AMD64) || defined (__x86_64__)
  11. #define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ )
  12. #define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER )
  13. IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom3,(void) )
  14. IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom3,(void) )
  15. IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom3,(void) )
  16. {
  17. Ipp64u features;
  18. ippcpGetCpuFeatures( &features );
  19. if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { /* HasweLl ia32=H9, x64=L9 */
  20. return l9_ippsGFpxMethod_binom3( );
  21. } else
  22. if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { /* Nehalem or Westmer = PenrYn + SSE42 + ?CLMUL + ?AES + ?SHA */
  23. return y8_ippsGFpxMethod_binom3( );
  24. } else
  25. return NULL;
  26. }
  27. #else
  28. IPPAPI( const IppsGFpMethod*, p8_ippsGFpxMethod_binom3,(void) )
  29. IPPAPI( const IppsGFpMethod*, h9_ippsGFpxMethod_binom3,(void) )
  30. IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom3,(void) )
  31. {
  32. Ipp64u features;
  33. ippcpGetCpuFeatures( &features );
  34. if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { /* HasweLl ia32=H9, x64=L9 */
  35. return h9_ippsGFpxMethod_binom3( );
  36. } else
  37. if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { /* Nehalem or Westmer = PenrYn + SSE42 + ?CLMUL + ?AES + ?SHA */
  38. return p8_ippsGFpxMethod_binom3( );
  39. } else
  40. return NULL;
  41. }
  42. #endif