Commit a4f3ed62 authored by Alex Bennée's avatar Alex Bennée
Browse files

tests/tcg: add float_madds test to multiarch



This is a generic floating point multiply and accumulate test for
single precision floating point values. I've split of the common float
functions into a helper library so additional tests can use the same
common code.

As I don't have references for all architectures I've allowed some
flexibility for tests to pass without reference files. They can be
added as we get collect them.

Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
parent 149911cf
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -55,6 +55,15 @@ diff-out = $(call quiet-command, diff -q $1.out $2 || \
# $1 = test name, $2 = reason
skip-test = @printf "  SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2

# $1 = test name, $2 = reference
# As above but only diff if reference file exists, otherwise the test
# passes if it managed to complete with a status of zero
conditional-diff-out = 							\
	$(if $(wildcard $2), 						\
		$(call diff-out,$1,$2), 				\
		$(call skip-test,"$1 check","no reference"))


# Tests we are building
TESTS=

+768 −0

File added.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@ ARM_SRC=$(SRC_PATH)/tests/tcg/arm
# Set search path for all sources
VPATH 		+= $(ARM_SRC)

# Multiarch Tests
float_madds: CFLAGS+=-mfpu=neon-vfpv4

# Basic Hello World
ARM_TESTS = hello-arm
hello-arm: CFLAGS+=-marm -ffreestanding
+768 −0

File added.

Preview size limit exceeded, changes collapsed.

+11 −1
Original line number Diff line number Diff line
@@ -10,12 +10,22 @@ MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
# Set search path for all sources
VPATH 		+= $(MULTIARCH_SRC)
MULTIARCH_SRCS   =$(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
MULTIARCH_TESTS  =$(MULTIARCH_SRCS:.c=)
MULTIARCH_TESTS  =$(filter-out float_helpers, $(MULTIARCH_SRCS:.c=))

#
# The following are any additional rules needed to build things
#


float_madds: LDFLAGS+=-lm
float_madds: float_madds.c float_helpers.c
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/float_helpers.c -o $@ $(LDFLAGS)

run-float_madds: float_madds
	$(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<,"$< on $(TARGET_NAME)")
	$(call conditional-diff-out,$<,$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/$<.ref)


testthread: LDFLAGS+=-lpthread

# We define the runner for test-mmap after the individual
Loading