Skip to content

Commit

Permalink
updated sse2neon
Browse files Browse the repository at this point in the history
  • Loading branch information
Randy Jones committed Jul 12, 2024
1 parent 4137836 commit af348a8
Show file tree
Hide file tree
Showing 11 changed files with 10,851 additions and 5,801 deletions.
447 changes: 444 additions & 3 deletions external/sse2neon/CONTRIBUTING.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions external/sse2neon/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
MIT License

Copyright (c) 2015-2024 SSE2NEON Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
50 changes: 38 additions & 12 deletions external/sse2neon/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
ifndef CC
override CC = gcc
endif

ifndef CXX
override CXX = g++
endif

ifndef CROSS_COMPILE
processor := $(shell uname -m)
else # CROSS_COMPILE was set
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
CXXFLAGS += -static
LDFLAGS += -static
Expand All @@ -24,14 +29,32 @@ EXEC_WRAPPER = qemu-$(processor)
endif

# Follow platform-specific configurations
ifeq ($(processor),$(filter $(processor),aarch64 arm64))
ARCH_CFLAGS = -march=armv8-a+fp+simd+crc
else ifeq ($(processor),$(filter $(processor),i386 x86_64))
ARCH_CFLAGS = -maes -mpclmul -mssse3 -msse4.2
else ifeq ($(processor),$(filter $(processor),arm armv7l))
ARCH_CFLAGS = -mfpu=neon
else
$(error Unsupported architecture)
ARCH_CFLAGS ?=
ARCH_CFLAGS_IS_SET =
ifeq ($(ARCH_CFLAGS),)
ARCH_CFLAGS_IS_SET = true
endif
ifeq ($(ARCH_CFLAGS),none)
ARCH_CFLAGS_IS_SET = true
endif
ifdef ARCH_CFLAGS_IS_SET
ifeq ($(processor),$(filter $(processor),aarch64 arm64))
override ARCH_CFLAGS := -march=armv8-a+fp+simd
else ifeq ($(processor),$(filter $(processor),i386 x86_64))
override ARCH_CFLAGS := -maes -mpclmul -mssse3 -msse4.2
else ifeq ($(processor),$(filter $(processor),arm armv7 armv7l))
override ARCH_CFLAGS := -mfpu=neon
else
$(error Unsupported architecture)
endif
endif

FEATURE ?=
ifneq ($(FEATURE),)
ifneq ($(FEATURE),none)
COMMA:= ,
ARCH_CFLAGS := $(ARCH_CFLAGS)+$(subst $(COMMA),+,$(FEATURE))
endif
endif

CXXFLAGS += -Wall -Wcast-qual -I. $(ARCH_CFLAGS) -std=gnu++14
Expand All @@ -53,15 +76,18 @@ $(EXEC): $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $^

check: tests/main
ifeq ($(processor),$(filter $(processor),aarch64 arm64 arm armv7l))
$(CC) $(ARCH_CFLAGS) -c sse2neon.h
endif
$(EXEC_WRAPPER) $^

indent:
@echo "Formating files with clang-format.."
@if ! hash clang-format-11; then echo "clang-format-11 is required to indent"; fi
clang-format-11 -i sse2neon.h tests/*.cpp tests/*.h
@echo "Formatting files with clang-format.."
@if ! hash clang-format-12; then echo "clang-format-12 is required to indent"; fi
clang-format-12 -i sse2neon.h tests/*.cpp tests/*.h

.PHONY: clean check format
clean:
$(RM) $(OBJS) $(EXEC) $(deps)
$(RM) $(OBJS) $(EXEC) $(deps) sse2neon.h.gch

-include $(deps)
164 changes: 149 additions & 15 deletions external/sse2neon/README.md

Large diffs are not rendered by default.

Loading

0 comments on commit af348a8

Please sign in to comment.