Skip to content

Commit

Permalink
update profdata
Browse files Browse the repository at this point in the history
  • Loading branch information
fo40225 committed Oct 8, 2023
1 parent 7dfd2f8 commit 81bbf5b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ else
myall:multi
endif

CXXFLAGS+= -flto -O3 -fpermissive $(ARCH_FLAGS)
CXXFLAGS+= -flto -O3 -fpermissive -std=c++14 $(ARCH_FLAGS)

ifneq ($(CXX), g++)
CXXFLAGS+= -fprofile-instr-use=bwa-mem2.profdata
Expand Down
Binary file modified bwa-mem2.avx512bw.profraw
Binary file not shown.
Binary file modified bwa-mem2.profdata
Binary file not shown.
10 changes: 4 additions & 6 deletions src/runsimd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ extern "C" {
#define SIMD_AVX512F 0x100
#define SIMD_AVX512BW 0x200

#ifndef _MSC_VER
// adapted from https://github.com/01org/linux-sgx/blob/master/common/inc/internal/linux/cpuid_gnu.h
void __cpuidex(int cpuid[4], int func_id, int subfunc_id)
void cpuidex(int cpuid[4], int func_id, int subfunc_id)
{
#if defined(__x86_64__)
__asm__ volatile ("cpuid"
Expand All @@ -67,15 +66,14 @@ void __cpuidex(int cpuid[4], int func_id, int subfunc_id)
: "0" (func_id), "2" (subfunc_id));
#endif
}
#endif

static int x86_simd(void)
{
int flag = 0, cpuid[4], max_id;
__cpuidex(cpuid, 0, 0);
cpuidex(cpuid, 0, 0);
max_id = cpuid[0];
if (max_id == 0) return 0;
__cpuidex(cpuid, 1, 0);
cpuidex(cpuid, 1, 0);
if (cpuid[3]>>25&1) flag |= SIMD_SSE;
if (cpuid[3]>>26&1) flag |= SIMD_SSE2;
if (cpuid[2]>>0 &1) flag |= SIMD_SSE3;
Expand All @@ -84,7 +82,7 @@ static int x86_simd(void)
if (cpuid[2]>>20&1) flag |= SIMD_SSE4_2;
if (cpuid[2]>>28&1) flag |= SIMD_AVX;
if (max_id >= 7) {
__cpuidex(cpuid, 7, 0);
cpuidex(cpuid, 7, 0);
if (cpuid[1]>>5 &1) flag |= SIMD_AVX2;
if (cpuid[1]>>16&1) flag |= SIMD_AVX512F;
if (cpuid[1]>>30&1) flag |= SIMD_AVX512BW;
Expand Down

0 comments on commit 81bbf5b

Please sign in to comment.