Skip to content

Commit 9586a59

Browse files
committed
use the simde header library for greater compatibility
1 parent 5086938 commit 9586a59

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "simde"]
2+
path = simde
3+
url = https://github.com/nemequ/simde-no-tests

Makefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ifneq (,$(findstring Darwin,$(shell uname)))
5555
MACOS = 1
5656
endif
5757

58-
EXTRA_FLAGS += -DPOPCNT_CAPABILITY -std=c++11
58+
EXTRA_FLAGS += -std=c++11
5959
INC += -I. -I third_party
6060

6161
MM_DEF =
@@ -152,9 +152,10 @@ HISAT2_REPEAT_CPPS_MAIN = $(REPEAT_CPPS) $(BUILD_CPPS) hisat2_repeat_main.cpp
152152
SEARCH_FRAGMENTS = $(wildcard search_*_phase*.c)
153153
VERSION = $(shell cat VERSION)
154154

155+
ARCH=$(shell uname -m)
155156
# Convert BITS=?? to a -m flag
156157
BITS=32
157-
ifeq (x86_64,$(shell uname -m))
158+
ifeq (x86_64,$(ARCH))
158159
BITS=64
159160
endif
160161
# msys will always be 32 bit so look at the cpu arch instead.
@@ -165,14 +166,15 @@ ifneq (,$(findstring AMD64,$(PROCESSOR_ARCHITEW6432)))
165166
endif
166167
BITS_FLAG =
167168

168-
ifeq (32,$(BITS))
169-
BITS_FLAG = -m32
170-
endif
171-
172-
ifeq (64,$(BITS))
173-
BITS_FLAG = -m64
169+
ifeq (x86_64,$(ARCH))
170+
ifeq (32,$(BITS))
171+
BITS_FLAG = -m32
172+
endif
173+
ifeq (64,$(BITS))
174+
BITS_FLAG = -m64
175+
endif
176+
SSE_FLAG=-msse2
174177
endif
175-
SSE_FLAG=-msse2
176178

177179
DEBUG_FLAGS = -O0 -g3 $(BITS_FLAG) $(SSE_FLAG)
178180
DEBUG_DEFS = -DCOMPILER_OPTIONS="\"$(DEBUG_FLAGS) $(EXTRA_FLAGS)\""

aligner_sw.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@
6666

6767
#define INLINE_CUPS
6868

69+
#define SIMDE_ENABLE_NATIVE_ALIASES
70+
#include <simde/x86/sse2.h>
6971
#include <stdint.h>
7072
#include <iostream>
7173
#include <limits>
7274
#include "threading.h"
73-
#include <emmintrin.h>
7475
#include "aligner_sw_common.h"
7576
#include "aligner_sw_nuc.h"
7677
#include "ds.h"

processor_support.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#if defined(__INTEL_COMPILER)
1414
# define USING_INTEL_COMPILER
15-
#elif defined(__GNUC__)
15+
#elif defined(__GNUC__) && defined(__x86_64__) || defined(__i386__)
1616
# define USING_GCC_COMPILER
1717
# include <cpuid.h>
1818
#elif defined(_MSC_VER)
@@ -52,8 +52,7 @@ class ProcessorSupport {
5252
#elif defined(USING_GCC_COMPILER)
5353
__get_cpuid(0x1, &regs.EAX, &regs.EBX, &regs.ECX, &regs.EDX);
5454
#else
55-
std::cerr << "ERROR: please define __cpuid() for this build.\n";
56-
assert(0);
55+
return false;
5756
#endif
5857
if( !( (regs.ECX & BIT(20)) && (regs.ECX & BIT(23)) ) ) return false;
5958
}

simde

Submodule simde added at 3698cef

sse_util.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
#ifndef SSE_UTIL_H_
2121
#define SSE_UTIL_H_
2222

23+
#define SIMDE_ENABLE_NATIVE_ALIASES
24+
#include <simde/x86/sse2.h>
25+
2326
#include "assert_helpers.h"
2427
#include "ds.h"
2528
#include "limit.h"
2629
#include <iostream>
27-
#include <emmintrin.h>
2830

2931
class EList_m128i {
3032
public:

0 commit comments

Comments
 (0)