ref: f00d3ac15fa848c9116dcf282e33b3ac1b9c685d
parent: f1737cbec685fa930f631e532d63e6e4f8a58e2b
parent: f1b2d51d8624431ca161f20149d157117c1c16f6
author: Licai Guo <licaguo@cisco.com>
date: Thu Apr 24 02:40:07 EDT 2014
Merge pull request #737 from mstorsjo/make-aarch64 Add support for building the arm64 assembly with the make build system
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -112,6 +112,14 @@
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 @@
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)
--- a/build/mktargets.sh
+++ b/build/mktargets.sh
@@ -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
--- a/build/platform-arch.mk
+++ b/build/platform-arch.mk
@@ -8,3 +8,10 @@
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
--- a/codec/common/targets.mk
+++ b/codec/common/targets.mk
@@ -25,13 +25,21 @@
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)
--- a/codec/decoder/targets.mk
+++ b/codec/decoder/targets.mk
@@ -35,11 +35,11 @@
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)
--- a/codec/encoder/targets.mk
+++ b/codec/encoder/targets.mk
@@ -50,7 +50,7 @@
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\
@@ -57,7 +57,7 @@
$(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)
--- a/codec/processing/targets.mk
+++ b/codec/processing/targets.mk
@@ -31,13 +31,13 @@
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)
--- a/test/encoder/targets.mk
+++ b/test/encoder/targets.mk
@@ -8,7 +8,7 @@
$(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))