1 Star 0 Fork 2

刘恒业/sse2neon

forked from kene/sse2neon 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 2.14 KB
一键复制 编辑 原始数据 按行查看 历史
Cuda Chen 提交于 2023-11-27 18:37 . Add A32 support in CI (#620)
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
check_arm := $(shell echo | $(CROSS_COMPILE)cpp -dM - | grep " __ARM_ARCH " | cut -c20-)
ifeq ($(check_arm),8)
processor = aarch64
else ifeq ($(check_arm),7) # detect ARMv7-A only
processor = arm
else
$(error Unsupported cross-compiler)
endif
endif
EXEC_WRAPPER =
ifdef CROSS_COMPILE
EXEC_WRAPPER = qemu-$(processor)
endif
# Follow platform-specific configurations
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
LDFLAGS += -lm
OBJS = \
tests/binding.o \
tests/common.o \
tests/impl.o \
tests/main.o
deps := $(OBJS:%.o=%.o.d)
.SUFFIXES: .o .cpp
.cpp.o:
$(CXX) -o $@ $(CXXFLAGS) -c -MMD -MF $@.d $<
EXEC = tests/main
$(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 "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) sse2neon.h.gch
-include $(deps)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuhengye666/sse2neon.git
[email protected]:liuhengye666/sse2neon.git
liuhengye666
sse2neon
sse2neon
master

搜索帮助