Skip to content

Commit

Permalink
Add support for Linux ARM64
Browse files Browse the repository at this point in the history
Use sse2neon v1.6.0 on ARM64

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Sep 26, 2023
1 parent b77c565 commit 10365f9
Show file tree
Hide file tree
Showing 4 changed files with 10,121 additions and 3 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ ifeq (0, ${MAKELEVEL})
TIMESTAMP=$(shell date)
endif

ARCH := $(shell uname -m)
ifeq ($(ARCH), x86_64)
ARCH_CFLAGS=-mpopcnt -msse4.2
else ($(ARCH), aarch64)
ARCH_CFLAGS=
endif

ifeq (1, ${DEBUG})
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O0 -DDEBUG=1 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -mpopcnt -msse4.2
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O0 -DDEBUG=1 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $(ARCH_CFLAGS)
else
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O4 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -mpopcnt -msse4.2
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O4 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $(ARCH_CFLAGS)
endif

GLIBS=-lm -lrt -lpthread -lz
Expand Down
7 changes: 6 additions & 1 deletion ksw.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@

#include <stdlib.h>
#include <stdint.h>
#include <emmintrin.h>
#include "ksw.h"

#ifdef __x86_64__
#include <emmintrin.h>
#elif __aarch64__
#include "sse2neon.h"
#endif

#ifdef USE_MALLOC_WRAPPERS
# include "malloc_wrap.h"
#endif
Expand Down
5 changes: 5 additions & 0 deletions poacns.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
#include "chararray.h"
#include "list.h"
#include "hashset.h"

#ifdef __x86_64__
#include <emmintrin.h>
#include <tmmintrin.h>
#elif __aarch64__
#include "sse2neon.h"
#endif

#if __BYTE_ORDER == 1234
//#pragma message(" ** " __FILE__ " has been tested in LITTLE_ENDIAN **\n")
Expand Down
Loading

0 comments on commit 10365f9

Please sign in to comment.