18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci# The loops are all 64-bit code
38c2ecf20Sopenharmony_ciCFLAGS += -I$(CURDIR)
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciEXTRA_SOURCES := ../harness.c
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cibuild_32bit = $(shell if ($(CC) $(CFLAGS) -m32 -o /dev/null memcmp.c >/dev/null 2>&1) then echo "1"; fi)
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciTEST_GEN_PROGS := memcmp_64 strlen
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci$(OUTPUT)/memcmp_64: memcmp.c ../utils.c
128c2ecf20Sopenharmony_ci$(OUTPUT)/memcmp_64: CFLAGS += -m64 -maltivec
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciifeq ($(build_32bit),1)
158c2ecf20Sopenharmony_ci$(OUTPUT)/memcmp_32: memcmp.c
168c2ecf20Sopenharmony_ci$(OUTPUT)/memcmp_32: CFLAGS += -m32
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciTEST_GEN_PROGS += memcmp_32
198c2ecf20Sopenharmony_ciendif
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci$(OUTPUT)/strlen: strlen.c string.c
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciifeq ($(build_32bit),1)
248c2ecf20Sopenharmony_ci$(OUTPUT)/strlen_32: strlen.c
258c2ecf20Sopenharmony_ci$(OUTPUT)/strlen_32: CFLAGS += -m32
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciTEST_GEN_PROGS += strlen_32
288c2ecf20Sopenharmony_ciendif
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciASFLAGS = $(CFLAGS)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_citop_srcdir = ../../../../..
338c2ecf20Sopenharmony_ciinclude ../../lib.mk
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci$(TEST_GEN_PROGS): $(EXTRA_SOURCES)
36