Merge pull request #737 from mstorsjo/make-aarch64

Add support for building the arm64 assembly with the make build system
This commit is contained in:
Licai Guo 2014-04-24 06:40:07 +08:00
commit f00d3ac15f
8 changed files with 46 additions and 14 deletions

View File

@ -112,6 +112,14 @@ cpp = sorted(cpp, key=lambda s: s.lower())
asm = sorted(asm, key=lambda s: s.lower())
cfiles = sorted(cfiles, key=lambda s: s.lower())
sfiles = sorted(sfiles, key=lambda s: s.lower())
armfiles = []
arm64files = []
for file in sfiles:
c = file.split('/')
if 'arm64' in c:
arm64files.append(file)
elif 'arm' in c:
armfiles.append(file)
@ -140,13 +148,22 @@ if len(asm) > 0:
f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
if len(sfiles) > 0:
if len(armfiles) > 0:
f.write("ifeq ($(ASM_ARCH), arm)\n")
f.write("%s_ASM_S_SRCS=\\\n"%(PREFIX))
for c in sfiles:
f.write("%s_ASM_ARM_SRCS=\\\n"%(PREFIX))
for c in armfiles:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
f.write("%s_OBJS += $(%s_ASM_S_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("%s_OBJS += $(%s_ASM_ARM_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
if len(arm64files) > 0:
f.write("ifeq ($(ASM_ARCH), arm64)\n")
f.write("%s_ASM_ARM64_SRCS=\\\n"%(PREFIX))
for c in arm64files:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
f.write("%s_OBJS += $(%s_ASM_ARM64_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
f.write("OBJS += $(%s_OBJS)\n"%PREFIX)

View File

@ -2,7 +2,7 @@
cd "$(git rev-parse --show-toplevel 2>/dev/null)" >/dev/null 2>&1
python build/mktargets.py --directory codec/decoder --library decoder
python build/mktargets.py --directory codec/encoder --library encoder --exclude DllEntry.cpp
python build/mktargets.py --directory codec/common --library common --exclude asm_inc.asm --exclude arm_arch_common_macro.S
python build/mktargets.py --directory codec/common --library common --exclude asm_inc.asm --exclude arm_arch_common_macro.S --exclude arm_arch64_common_macro.S
python build/mktargets.py --directory codec/processing --library processing
python build/mktargets.py --directory codec/console/dec --binary h264dec

View File

@ -8,3 +8,10 @@ ASMFLAGS += -Icodec/common/arm/
CFLAGS += -DHAVE_NEON
endif
endif
ifneq ($(filter arm64 aarch64, $(ARCH)),)
ifeq ($(USE_ASM), Yes)
ASM_ARCH = arm64
ASMFLAGS += -Icodec/common/arm64/
CFLAGS += -DHAVE_NEON_AARCH64
endif
endif

View File

@ -25,13 +25,21 @@ COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
COMMON_ASM_S_SRCS=\
COMMON_ASM_ARM_SRCS=\
$(COMMON_SRCDIR)/arm/copy_mb_neon.S\
$(COMMON_SRCDIR)/arm/deblocking_neon.S\
$(COMMON_SRCDIR)/arm/expand_picture_neon.S\
$(COMMON_SRCDIR)/arm/mc_neon.S\
COMMON_OBJS += $(COMMON_ASM_S_SRCS:.S=.$(OBJ))
COMMON_OBJS += $(COMMON_ASM_ARM_SRCS:.S=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm64)
COMMON_ASM_ARM64_SRCS=\
$(COMMON_SRCDIR)/arm64/expand_picture_aarch64_neon.S\
$(COMMON_SRCDIR)/arm64/mc_aarch64_neon.S\
COMMON_OBJS += $(COMMON_ASM_ARM64_SRCS:.S=.$(OBJ))
endif
OBJS += $(COMMON_OBJS)

View File

@ -35,11 +35,11 @@ DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
DECODER_ASM_S_SRCS=\
DECODER_ASM_ARM_SRCS=\
$(DECODER_SRCDIR)/core/arm/block_add_neon.S\
$(DECODER_SRCDIR)/core/arm/intra_pred_neon.S\
DECODER_OBJS += $(DECODER_ASM_S_SRCS:.S=.$(OBJ))
DECODER_OBJS += $(DECODER_ASM_ARM_SRCS:.S=.$(OBJ))
endif
OBJS += $(DECODER_OBJS)

View File

@ -50,14 +50,14 @@ ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
ENCODER_ASM_S_SRCS=\
ENCODER_ASM_ARM_SRCS=\
$(ENCODER_SRCDIR)/core/arm/intra_pred_neon.S\
$(ENCODER_SRCDIR)/core/arm/intra_pred_sad_3_opt_neon.S\
$(ENCODER_SRCDIR)/core/arm/memory_neon.S\
$(ENCODER_SRCDIR)/core/arm/pixel_neon.S\
$(ENCODER_SRCDIR)/core/arm/reconstruct_neon.S\
ENCODER_OBJS += $(ENCODER_ASM_S_SRCS:.S=.$(OBJ))
ENCODER_OBJS += $(ENCODER_ASM_ARM_SRCS:.S=.$(OBJ))
endif
OBJS += $(ENCODER_OBJS)

View File

@ -31,13 +31,13 @@ PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
PROCESSING_ASM_S_SRCS=\
PROCESSING_ASM_ARM_SRCS=\
$(PROCESSING_SRCDIR)/src/arm/adaptive_quantization.S\
$(PROCESSING_SRCDIR)/src/arm/down_sample_neon.S\
$(PROCESSING_SRCDIR)/src/arm/pixel_sad_neon.S\
$(PROCESSING_SRCDIR)/src/arm/vaa_calc_neon.S\
PROCESSING_OBJS += $(PROCESSING_ASM_S_SRCS:.S=.$(OBJ))
PROCESSING_OBJS += $(PROCESSING_ASM_ARM_SRCS:.S=.$(OBJ))
endif
OBJS += $(PROCESSING_OBJS)

View File

@ -8,7 +8,7 @@ ENCODER_UNITTEST_CPP_SRCS=\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_GetIntraPredictor.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryAlloc.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionEstimate.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_Sample.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_Sample.cpp\
ENCODER_UNITTEST_OBJS += $(ENCODER_UNITTEST_CPP_SRCS:.cpp=.$(OBJ))