Line data Source code
1 : /* 2 : * Copyright(c) 2018 Intel Corporation 3 : */ 4 : 5 : #include "vr_types.h" 6 : #include "vr_cpuid.h" 7 : 8 : #include "rte_cpuflags.h" 9 : 10 : struct vr_cpu_type_t vr_cpu_type; 11 : 12 53 : void vr_dpdk_init_cpuid(struct vr_cpu_type_t *cpu) 13 : { 14 53 : memset(cpu, 0, sizeof(struct vr_cpu_type_t)); 15 : #ifdef __VR_X86_64__ 16 53 : cpu->has_sse = rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE); 17 53 : cpu->has_sse2 = rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE2); 18 53 : cpu->has_sse3 = rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE3); 19 53 : cpu->has_ssse3 = rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSSE3); 20 53 : cpu->has_sse41 = rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1); 21 53 : cpu->has_sse42 = rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_2); 22 53 : cpu->has_popcnt = rte_cpu_get_flag_enabled(RTE_CPUFLAG_POPCNT); 23 53 : cpu->has_rtm = rte_cpu_get_flag_enabled(RTE_CPUFLAG_RTM); 24 53 : cpu->has_avx = rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX); 25 53 : cpu->has_avx2 = rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2); 26 53 : cpu->has_avx512f = rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F); 27 : #endif 28 53 : } 29 :