Import QEMU upstream snapshot d2e570c
Upstream: https://gitlab.com/qemu-project/qemu.git Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
This commit is contained in:
@@ -0,0 +1,281 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# TCG tests
|
||||
#
|
||||
# These are complicated by the fact we want to build them for guest
|
||||
# systems. This requires knowing what guests we are building and which
|
||||
# ones we have cross-compilers for or docker images with
|
||||
# cross-compilers.
|
||||
#
|
||||
# The tests themselves should be as minimal as possible as
|
||||
# cross-compilers don't always have a large amount of libraries
|
||||
# available.
|
||||
#
|
||||
# We only include the host build system for SRC_PATH and we don't
|
||||
# bother with the common rules.mk. We expect the following:
|
||||
#
|
||||
# CC - the C compiler command
|
||||
# EXTRA_CFLAGS - any extra CFLAGS
|
||||
# BUILD_STATIC - are we building static binaries
|
||||
#
|
||||
# By default all tests are statically compiled but some host systems
|
||||
# may not package static libraries by default. If an external
|
||||
# cross-compiler can only build dynamic libraries the user might need
|
||||
# to make extra efforts to ensure ld.so can link at runtime when the
|
||||
# tests are run.
|
||||
#
|
||||
# We also accept SPEED=slow to enable slower running tests
|
||||
#
|
||||
# We also expect to be in the tests build dir for the FOO-(linux-user|softmmu).
|
||||
#
|
||||
|
||||
all:
|
||||
-include ../config-host.mak
|
||||
-include config-target.mak
|
||||
|
||||
# Get semihosting definitions for user-mode emulation
|
||||
ifeq ($(filter %-softmmu, $(TARGET)),)
|
||||
-include $(SRC_PATH)/configs/targets/$(TARGET).mak
|
||||
endif
|
||||
|
||||
# for including , in command strings
|
||||
COMMA := ,
|
||||
NULL :=
|
||||
SPACE := $(NULL) #
|
||||
TARGET_PREFIX=tests/tcg/$(TARGET):$(SPACE)
|
||||
|
||||
quiet-@ = $(if $(V),,@$(if $1,printf " %-7s %s\n" "$(strip $1)" "$(strip $2)" && ))
|
||||
quiet-command = $(call quiet-@,$2,$3)$1
|
||||
|
||||
cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>&1
|
||||
cc-option = if $(call cc-test, $1); then \
|
||||
echo "$(TARGET_PREFIX)$1 detected" && echo "$(strip $2)=$(strip $1)" >&3; else \
|
||||
echo "$(TARGET_PREFIX)$1 not detected"; fi
|
||||
|
||||
# $1 = test name, $2 = cmd, $3 = desc
|
||||
ifeq ($(filter %-softmmu, $(TARGET)),)
|
||||
run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2 > $1.out, \
|
||||
TEST,$(or $3, $*, $<) on $(TARGET_NAME))
|
||||
else
|
||||
run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2, \
|
||||
TEST,$(or $3, $*, $<) on $(TARGET_NAME))
|
||||
endif
|
||||
|
||||
# $1 = test name, $2 = reference
|
||||
# to work around the pipe squashing the status we only pipe the result if
|
||||
# we know it failed and then force failure at the end.
|
||||
diff-out = $(call quiet-command, diff -q $1.out $2 || \
|
||||
(diff -u $1.out $2 | head -n 10 && false), \
|
||||
DIFF,$1.out with $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=
|
||||
# additional tests which may re-use existing binaries
|
||||
EXTRA_TESTS=
|
||||
|
||||
# Start with a blank slate, the build targets get to add stuff first
|
||||
CFLAGS=
|
||||
LDFLAGS=
|
||||
|
||||
QEMU_OPTS=
|
||||
CHECK_PLUGIN_OUTPUT_COMMAND=
|
||||
|
||||
|
||||
# If TCG debugging, or TCI is enabled things are a lot slower
|
||||
# so we have to set our timeout for that. The current worst case
|
||||
# offender is the system memory test running under TCI.
|
||||
TIMEOUT=120
|
||||
|
||||
ifeq ($(filter %-softmmu, $(TARGET)),)
|
||||
# The order we include is important. We include multiarch first and
|
||||
# then the target. If there are common tests shared between
|
||||
# sub-targets (e.g. ARM & AArch64) then it is up to
|
||||
# $(TARGET_NAME)/Makefile.target to include the common parent
|
||||
# architecture in its VPATH. However some targets are so minimal we
|
||||
# can't even build the multiarch tests.
|
||||
ifneq ($(filter $(TARGET_NAME),aarch64_be),)
|
||||
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
|
||||
else
|
||||
-include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target
|
||||
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
|
||||
endif
|
||||
|
||||
# Add the common build options
|
||||
CFLAGS+=-Wall -Werror -O0 -g -fno-strict-aliasing
|
||||
ifeq ($(BUILD_STATIC),y)
|
||||
LDFLAGS+=-static
|
||||
endif
|
||||
|
||||
%: %.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
%: %.S
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -Wa,--noexecstack $< -o $@ $(LDFLAGS)
|
||||
else
|
||||
# For system targets we include a different Makefile fragment as the
|
||||
# build options for bare programs are usually pretty different. They
|
||||
# are expected to provide their own build recipes.
|
||||
EXTRA_CFLAGS += -ffreestanding -fno-stack-protector
|
||||
|
||||
# We skip the multiarch tests if the target hasn't provided a boot.S
|
||||
MULTIARCH_SOFTMMU_TARGETS = i386 alpha aarch64 arm loongarch64 s390x x86_64
|
||||
|
||||
ifneq ($(filter $(TARGET_NAME),$(MULTIARCH_SOFTMMU_TARGETS)),)
|
||||
-include $(SRC_PATH)/tests/tcg/minilib/Makefile.target
|
||||
-include $(SRC_PATH)/tests/tcg/multiarch/system/Makefile.softmmu-target
|
||||
endif
|
||||
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.softmmu-target
|
||||
|
||||
endif
|
||||
|
||||
all: $(TESTS) $(EXTRA_TESTS)
|
||||
|
||||
#
|
||||
# Test Runners
|
||||
#
|
||||
# By default we just run the test with the appropriate QEMU for the
|
||||
# target. More advanced tests may want to override the runner in their
|
||||
# specific make rules. Additional runners for the same binary should
|
||||
# be added to EXTRA_RUNS.
|
||||
#
|
||||
|
||||
RUN_TESTS=$(patsubst %,run-%, $(TESTS))
|
||||
|
||||
# If plugins exist also include those in the tests
|
||||
ifeq ($(CONFIG_PLUGIN),y)
|
||||
PLUGIN_SRC=$(SRC_PATH)/tests/tcg/plugins
|
||||
PLUGIN_LIB=../plugins
|
||||
VPATH+=$(PLUGIN_LIB)
|
||||
# Some plugins need to be disabled for all tests to avoid exponential explosion.
|
||||
# For example, libpatch.so only needs to run against the arch-specific patch
|
||||
# target test, so we explicitly run it in the arch-specific Makefile.
|
||||
DISABLE_PLUGINS=libpatch.so
|
||||
|
||||
# Likewise don't bother with the syscall plugin for softmmu
|
||||
ifneq ($(filter %-softmmu, $(TARGET)),)
|
||||
DISABLE_PLUGINS += libsyscall.so
|
||||
endif
|
||||
|
||||
PLUGINS=$(filter-out $(DISABLE_PLUGINS), \
|
||||
$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c))))
|
||||
|
||||
strip-plugin = $(wordlist 1, 1, $(subst -with-, ,$1))
|
||||
extract-plugin = $(wordlist 2, 2, $(subst -with-, ,$1))
|
||||
extract-test = $(subst run-plugin-,,$(wordlist 1, 1, $(subst -with-, ,$1)))
|
||||
|
||||
# We need to ensure expand the run-plugin-TEST-with-PLUGIN
|
||||
# pre-requistes manually here as we can't use stems to handle it. We
|
||||
# only expand MULTIARCH_TESTS which are common on most of our targets
|
||||
# and rotate the plugins so we don't grow too out of control as new
|
||||
# tests are added. Plugins that need to run with a specific test
|
||||
# should ensure they add their combination to EXTRA_RUNS.
|
||||
|
||||
ifneq ($(MULTIARCH_TESTS),)
|
||||
|
||||
# Extract extra tests from the extra test+plugin combination.
|
||||
EXTRA_TESTS_WITH_PLUGIN=$(foreach test, \
|
||||
$(EXTRA_RUNS_WITH_PLUGIN),$(call extract-test,$(test)))
|
||||
# Exclude tests that were specified to run with specific plugins from the tests
|
||||
# which can run with any plugin combination, so we don't run it twice.
|
||||
MULTIARCH_TESTS:=$(filter-out $(EXTRA_TESTS_WITH_PLUGIN), $(MULTIARCH_TESTS))
|
||||
|
||||
NUM_PLUGINS := $(words $(PLUGINS))
|
||||
NUM_TESTS := $(words $(MULTIARCH_TESTS))
|
||||
|
||||
define mod_plus_one
|
||||
$(shell $(PYTHON) -c "print( ($(1) % $(2)) + 1 )")
|
||||
endef
|
||||
|
||||
# Rules for running tests with any plugin combination, i.e., no specific plugin.
|
||||
$(foreach _idx, $(shell seq 1 $(NUM_TESTS)), \
|
||||
$(eval _test := $(word $(_idx), $(MULTIARCH_TESTS))) \
|
||||
$(eval _plugin := $(word $(call mod_plus_one, $(_idx), $(NUM_PLUGINS)), $(PLUGINS))) \
|
||||
$(eval run-plugin-$(_test)-with-$(_plugin): $(_test) $(_plugin)) \
|
||||
$(eval RUN_TESTS+=run-plugin-$(_test)-with-$(_plugin)))
|
||||
|
||||
# Rules for running extra tests with specific plugins.
|
||||
$(foreach f,$(EXTRA_RUNS_WITH_PLUGIN), \
|
||||
$(eval $(f): $(call extract-test,$(f)) $(call extract-plugin,$(f))))
|
||||
|
||||
endif # MULTIARCH_TESTS
|
||||
endif # CONFIG_PLUGIN
|
||||
|
||||
RUN_TESTS+=$(EXTRA_RUNS)
|
||||
RUN_TESTS+=$(EXTRA_RUNS_WITH_PLUGIN)
|
||||
|
||||
# Some plugins need additional arguments above the default to fully
|
||||
# exercise things. We can define them on a per-test basis here.
|
||||
run-plugin-%-with-libmem.so: PLUGIN_ARGS=$(COMMA)inline=true
|
||||
|
||||
ifeq ($(filter %-softmmu, $(TARGET)),)
|
||||
run-%: %
|
||||
$(call run-test, $<, env QEMU=$(QEMU) $(QEMU) $(QEMU_OPTS) $<)
|
||||
|
||||
run-plugin-%:
|
||||
$(call run-test, $@, env QEMU=$(QEMU) $(QEMU) $(QEMU_OPTS) \
|
||||
-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \
|
||||
-d plugin -D $*.pout \
|
||||
$(call strip-plugin,$<))
|
||||
$(if $(CHECK_PLUGIN_OUTPUT_COMMAND), \
|
||||
$(call quiet-command, $(CHECK_PLUGIN_OUTPUT_COMMAND) $*.pout, \
|
||||
TEST, check plugin $(call extract-plugin,$@) output \
|
||||
with $(call strip-plugin,$<)))
|
||||
else
|
||||
run-%: %
|
||||
$(call run-test, $<, \
|
||||
$(QEMU) -monitor none -display none \
|
||||
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
|
||||
$(QEMU_OPTS) $<)
|
||||
|
||||
run-plugin-%:
|
||||
$(call run-test, $@, \
|
||||
$(QEMU) -monitor none -display none \
|
||||
-chardev file$(COMMA)path=[email protected]$(COMMA)id=output \
|
||||
-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \
|
||||
-d plugin -D $*.pout \
|
||||
$(QEMU_OPTS) $(call strip-plugin,$<))
|
||||
$(if $(CHECK_PLUGIN_OUTPUT_COMMAND), \
|
||||
$(call quiet-command, $(CHECK_PLUGIN_OUTPUT_COMMAND) $*.pout, \
|
||||
TEST, check plugin $(call extract-plugin,$@) output \
|
||||
with $(call strip-plugin,$<)))
|
||||
endif
|
||||
|
||||
gdb-%: %
|
||||
gdb --args $(QEMU) $(QEMU_OPTS) $<
|
||||
|
||||
# Filter tests based on TCG_TEST_FILTER if set
|
||||
ifdef TCG_TEST_FILTER
|
||||
FILTERED_RUN_TESTS=$(foreach test,$(RUN_TESTS),$(if $(findstring $(TCG_TEST_FILTER),$(test)),$(test)))
|
||||
else
|
||||
FILTERED_RUN_TESTS=$(RUN_TESTS)
|
||||
endif
|
||||
|
||||
.PHONY: run
|
||||
run: $(FILTERED_RUN_TESTS)
|
||||
|
||||
clean:
|
||||
rm -f $(TESTS) *.o $(CLEANFILES)
|
||||
|
||||
distclean:
|
||||
rm -f config-cc.mak config-target.mak ../config-$(TARGET).mak
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "TCG tests help $(TARGET_NAME)"
|
||||
@echo "Built with $(CC)"
|
||||
@echo "Available tests:"
|
||||
@$(foreach t,$(RUN_TESTS),echo " $t";)
|
||||
@echo ""
|
||||
@echo "Environment variables:"
|
||||
@echo " TCG_TEST_FILTER=<pattern> Filter tests matching pattern"
|
||||
@@ -0,0 +1,14 @@
|
||||
This directory contains various interesting guest binaries for
|
||||
regression testing the Tiny Code Generator doing system and user-mode
|
||||
emulation.
|
||||
|
||||
The multiarch directory contains shared code for tests that can be
|
||||
built for all guest architectures. Architecture specific code can be
|
||||
found in their respective directories.
|
||||
|
||||
System mode tests will be under the "system" subdirectories.
|
||||
|
||||
GDB scripts for exercising the gdbstub on specific tests will be found
|
||||
under the "gdbstb" subdirectories.
|
||||
|
||||
See the developer guide for more instructions on "make check-tcg"
|
||||
@@ -0,0 +1,147 @@
|
||||
#
|
||||
# Aarch64 system tests
|
||||
#
|
||||
|
||||
AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
|
||||
AARCH64_SYSTEM_SRC=$(AARCH64_SRC)/system
|
||||
|
||||
VPATH+=$(AARCH64_SYSTEM_SRC)
|
||||
|
||||
# These objects provide the basic boot code and helper functions for all tests
|
||||
CRT_OBJS=boot.o
|
||||
|
||||
AARCH64_TEST_C_SRCS=$(wildcard $(AARCH64_SYSTEM_SRC)/*.c)
|
||||
AARCH64_TEST_S_SRCS=$(AARCH64_SYSTEM_SRC)/mte.S
|
||||
|
||||
AARCH64_C_TESTS = $(patsubst $(AARCH64_SYSTEM_SRC)/%.c, %, $(AARCH64_TEST_C_SRCS))
|
||||
AARCH64_S_TESTS = $(patsubst $(AARCH64_SYSTEM_SRC)/%.S, %, $(AARCH64_TEST_S_SRCS))
|
||||
|
||||
AARCH64_TESTS = $(AARCH64_C_TESTS)
|
||||
AARCH64_TESTS += $(AARCH64_S_TESTS)
|
||||
|
||||
CRT_PATH=$(AARCH64_SYSTEM_SRC)
|
||||
LINK_SCRIPT=$(AARCH64_SYSTEM_SRC)/kernel.ld
|
||||
LDFLAGS=-Wl,-T$(LINK_SCRIPT)
|
||||
TESTS+=$(AARCH64_TESTS) $(MULTIARCH_TESTS)
|
||||
EXTRA_RUNS+=$(MULTIARCH_RUNS)
|
||||
CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
|
||||
LDFLAGS+=-static -nostdlib $(MINILIB_OBJS) -lgcc
|
||||
|
||||
config-cc.mak: Makefile
|
||||
$(quiet-@)( \
|
||||
$(call cc-option,-march=armv8.3-a, CROSS_CC_HAS_ARMV8_3); \
|
||||
$(call cc-option,-march=armv8.5-a+memtag, CROSS_CC_HAS_ARMV8_MTE)) 3> config-cc.mak
|
||||
-include config-cc.mak
|
||||
|
||||
# building head blobs
|
||||
.PRECIOUS: $(CRT_OBJS)
|
||||
|
||||
vector_log_boot.o: $(CRT_PATH)/boot.S
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DLOGGING_VECTOR_TABLE -x assembler-with-cpp -Wa,--noexecstack -c $< -o $@
|
||||
|
||||
%.o: $(CRT_PATH)/%.S
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -Wa,--noexecstack -c $< -o $@
|
||||
|
||||
# Build and link the tests
|
||||
%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) boot.o
|
||||
|
||||
memory: CFLAGS+=-DCHECK_UNALIGNED=1
|
||||
|
||||
memory-sve: memory.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) boot.o
|
||||
|
||||
memory-sve: CFLAGS+=-DCHECK_UNALIGNED=1 -march=armv8.1-a+sve -O3
|
||||
|
||||
gpc-test: gpc-test.c $(LINK_SCRIPT) vector_log_boot.o $(MINILIB_OBJS)
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) vector_log_boot.o
|
||||
|
||||
TESTS+=memory-sve gpc-test
|
||||
|
||||
# Running
|
||||
QEMU_BASE_MACHINE=-M virt -cpu max -display none
|
||||
QEMU_BASE_ARGS=-semihosting-config enable=on,target=native,chardev=output
|
||||
QEMU_OPTS+=$(QEMU_BASE_MACHINE) $(QEMU_BASE_ARGS) -kernel
|
||||
|
||||
# console test is manual only
|
||||
QEMU_SEMIHOST=-serial none -chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline
|
||||
run-semiconsole: QEMU_OPTS=$(QEMU_BASE_MACHINE) $(QEMU_SEMIHOST) -kernel
|
||||
run-semiconsole: semiconsole
|
||||
$(call skip-test, $<, "MANUAL ONLY")
|
||||
$(if $(V),@printf " %-7s %s %s\n" "TO RUN" $(notdir $(QEMU)) "$(QEMU_OPTS) $<")
|
||||
run-plugin-semiconsole-with-%: semiconsole
|
||||
$(call skip-test, $<, "MANUAL ONLY")
|
||||
|
||||
# vtimer test needs EL2
|
||||
QEMU_EL2_MACHINE=-machine virt,virtualization=on,gic-version=2 -cpu cortex-a57 -smp 4
|
||||
QEMU_EL2_BASE_ARGS=-semihosting-config enable=on,target=native,chardev=output,arg="2"
|
||||
run-vtimer: QEMU_OPTS=$(QEMU_EL2_MACHINE) $(QEMU_EL2_BASE_ARGS) -kernel
|
||||
|
||||
# gpc tests need EL3 and RME
|
||||
QEMU_EL3_MACHINE=-machine virt,virtualization=on,secure=on,gic-version=3 -cpu max,x-rme=on
|
||||
QEMU_EL3_BASE_ARGS=-semihosting-config enable=on,target=native,chardev=output,arg="3"
|
||||
run-gpc-test: QEMU_OPTS=$(QEMU_EL3_MACHINE) $(QEMU_EL3_BASE_ARGS) -kernel
|
||||
run-gpc3-test: QEMU_OPTS=$(QEMU_EL3_MACHINE) $(QEMU_EL3_BASE_ARGS) -kernel
|
||||
|
||||
# Simple Record/Replay Test
|
||||
.PHONY: memory-record
|
||||
run-memory-record: memory-record memory
|
||||
$(call run-test, $<, \
|
||||
$(QEMU) -monitor none -display none \
|
||||
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
|
||||
-icount shift=5$(COMMA)rr=record$(COMMA)rrfile=record.bin \
|
||||
$(QEMU_OPTS) memory)
|
||||
|
||||
.PHONY: memory-replay
|
||||
run-memory-replay: memory-replay run-memory-record
|
||||
$(call run-test, $<, \
|
||||
$(QEMU) -monitor none -display none \
|
||||
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
|
||||
-icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \
|
||||
$(QEMU_OPTS) memory)
|
||||
|
||||
EXTRA_RUNS+=run-memory-replay
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_ARMV8_3),)
|
||||
pauth-3: CFLAGS += $(CROSS_CC_HAS_ARMV8_3)
|
||||
# This test explicitly checks the output of the pauth operation so we
|
||||
# must force the use of the QARMA5 algorithm for it.
|
||||
run-pauth-3: QEMU_BASE_MACHINE=-M virt -cpu max,pauth-qarma5=on -display none
|
||||
else
|
||||
pauth-3:
|
||||
$(call skip-test, "BUILD of $@", "missing compiler support")
|
||||
run-pauth-3:
|
||||
$(call skip-test, "RUN of pauth-3", "not built")
|
||||
endif
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
|
||||
QEMU_MTE_ENABLED_MACHINE=-M virt,mte=on -cpu max -display none
|
||||
QEMU_OPTS_WITH_MTE_ON = $(QEMU_MTE_ENABLED_MACHINE) $(QEMU_BASE_ARGS) -kernel
|
||||
mte: CFLAGS+=-march=armv8.5-a+memtag
|
||||
mte: mte.S $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) boot.o
|
||||
|
||||
run-mte: QEMU_OPTS=$(QEMU_OPTS_WITH_MTE_ON)
|
||||
run-mte: mte
|
||||
|
||||
ifeq ($(GDB_SUPPORTS_MTE_IN_BAREMETAL),y)
|
||||
run-gdbstub-mte: QEMU_OPTS=$(QEMU_OPTS_WITH_MTE_ON)
|
||||
run-gdbstub-mte: mte
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--output run-gdbstub-mte.out \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "-chardev null$(COMMA)id=output $(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-mte.py -- --mode=system, \
|
||||
gdbstub MTE support)
|
||||
|
||||
EXTRA_RUNS += run-gdbstub-mte
|
||||
else # !GDB_SUPPORTS_MTE_IN_BAREMETAL
|
||||
run-gdbstub-mte:
|
||||
$(call skip-test "RUN of gdbstub-mte", "GDB does not support MTE in baremetal!")
|
||||
endif
|
||||
else # !CROSS_CC_HAS_ARMV8_MTE
|
||||
mte:
|
||||
$(call skip-test, "BUILD of $@", "missing compiler support")
|
||||
run-mte:
|
||||
$(call skip-test, "RUN of mte", "not build")
|
||||
endif
|
||||
@@ -0,0 +1,211 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# AArch64 specific tweaks
|
||||
|
||||
ARM_SRC=$(SRC_PATH)/tests/tcg/arm
|
||||
VPATH += $(ARM_SRC)
|
||||
|
||||
AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
|
||||
VPATH += $(AARCH64_SRC)
|
||||
|
||||
# Base architecture tests
|
||||
AARCH64_TESTS=fcvt pcalign-a64 lse2-fault
|
||||
AARCH64_TESTS += test-2248 test-2150
|
||||
|
||||
fcvt: LDFLAGS+=-lm
|
||||
|
||||
run-fcvt: fcvt
|
||||
$(call run-test,$<,$(QEMU) $<)
|
||||
$(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
|
||||
|
||||
config-cc.mak: Makefile
|
||||
$(quiet-@)( \
|
||||
fnia=`$(call cc-test,-fno-integrated-as) && echo -fno-integrated-as`; \
|
||||
$(call cc-option,-march=armv8.1-a+sve, CROSS_CC_HAS_SVE); \
|
||||
$(call cc-option,-march=armv8.1-a+sve2, CROSS_CC_HAS_SVE2); \
|
||||
$(call cc-option,-march=armv8.2-a, CROSS_CC_HAS_ARMV8_2); \
|
||||
$(call cc-option,-march=armv8.3-a, CROSS_CC_HAS_ARMV8_3); \
|
||||
$(call cc-option,-march=armv8.5-a, CROSS_CC_HAS_ARMV8_5); \
|
||||
$(call cc-option,-mbranch-protection=standard, CROSS_CC_HAS_ARMV8_BTI); \
|
||||
$(call cc-option,-march=armv8.5-a+memtag, CROSS_CC_HAS_ARMV8_MTE); \
|
||||
$(call cc-option,-Wa$(COMMA)-march=armv9-a+sme $$fnia, CROSS_AS_HAS_ARMV9_SME); \
|
||||
$(call cc-option,-march=armv9-a+fprcvt, CROSS_CC_HAS_ARMV9_FPRCVT)) 3> config-cc.mak
|
||||
-include config-cc.mak
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_ARMV9_FPRCVT),)
|
||||
AARCH64_TESTS += fcvt-fprcvt
|
||||
fcvt-fprcvt: LDFLAGS += -lm
|
||||
fcvt-fprcvt: CFLAGS += $(CROSS_CC_HAS_ARMV9_FPRCVT) -DFPRCVT
|
||||
fcvt-fprcvt: fcvt.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
run-fcvt-fprcvt: fcvt-fprcvt
|
||||
$(call run-test,$<,$(QEMU) $<)
|
||||
$(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
|
||||
endif
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_ARMV8_2),)
|
||||
AARCH64_TESTS += dcpop
|
||||
dcpop: CFLAGS += $(CROSS_CC_HAS_ARMV8_2)
|
||||
endif
|
||||
ifneq ($(CROSS_CC_HAS_ARMV8_5),)
|
||||
AARCH64_TESTS += dcpodp
|
||||
dcpodp: CFLAGS += $(CROSS_CC_HAS_ARMV8_5)
|
||||
endif
|
||||
|
||||
# Pauth Tests
|
||||
ifneq ($(CROSS_CC_HAS_ARMV8_3),)
|
||||
AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5 test-2375
|
||||
pauth-%: CFLAGS += $(CROSS_CC_HAS_ARMV8_3)
|
||||
test-2375: CFLAGS += -march=armv8.3-a
|
||||
run-pauth-1: QEMU_OPTS += -cpu max
|
||||
run-pauth-2: QEMU_OPTS += -cpu max
|
||||
# Choose a cpu with FEAT_Pauth but without FEAT_FPAC for pauth-[45].
|
||||
run-pauth-4: QEMU_OPTS += -cpu neoverse-v1
|
||||
run-pauth-5: QEMU_OPTS += -cpu neoverse-v1
|
||||
endif
|
||||
|
||||
# BTI Tests
|
||||
# bti-1 tests the elf notes, so we require special compiler support.
|
||||
ifneq ($(CROSS_CC_HAS_ARMV8_BTI),)
|
||||
AARCH64_TESTS += bti-1 bti-3
|
||||
bti-1 bti-3: CFLAGS += -fno-stack-protector $(CROSS_CC_HAS_ARMV8_BTI)
|
||||
bti-1 bti-3: LDFLAGS += -nostdlib
|
||||
endif
|
||||
# bti-2 tests PROT_BTI, so no special compiler support required.
|
||||
AARCH64_TESTS += bti-2
|
||||
|
||||
# MTE Tests
|
||||
ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
|
||||
AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7 mte-8 mte-9 mte-10
|
||||
mte-%: CFLAGS += $(CROSS_CC_HAS_ARMV8_MTE)
|
||||
endif
|
||||
|
||||
# SME Tests
|
||||
ifneq ($(CROSS_AS_HAS_ARMV9_SME),)
|
||||
SME_TESTS = sme-outprod1 sme-smopa-1 sme-smopa-2 sme-fmopa-1 sme-fmopa-2 sme-fmopa-3
|
||||
AARCH64_TESTS += $(SME_TESTS)
|
||||
$(SME_TESTS): CFLAGS += $(CROSS_AS_HAS_ARMV9_SME)
|
||||
endif
|
||||
|
||||
# GCS Tests
|
||||
GCS_TESTS += gcsstr gcspushm gcsss
|
||||
AARCH64_TESTS += $(GCS_TESTS)
|
||||
$(GCS_TESTS): gcs.h
|
||||
|
||||
# System Registers Tests
|
||||
AARCH64_TESTS += sysregs
|
||||
|
||||
AARCH64_TESTS += test-aes
|
||||
test-aes: CFLAGS += -O -march=armv8-a+aes
|
||||
test-aes: test-aes-main.c.inc
|
||||
|
||||
# Vector SHA1
|
||||
# Work around compiler false-positive warning, as we do for the 'sha1' test
|
||||
sha1-vector: CFLAGS=-O3 -Wno-stringop-overread
|
||||
sha1-vector: sha1.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
run-sha1-vector: sha1-vector run-sha1
|
||||
$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
|
||||
$(call diff-out, sha1-vector, sha1.out)
|
||||
|
||||
TESTS += sha1-vector
|
||||
|
||||
# Vector versions of sha512 (-O3 triggers vectorisation)
|
||||
sha512-vector: CFLAGS=-O3
|
||||
sha512-vector: sha512.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
TESTS += sha512-vector
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_SVE),)
|
||||
# SVE ioctl test
|
||||
AARCH64_TESTS += sve-ioctls
|
||||
sve-ioctls: CFLAGS += $(CROSS_CC_HAS_SVE)
|
||||
|
||||
sha512-sve: CFLAGS=-O3 -march=armv8.1-a+sve
|
||||
sha512-sve: sha512.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
sve-str: CFLAGS=-O1 -march=armv8.1-a+sve
|
||||
sve-str: sve-str.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
TESTS += sha512-sve sve-str
|
||||
|
||||
ifneq ($(GDB),)
|
||||
GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
|
||||
|
||||
run-gdbstub-sysregs: sysregs
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \
|
||||
basic gdbstub SVE support)
|
||||
|
||||
run-gdbstub-sve-ioctls: sve-ioctls
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
|
||||
basic gdbstub SVE ZLEN support)
|
||||
|
||||
EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
|
||||
|
||||
ifneq ($(CROSS_AS_HAS_ARMV9_SME),)
|
||||
# SME gdbstub tests
|
||||
|
||||
run-gdbstub-sysregs-sme: sysregs
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-sme.py \
|
||||
-- test_sme --gdb_basic_za_test, \
|
||||
basic gdbstub SME support)
|
||||
|
||||
ifeq ($(GDB_HAS_SME_TILES),y)
|
||||
run-gdbstub-sysregs-sme-tile-slice: sysregs
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-sme.py \
|
||||
-- test_sme --gdb_tile_slice_test, \
|
||||
gdbstub SME ZA tile slice support)
|
||||
else
|
||||
run-gdbstub-sysregs-sme-tile-slice: sysregs
|
||||
$(call skip-test,"gdbstub SME ZA tile slice support", \
|
||||
"selected gdb ($(GDB)) does not support SME ZA tile slices")
|
||||
endif
|
||||
|
||||
run-gdbstub-sysregs-sme2: sysregs
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-sme2.py, \
|
||||
gdbstub SME ZA tile slice support)
|
||||
|
||||
EXTRA_RUNS += run-gdbstub-sysregs-sme run-gdbstub-sysregs-sme-tile-slice run-gdbstub-sysregs-sme2
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(GDB_HAS_MTE),y)
|
||||
run-gdbstub-mte: mte-8
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-mte.py \
|
||||
-- --mode=user, \
|
||||
gdbstub MTE support)
|
||||
|
||||
EXTRA_RUNS += run-gdbstub-mte
|
||||
endif
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_SVE2),)
|
||||
SVE2_TESTS = test-826 sve-while-ptr
|
||||
$(SVE2_TESTS): CFLAGS += $(CROSS_CC_HAS_SVE2)
|
||||
AARCH64_TESTS += $(SVE2_TESTS)
|
||||
endif
|
||||
|
||||
TESTS += $(AARCH64_TESTS)
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Branch target identification, basic notskip cases.
|
||||
*/
|
||||
|
||||
#include "bti-crt.c.inc"
|
||||
|
||||
static void skip2_sigill(int sig, siginfo_t *info, ucontext_t *uc)
|
||||
{
|
||||
uc->uc_mcontext.pc += 8;
|
||||
uc->uc_mcontext.pstate = 1;
|
||||
}
|
||||
|
||||
#define NOP "nop"
|
||||
#define BTI_N "hint #32"
|
||||
#define BTI_C "hint #34"
|
||||
#define BTI_J "hint #36"
|
||||
#define BTI_JC "hint #38"
|
||||
|
||||
#define BTYPE_1(DEST) \
|
||||
asm("mov %w0,#1; adr x16, 1f; br x16; 1: " DEST "; mov %w0,#0" \
|
||||
: "=r"(skipped) : : "x16")
|
||||
|
||||
#define BTYPE_2(DEST) \
|
||||
asm("mov %w0,#1; adr x16, 1f; blr x16; 1: " DEST "; mov %w0,#0" \
|
||||
: "=r"(skipped) : : "x16", "x30")
|
||||
|
||||
#define BTYPE_3(DEST) \
|
||||
asm("mov %w0,#1; adr x15, 1f; br x15; 1: " DEST "; mov %w0,#0" \
|
||||
: "=r"(skipped) : : "x15")
|
||||
|
||||
#define TEST(WHICH, DEST, EXPECT) \
|
||||
do { WHICH(DEST); fail += skipped ^ EXPECT; } while (0)
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
int fail = 0;
|
||||
int skipped;
|
||||
|
||||
/* Signal-like with SA_SIGINFO. */
|
||||
signal_info(SIGILL, skip2_sigill);
|
||||
|
||||
TEST(BTYPE_1, NOP, 1);
|
||||
TEST(BTYPE_1, BTI_N, 1);
|
||||
TEST(BTYPE_1, BTI_C, 0);
|
||||
TEST(BTYPE_1, BTI_J, 0);
|
||||
TEST(BTYPE_1, BTI_JC, 0);
|
||||
|
||||
TEST(BTYPE_2, NOP, 1);
|
||||
TEST(BTYPE_2, BTI_N, 1);
|
||||
TEST(BTYPE_2, BTI_C, 0);
|
||||
TEST(BTYPE_2, BTI_J, 1);
|
||||
TEST(BTYPE_2, BTI_JC, 0);
|
||||
|
||||
TEST(BTYPE_3, NOP, 1);
|
||||
TEST(BTYPE_3, BTI_N, 1);
|
||||
TEST(BTYPE_3, BTI_C, 1);
|
||||
TEST(BTYPE_3, BTI_J, 0);
|
||||
TEST(BTYPE_3, BTI_JC, 0);
|
||||
|
||||
return fail;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Branch target identification, basic notskip cases.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#ifndef PROT_BTI
|
||||
#define PROT_BTI 0x10
|
||||
#endif
|
||||
|
||||
static void skip2_sigill(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
ucontext_t *uc = vuc;
|
||||
uc->uc_mcontext.pc += 8;
|
||||
uc->uc_mcontext.pstate = 1;
|
||||
}
|
||||
|
||||
#define NOP "nop"
|
||||
#define BTI_N "hint #32"
|
||||
#define BTI_C "hint #34"
|
||||
#define BTI_J "hint #36"
|
||||
#define BTI_JC "hint #38"
|
||||
|
||||
#define BTYPE_1(DEST) \
|
||||
"mov x1, #1\n\t" \
|
||||
"adr x16, 1f\n\t" \
|
||||
"br x16\n" \
|
||||
"1: " DEST "\n\t" \
|
||||
"mov x1, #0"
|
||||
|
||||
#define BTYPE_2(DEST) \
|
||||
"mov x1, #1\n\t" \
|
||||
"adr x16, 1f\n\t" \
|
||||
"blr x16\n" \
|
||||
"1: " DEST "\n\t" \
|
||||
"mov x1, #0"
|
||||
|
||||
#define BTYPE_3(DEST) \
|
||||
"mov x1, #1\n\t" \
|
||||
"adr x15, 1f\n\t" \
|
||||
"br x15\n" \
|
||||
"1: " DEST "\n\t" \
|
||||
"mov x1, #0"
|
||||
|
||||
#define TEST(WHICH, DEST, EXPECT) \
|
||||
WHICH(DEST) "\n" \
|
||||
".if " #EXPECT "\n\t" \
|
||||
"eor x1, x1," #EXPECT "\n" \
|
||||
".endif\n\t" \
|
||||
"add x0, x0, x1\n\t"
|
||||
|
||||
asm("\n"
|
||||
"test_begin:\n\t"
|
||||
BTI_C "\n\t"
|
||||
"mov x2, x30\n\t"
|
||||
"mov x0, #0\n\t"
|
||||
|
||||
TEST(BTYPE_1, NOP, 1)
|
||||
TEST(BTYPE_1, BTI_N, 1)
|
||||
TEST(BTYPE_1, BTI_C, 0)
|
||||
TEST(BTYPE_1, BTI_J, 0)
|
||||
TEST(BTYPE_1, BTI_JC, 0)
|
||||
|
||||
TEST(BTYPE_2, NOP, 1)
|
||||
TEST(BTYPE_2, BTI_N, 1)
|
||||
TEST(BTYPE_2, BTI_C, 0)
|
||||
TEST(BTYPE_2, BTI_J, 1)
|
||||
TEST(BTYPE_2, BTI_JC, 0)
|
||||
|
||||
TEST(BTYPE_3, NOP, 1)
|
||||
TEST(BTYPE_3, BTI_N, 1)
|
||||
TEST(BTYPE_3, BTI_C, 1)
|
||||
TEST(BTYPE_3, BTI_J, 0)
|
||||
TEST(BTYPE_3, BTI_JC, 0)
|
||||
|
||||
"ret x2\n"
|
||||
"test_end:"
|
||||
);
|
||||
|
||||
int main()
|
||||
{
|
||||
struct sigaction sa;
|
||||
void *tb, *te;
|
||||
|
||||
void *p = mmap(0, getpagesize(),
|
||||
PROT_EXEC | PROT_READ | PROT_WRITE | PROT_BTI,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (p == MAP_FAILED) {
|
||||
perror("mmap");
|
||||
return 1;
|
||||
}
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = skip2_sigill;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
if (sigaction(SIGILL, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* ??? With "extern char test_begin[]", some compiler versions
|
||||
* will use :got references, and some linker versions will
|
||||
* resolve this reference to a static symbol incorrectly.
|
||||
* Bypass this error by using a pc-relative reference directly.
|
||||
*/
|
||||
asm("adr %0, test_begin; adr %1, test_end" : "=r"(tb), "=r"(te));
|
||||
|
||||
memcpy(p, tb, te - tb);
|
||||
|
||||
return ((int (*)(void))p)();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* BTI vs PACIASP
|
||||
*/
|
||||
|
||||
#include "bti-crt.c.inc"
|
||||
|
||||
static void skip2_sigill(int sig, siginfo_t *info, ucontext_t *uc)
|
||||
{
|
||||
uc->uc_mcontext.pc += 8;
|
||||
uc->uc_mcontext.pstate = 1;
|
||||
}
|
||||
|
||||
#define BTYPE_1() \
|
||||
asm("mov %w0,#1; adr x16, 1f; br x16; 1: hint #25; mov %w0,#0" \
|
||||
: "=r"(skipped) : : "x16", "x30")
|
||||
|
||||
#define BTYPE_2() \
|
||||
asm("mov %w0,#1; adr x16, 1f; blr x16; 1: hint #25; mov %w0,#0" \
|
||||
: "=r"(skipped) : : "x16", "x30")
|
||||
|
||||
#define BTYPE_3() \
|
||||
asm("mov %w0,#1; adr x15, 1f; br x15; 1: hint #25; mov %w0,#0" \
|
||||
: "=r"(skipped) : : "x15", "x30")
|
||||
|
||||
#define TEST(WHICH, EXPECT) \
|
||||
do { WHICH(); fail += skipped ^ EXPECT; } while (0)
|
||||
|
||||
int main()
|
||||
{
|
||||
int fail = 0;
|
||||
int skipped;
|
||||
|
||||
/* Signal-like with SA_SIGINFO. */
|
||||
signal_info(SIGILL, skip2_sigill);
|
||||
|
||||
/* With SCTLR_EL1.BT0 set, PACIASP is not compatible with type=3. */
|
||||
TEST(BTYPE_1, 0);
|
||||
TEST(BTYPE_2, 0);
|
||||
TEST(BTYPE_3, 1);
|
||||
|
||||
return fail;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Minimal user-environment for testing BTI.
|
||||
*
|
||||
* Normal libc is not (yet) built with BTI support enabled,
|
||||
* and so could generate a BTI TRAP before ever reaching main.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <ucontext.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
int main(void);
|
||||
|
||||
void _start(void)
|
||||
{
|
||||
exit(main());
|
||||
}
|
||||
|
||||
void exit(int ret)
|
||||
{
|
||||
register int x0 __asm__("x0") = ret;
|
||||
register int x8 __asm__("x8") = __NR_exit;
|
||||
|
||||
asm volatile("svc #0" : : "r"(x0), "r"(x8));
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
/*
|
||||
* Irritatingly, the user API struct sigaction does not match the
|
||||
* kernel API struct sigaction. So for simplicity, isolate the
|
||||
* kernel ABI here, and make this act like signal.
|
||||
*/
|
||||
void signal_info(int sig, void (*fn)(int, siginfo_t *, ucontext_t *))
|
||||
{
|
||||
struct kernel_sigaction {
|
||||
void (*handler)(int, siginfo_t *, ucontext_t *);
|
||||
unsigned long flags;
|
||||
unsigned long restorer;
|
||||
unsigned long mask;
|
||||
} sa = { fn, SA_SIGINFO, 0, 0 };
|
||||
|
||||
register int x0 __asm__("x0") = sig;
|
||||
register void *x1 __asm__("x1") = &sa;
|
||||
register void *x2 __asm__("x2") = 0;
|
||||
register int x3 __asm__("x3") = sizeof(unsigned long);
|
||||
register int x8 __asm__("x8") = __NR_rt_sigaction;
|
||||
|
||||
asm volatile("svc #0"
|
||||
: : "r"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x8) : "memory");
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Test execution of DC CVADP instruction.
|
||||
*
|
||||
* Copyright (c) 2023 Zhuojia Shen <[email protected]>
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
#include <sys/auxv.h>
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef HWCAP2_DCPODP
|
||||
#define HWCAP2_DCPODP (1 << 0)
|
||||
#endif
|
||||
|
||||
bool should_fail = false;
|
||||
|
||||
static void signal_handler(int sig, siginfo_t *si, void *data)
|
||||
{
|
||||
ucontext_t *uc = (ucontext_t *)data;
|
||||
|
||||
if (should_fail) {
|
||||
uc->uc_mcontext.pc += 4;
|
||||
} else {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static int do_dc_cvadp(void)
|
||||
{
|
||||
struct sigaction sa = {
|
||||
.sa_flags = SA_SIGINFO,
|
||||
.sa_sigaction = signal_handler,
|
||||
};
|
||||
|
||||
sigemptyset(&sa.sa_mask);
|
||||
if (sigaction(SIGSEGV, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
asm volatile("dc cvadp, %0\n\t" :: "r"(&sa));
|
||||
|
||||
should_fail = true;
|
||||
asm volatile("dc cvadp, %0\n\t" :: "r"(NULL));
|
||||
should_fail = false;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (getauxval(AT_HWCAP2) & HWCAP2_DCPODP) {
|
||||
return do_dc_cvadp();
|
||||
} else {
|
||||
printf("SKIP: no HWCAP2_DCPODP on this system\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Test execution of DC CVAP instruction.
|
||||
*
|
||||
* Copyright (c) 2023 Zhuojia Shen <[email protected]>
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
#include <sys/auxv.h>
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef HWCAP_DCPOP
|
||||
#define HWCAP_DCPOP (1 << 16)
|
||||
#endif
|
||||
|
||||
bool should_fail = false;
|
||||
|
||||
static void signal_handler(int sig, siginfo_t *si, void *data)
|
||||
{
|
||||
ucontext_t *uc = (ucontext_t *)data;
|
||||
|
||||
if (should_fail) {
|
||||
uc->uc_mcontext.pc += 4;
|
||||
} else {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static int do_dc_cvap(void)
|
||||
{
|
||||
struct sigaction sa = {
|
||||
.sa_flags = SA_SIGINFO,
|
||||
.sa_sigaction = signal_handler,
|
||||
};
|
||||
|
||||
sigemptyset(&sa.sa_mask);
|
||||
if (sigaction(SIGSEGV, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
asm volatile("dc cvap, %0\n\t" :: "r"(&sa));
|
||||
|
||||
should_fail = true;
|
||||
asm volatile("dc cvap, %0\n\t" :: "r"(NULL));
|
||||
should_fail = false;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (getauxval(AT_HWCAP) & HWCAP_DCPOP) {
|
||||
return do_dc_cvap();
|
||||
} else {
|
||||
printf("SKIP: no HWCAP_DCPOP on this system\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,988 @@
|
||||
### Rounding to nearest
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-inf:0xff800000) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000000000000000000p-25:0x33000000) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe600000000000000p-25:0x337ffff3) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801a00000000000000p-15:0x387fc00d) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000c00000000000000p-14:0x38800006) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0a800000000000000p+1:0x402df854) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb600000000000000p+1:0x40490fdb) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.00000000000000000000p+31:0x4f000000) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (OK)
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (OK)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(inf:0x7f800000) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding upwards
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000200000000000000p-25:0x33000001) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe800000000000000p-25:0x337ffff4) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801c00000000000000p-15:0x387fc00e) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000e00000000000000p-14:0x38800007) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-149:0x00000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x1.00000000000000000000p-149:0x00000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x1.00000000000000000000p-149:0x00000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0aa00000000000000p+1:0x402df855) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb600000000000000p+1:0x40490fdb) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.00000000000000000000p+31:0x4f000000) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (OK)
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (OK)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(inf:0x7f800000) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding downwards
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-inf:0xff800000) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-149:0x80000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000000000000000000p-25:0x33000000) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe600000000000000p-25:0x337ffff3) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801a00000000000000p-15:0x387fc00d) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000c00000000000000p-14:0x38800006) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0a800000000000000p+1:0x402df854) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb400000000000000p+1:0x40490fda) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.fffffe00000000000000p+30:0x4effffff) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (OK)
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (OK)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding to zero
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (OK)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000000000000000000p-25:0x33000000) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe600000000000000p-25:0x337ffff3) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801a00000000000000p-15:0x387fc00d) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000c00000000000000p-14:0x38800006) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0a800000000000000p+1:0x402df854) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb400000000000000p+1:0x40490fda) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.fffffe00000000000000p+30:0x4effffff) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (OK)
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (OK)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
Executable
+748
@@ -0,0 +1,748 @@
|
||||
### Rounding to nearest
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding upwards
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding downwards
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding to zero
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: -9223372036854775808 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (OK)
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (OK)
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (OK)
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (OK)
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (OK)
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (OK)
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (OK)
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (OK)
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (OK)
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (OK)
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (OK)
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (OK)
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (OK)
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (OK)
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (OK)
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: 9223372036854775807 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
@@ -0,0 +1,768 @@
|
||||
### Rounding to nearest
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27fa00000000000000p+60:0x5d8613fd) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46200000000000000p+34:0x50936231) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f94000000000000000p-106:0x0ac8fca0) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f75000000000000000p-40:0xab98fba8) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x0.00000000000000000000p+0:0x80000000) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe600000000000000p-25:0x337ffff3) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe600000000000000p-50:0x26fffff3) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.0007fe00000000000000p-25:0x330003ff) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f200000000000000p-24:0x338000f9) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000c00000000000000p-14:0x38800006) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf400000000000000p-24:0x3387fdfa) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801c00000000000000p-15:0x387fc00e) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000000000000000000p+0:0x3f800000) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040200000000000000p+0:0x3f800201) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d200000000000000p+2:0x409711e9) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804200000000000000p+3:0x41094021) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458000000000000000p+3:0x4128a2c0) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0400000000000000p+3:0x41100602) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1400000000000000p+15:0x477fe78a) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3c00000000000000p+17:0x4848f69e) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56000000000000000p+17:0x482de2b0) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edf000000000000000p+18:0x488476f8) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0800000000000000p+31:0x4f7fbf04) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7a00000000000000p+18:0x4884773d) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+31:0x4f7fc004) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840800000000000000p+31:0x4f7fc204) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+31:0x4f7fc104) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860800000000000000p+31:0x4f7fc304) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+32:0x4fffc104) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+32:0x4fffc004) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830800000000000000p+32:0x4fffc184) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8800000000000000p+33:0x507fbfc4) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840800000000000000p+32:0x4fffc204) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800800000000000000p+33:0x507fc004) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820800000000000000p+33:0x507fc104) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810800000000000000p+33:0x507fc084) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab600000000000000p+99:0x71605d5b) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0838000000000000000p+116:0x79e041c0) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c0829e00000000000000p+116:0x79e0414f) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (32/0)
|
||||
### Rounding upwards
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27fa00000000000000p+60:0x5d8613fd) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46200000000000000p+34:0x50936231) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f94000000000000000p-106:0x0ac8fca0) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f74e00000000000000p-40:0xab98fba7) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544200000000000000p-66:0x9ea82a21) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x0.00000000000000000000p+0:0x80000000) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe800000000000000p-25:0x337ffff4) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe800000000000000p-50:0x26fffff4) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000200000000000000p-25:0x33000001) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801c00000000000000p-15:0x387fc00e) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00080000000000000000p-25:0x33000400) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f400000000000000p-24:0x338000fa) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000e00000000000000p-14:0x38800007) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf600000000000000p-24:0x3387fdfb) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801c00000000000000p-15:0x387fc00e) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000200000000000000p+0:0x3f800001) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01a00000000000000p-14:0x38ffe00d) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01a00000000000000p-14:0x38ffe00d) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440200000000000000p+0:0x3f802201) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440200000000000000p+0:0x3f802201) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040200000000000000p+0:0x3f800201) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d400000000000000p+2:0x409711ea) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804200000000000000p+3:0x41094021) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458200000000000000p+3:0x4128a2c1) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0600000000000000p+3:0x41100603) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1600000000000000p+15:0x477fe78b) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3c00000000000000p+17:0x4848f69e) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56200000000000000p+17:0x482de2b1) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edf000000000000000p+18:0x488476f8) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0a00000000000000p+31:0x4f7fbf05) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7a00000000000000p+18:0x4884773d) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800a00000000000000p+31:0x4f7fc005) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840800000000000000p+31:0x4f7fc204) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+31:0x4f7fc104) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860800000000000000p+31:0x4f7fc304) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+32:0x4fffc104) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800a00000000000000p+32:0x4fffc005) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830800000000000000p+32:0x4fffc184) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8a00000000000000p+33:0x507fbfc5) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840800000000000000p+32:0x4fffc204) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800a00000000000000p+33:0x507fc005) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820800000000000000p+33:0x507fc104) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810800000000000000p+33:0x507fc084) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab800000000000000p+99:0x71605d5c) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0838000000000000000p+116:0x79e041c0) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c082a000000000000000p+116:0x79e04150) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-148:0x00000002) flags=UNDERFLOW INEXACT (32/0)
|
||||
### Rounding downwards
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27f800000000000000p+60:0x5d8613fc) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46000000000000000p+34:0x50936230) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f93e00000000000000p-106:0x0ac8fc9f) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f75000000000000000p-40:0xab98fba8) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x1.00000000000000000000p-149:0x80000001) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe600000000000000p-25:0x337ffff3) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe600000000000000p-50:0x26fffff3) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.0007fe00000000000000p-25:0x330003ff) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f200000000000000p-24:0x338000f9) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000c00000000000000p-14:0x38800006) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf400000000000000p-24:0x3387fdfa) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000000000000000000p+0:0x3f800000) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040000000000000000p+0:0x3f800200) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d200000000000000p+2:0x409711e9) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804000000000000000p+3:0x41094020) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458000000000000000p+3:0x4128a2c0) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0400000000000000p+3:0x41100602) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1400000000000000p+15:0x477fe78a) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3a00000000000000p+17:0x4848f69d) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56000000000000000p+17:0x482de2b0) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edee00000000000000p+18:0x488476f7) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0800000000000000p+31:0x4f7fbf04) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7800000000000000p+18:0x4884773c) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+31:0x4f7fc004) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840600000000000000p+31:0x4f7fc203) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+31:0x4f7fc103) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860600000000000000p+31:0x4f7fc303) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+32:0x4fffc103) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+32:0x4fffc004) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830600000000000000p+32:0x4fffc183) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8800000000000000p+33:0x507fbfc4) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840600000000000000p+32:0x4fffc203) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800800000000000000p+33:0x507fc004) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820600000000000000p+33:0x507fc103) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810600000000000000p+33:0x507fc083) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab600000000000000p+99:0x71605d5b) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0837e00000000000000p+116:0x79e041bf) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c0829e00000000000000p+116:0x79e0414f) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (32/0)
|
||||
### Rounding to zero
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27f800000000000000p+60:0x5d8613fc) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46000000000000000p+34:0x50936230) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f93e00000000000000p-106:0x0ac8fc9f) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f74e00000000000000p-40:0xab98fba7) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544200000000000000p-66:0x9ea82a21) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x0.00000000000000000000p+0:0x80000000) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe600000000000000p-25:0x337ffff3) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe600000000000000p-50:0x26fffff3) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.0007fe00000000000000p-25:0x330003ff) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f200000000000000p-24:0x338000f9) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000c00000000000000p-14:0x38800006) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf400000000000000p-24:0x3387fdfa) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000000000000000000p+0:0x3f800000) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040000000000000000p+0:0x3f800200) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d200000000000000p+2:0x409711e9) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804000000000000000p+3:0x41094020) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458000000000000000p+3:0x4128a2c0) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0400000000000000p+3:0x41100602) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1400000000000000p+15:0x477fe78a) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3a00000000000000p+17:0x4848f69d) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56000000000000000p+17:0x482de2b0) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edee00000000000000p+18:0x488476f7) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0800000000000000p+31:0x4f7fbf04) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7800000000000000p+18:0x4884773c) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+31:0x4f7fc004) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840600000000000000p+31:0x4f7fc203) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+31:0x4f7fc103) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860600000000000000p+31:0x4f7fc303) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+32:0x4fffc103) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+32:0x4fffc004) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830600000000000000p+32:0x4fffc183) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8800000000000000p+33:0x507fbfc4) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840600000000000000p+32:0x4fffc203) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800800000000000000p+33:0x507fc004) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820600000000000000p+33:0x507fc103) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810600000000000000p+33:0x507fc083) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab600000000000000p+99:0x71605d5b) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0837e00000000000000p+116:0x79e041bf) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c0829e00000000000000p+116:0x79e0414f) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (32/0)
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Linux kernel fallback API definitions for GCS and test helpers.
|
||||
*
|
||||
* Copyright (c) 2025 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#ifndef PR_GET_SHADOW_STACK_STATUS
|
||||
#define PR_GET_SHADOW_STACK_STATUS 74
|
||||
#endif
|
||||
#ifndef PR_SET_SHADOW_STACK_STATUS
|
||||
#define PR_SET_SHADOW_STACK_STATUS 75
|
||||
#endif
|
||||
#ifndef PR_LOCK_SHADOW_STACK_STATUS
|
||||
#define PR_LOCK_SHADOW_STACK_STATUS 76
|
||||
#endif
|
||||
#ifndef PR_SHADOW_STACK_ENABLE
|
||||
# define PR_SHADOW_STACK_ENABLE (1 << 0)
|
||||
# define PR_SHADOW_STACK_WRITE (1 << 1)
|
||||
# define PR_SHADOW_STACK_PUSH (1 << 2)
|
||||
#endif
|
||||
#ifndef SHADOW_STACK_SET_TOKEN
|
||||
#define SHADOW_STACK_SET_TOKEN (1 << 0)
|
||||
#endif
|
||||
#ifndef SHADOW_STACK_SET_MARKER
|
||||
#define SHADOW_STACK_SET_MARKER (1 << 1)
|
||||
#endif
|
||||
#ifndef SEGV_CPERR
|
||||
#define SEGV_CPERR 10
|
||||
#endif
|
||||
#ifndef __NR_map_shadow_stack
|
||||
#define __NR_map_shadow_stack 453
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros, and implement the syscall inline, lest we fail
|
||||
* the checked return from any function call.
|
||||
*/
|
||||
#define enable_gcs(flags) \
|
||||
do { \
|
||||
register long num __asm__ ("x8") = __NR_prctl; \
|
||||
register long arg1 __asm__ ("x0") = PR_SET_SHADOW_STACK_STATUS; \
|
||||
register long arg2 __asm__ ("x1") = PR_SHADOW_STACK_ENABLE | flags; \
|
||||
register long arg3 __asm__ ("x2") = 0; \
|
||||
register long arg4 __asm__ ("x3") = 0; \
|
||||
register long arg5 __asm__ ("x4") = 0; \
|
||||
asm volatile("svc #0" \
|
||||
: "+r"(arg1) \
|
||||
: "r"(arg2), "r"(arg3), "r"(arg4), "r"(arg5), "r"(num) \
|
||||
: "memory", "cc"); \
|
||||
if (arg1) { \
|
||||
errno = -arg1; \
|
||||
perror("PR_SET_SHADOW_STACK_STATUS"); \
|
||||
exit(2); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define gcspr() \
|
||||
({ uint64_t *r; asm volatile("mrs %0, s3_3_c2_c5_1" : "=r"(r)); r; })
|
||||
|
||||
#define gcsss1(val) \
|
||||
do { \
|
||||
asm volatile("sys #3, c7, c7, #2, %0" : : "r"(val) : "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define gcsss2() \
|
||||
({ uint64_t *r; \
|
||||
asm volatile("sysl %0, #3, c7, c7, #3" : "=r"(r) : : "memory"); r; })
|
||||
@@ -0,0 +1,71 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "gcs.h"
|
||||
|
||||
|
||||
#define GCSPUSHM "sys #3, c7, c7, #0, %[push]"
|
||||
#define GCSPOPM "sysl %[pop], #3, c7, c7, #1"
|
||||
|
||||
static void test_sigsegv(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
ucontext_t *uc = vuc;
|
||||
uint64_t inst_sigsegv;
|
||||
|
||||
__asm__("adr %0, inst_sigsegv" : "=r"(inst_sigsegv));
|
||||
assert(uc->uc_mcontext.pc == inst_sigsegv);
|
||||
assert(info->si_code == SEGV_CPERR);
|
||||
/* TODO: Dig for ESR and verify syndrome. */
|
||||
uc->uc_mcontext.pc += 4;
|
||||
}
|
||||
|
||||
static void test_sigill(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
ucontext_t *uc = vuc;
|
||||
uint64_t inst_sigill;
|
||||
|
||||
__asm__("adr %0, inst_sigill" : "=r"(inst_sigill));
|
||||
assert(uc->uc_mcontext.pc == inst_sigill);
|
||||
assert(info->si_code == ILL_ILLOPC);
|
||||
uc->uc_mcontext.pc += 4;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
struct sigaction sa = { .sa_flags = SA_SIGINFO };
|
||||
uint64_t old, new;
|
||||
|
||||
sa.sa_sigaction = test_sigsegv;
|
||||
if (sigaction(SIGSEGV, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sa.sa_sigaction = test_sigill;
|
||||
if (sigaction(SIGILL, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Pushm is disabled -- SIGILL via EC_SYSTEMREGISTERTRAP */
|
||||
asm volatile("inst_sigill:\t" GCSPUSHM
|
||||
: : [push] "r" (1));
|
||||
|
||||
enable_gcs(PR_SHADOW_STACK_PUSH);
|
||||
|
||||
/* Valid value -- low 2 bits clear */
|
||||
old = 0xdeadbeeffeedcaec;
|
||||
asm volatile(GCSPUSHM "\n\t" GCSPOPM
|
||||
: [pop] "=r" (new)
|
||||
: [push] "r" (old)
|
||||
: "memory");
|
||||
assert(old == new);
|
||||
|
||||
/* Invalid value -- SIGSEGV via EC_GCS */
|
||||
asm volatile(GCSPUSHM "\n"
|
||||
"inst_sigsegv:\t" GCSPOPM
|
||||
: [pop] "=r" (new)
|
||||
: [push] "r" (1)
|
||||
: "memory");
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "gcs.h"
|
||||
|
||||
#define IN_PROGRESS(X) ((uint64_t)(X) | 5)
|
||||
#define CAP(X) (((uint64_t)(X) & ~0xfff) + 1)
|
||||
|
||||
static uint64_t * __attribute__((noinline)) recurse(size_t index)
|
||||
{
|
||||
if (index == 0) {
|
||||
return gcspr();
|
||||
}
|
||||
return recurse(index - 1);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
void *tmp;
|
||||
uint64_t *alt_stack, *alt_cap;
|
||||
uint64_t *orig_pr, *orig_cap;
|
||||
uint64_t *bottom;
|
||||
size_t pagesize = getpagesize();
|
||||
size_t words;
|
||||
|
||||
enable_gcs(0);
|
||||
orig_pr = gcspr();
|
||||
|
||||
/* Allocate a guard page before and after. */
|
||||
tmp = mmap(0, 3 * pagesize, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||
assert(tmp != MAP_FAILED);
|
||||
|
||||
/* map_shadow_stack won't replace existing mappings */
|
||||
munmap(tmp + pagesize, pagesize);
|
||||
|
||||
/* Allocate a new stack between the guards. */
|
||||
alt_stack = (uint64_t *)
|
||||
syscall(__NR_map_shadow_stack, tmp + pagesize, pagesize,
|
||||
SHADOW_STACK_SET_TOKEN);
|
||||
assert(alt_stack == tmp + pagesize);
|
||||
|
||||
words = pagesize / 8;
|
||||
alt_cap = alt_stack + words - 1;
|
||||
|
||||
/* SHADOW_STACK_SET_TOKEN set the cap. */
|
||||
assert(*alt_cap == CAP(alt_cap));
|
||||
|
||||
/* Swap to the alt stack, one step at a time. */
|
||||
gcsss1(alt_cap);
|
||||
|
||||
assert(gcspr() == alt_cap);
|
||||
assert(*alt_cap == IN_PROGRESS(orig_pr));
|
||||
|
||||
orig_cap = gcsss2();
|
||||
|
||||
assert(orig_cap == orig_pr - 1);
|
||||
assert(*orig_cap == CAP(orig_cap));
|
||||
assert(gcspr() == alt_stack + words);
|
||||
|
||||
/* We should be able to use the whole stack. */
|
||||
bottom = recurse(words - 1);
|
||||
assert(bottom == alt_stack);
|
||||
|
||||
/* We should be back where we started. */
|
||||
assert(gcspr() == alt_stack + words);
|
||||
|
||||
/* Swap back to the original stack. */
|
||||
gcsss1(orig_cap);
|
||||
tmp = gcsss2();
|
||||
|
||||
assert(gcspr() == orig_pr);
|
||||
assert(tmp == alt_cap);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "gcs.h"
|
||||
|
||||
/*
|
||||
* A single garbage store to the gcs stack.
|
||||
* The asm inside must be unique, so disallow inlining.
|
||||
*/
|
||||
void __attribute__((noinline))
|
||||
test_gcsstr(void)
|
||||
{
|
||||
register uint64_t *ptr __asm__("x0") = gcspr();
|
||||
/* GCSSTR x1, x0 */
|
||||
__asm__("inst_gcsstr: .inst 0xd91f1c01" : : "r"(--ptr));
|
||||
}
|
||||
|
||||
static void test_sigsegv(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
ucontext_t *uc = vuc;
|
||||
uint64_t inst_gcsstr;
|
||||
|
||||
__asm__("adr %0, inst_gcsstr" : "=r"(inst_gcsstr));
|
||||
assert(uc->uc_mcontext.pc == inst_gcsstr);
|
||||
assert(info->si_code == SEGV_CPERR);
|
||||
/* TODO: Dig for ESR and verify syndrome. */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
struct sigaction sa = {
|
||||
.sa_sigaction = test_sigsegv,
|
||||
.sa_flags = SA_SIGINFO,
|
||||
};
|
||||
|
||||
/* Enable GCSSTR and test the store succeeds. */
|
||||
enable_gcs(PR_SHADOW_STACK_WRITE);
|
||||
test_gcsstr();
|
||||
|
||||
/* Disable GCSSTR and test the resulting sigsegv. */
|
||||
enable_gcs(0);
|
||||
if (sigaction(SIGSEGV, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
exit(1);
|
||||
}
|
||||
test_gcsstr();
|
||||
abort();
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
#
|
||||
# Test GDB memory-tag commands that exercise the stubs for the qIsAddressTagged,
|
||||
# qMemTag, and QMemTag packets, which are used for manipulating allocation tags.
|
||||
# Logical tags-related commands rely on local operations, hence don't exercise
|
||||
# any stub and so are not used in this test.
|
||||
#
|
||||
# The test consists in breaking just after a tag is set in a specific memory
|
||||
# chunk, and then using the GDB 'memory-tagging' subcommands to set/get tags in
|
||||
# different memory locations and ranges in the MTE-enabled memory chunk.
|
||||
#
|
||||
# This is launched via tests/guest-debug/run-test.py
|
||||
#
|
||||
|
||||
|
||||
try:
|
||||
import gdb
|
||||
except ModuleNotFoundError:
|
||||
from sys import exit
|
||||
exit("This script must be launched via tests/guest-debug/run-test.py!")
|
||||
import re
|
||||
from sys import argv
|
||||
from test_gdbstub import arg_parser, main, report
|
||||
|
||||
|
||||
PATTERN_0 = r"Memory tags for address 0x[0-9a-f]+ match \(0x[0-9a-f]+\)."
|
||||
PATTERN_1 = r".*(0x[0-9a-f]+)"
|
||||
|
||||
|
||||
def run_test():
|
||||
p = arg_parser(prog="test-mte.py", description="TCG MTE tests.")
|
||||
p.add_argument("--mode", help="Run test for QEMU system or user mode.",
|
||||
required=True, choices=['system','user'])
|
||||
|
||||
args = p.parse_args(args=argv)
|
||||
|
||||
if args.mode == "system":
|
||||
# Break address: where to break before performing the tests
|
||||
# See mte.S for details about this label.
|
||||
ba = "main_end"
|
||||
# Tagged address: the start of the MTE-enabled memory chunk to be tested
|
||||
# 'tagged_addr' (x1) is a pointer to the MTE-enabled page. See mte.S.
|
||||
ta = "$x1"
|
||||
else: # mode="user"
|
||||
# Line 95 in mte-8.c
|
||||
ba = "95"
|
||||
# 'a' array. See mte-8.c
|
||||
ta = "a"
|
||||
|
||||
gdb.execute(f"break {ba}", False, True)
|
||||
gdb.execute("continue", False, True)
|
||||
|
||||
try:
|
||||
# Test if we can check correctly that the allocation tag for the address
|
||||
# in {ta} matches the logical tag in {ta}.
|
||||
co = gdb.execute(f"memory-tag check {ta}", False, True)
|
||||
tags_match = re.findall(PATTERN_0, co, re.MULTILINE)
|
||||
if tags_match:
|
||||
report(True, f"{tags_match[0]}")
|
||||
else:
|
||||
report(False, "Logical and allocation tags don't match!")
|
||||
|
||||
# Test allocation tag 'set and print' commands. Commands on logical
|
||||
# tags rely on local operation and so don't exercise any stub.
|
||||
|
||||
# Set the allocation tag for the first granule (16 bytes) of
|
||||
# address starting at {ta} address to a known value, i.e. 0x04.
|
||||
gdb.execute(f"memory-tag set-allocation-tag {ta} 1 04", False, True)
|
||||
|
||||
# Then set the allocation tag for the second granule to a known
|
||||
# value, i.e. 0x06. This tests that contiguous tag granules are
|
||||
# set correctly and don't run over each other.
|
||||
gdb.execute(f"memory-tag set-allocation-tag {ta}+16 1 06", False, True)
|
||||
|
||||
# Read the known values back and check if they remain the same.
|
||||
|
||||
co = gdb.execute(f"memory-tag print-allocation-tag {ta}", False, True)
|
||||
first_tag = re.match(PATTERN_1, co)[1]
|
||||
|
||||
co = gdb.execute(f"memory-tag print-allocation-tag {ta}+16", False, True)
|
||||
second_tag = re.match(PATTERN_1, co)[1]
|
||||
|
||||
if first_tag == "0x4" and second_tag == "0x6":
|
||||
report(True, "Allocation tags are correctly set/printed.")
|
||||
else:
|
||||
report(False, "Can't set/print allocation tags!")
|
||||
|
||||
# Now test fill pattern by setting a whole page with a pattern.
|
||||
gdb.execute(f"memory-tag set-allocation-tag {ta} 4096 0a0b", False, True)
|
||||
|
||||
# And read back the tags of the last two granules in page so
|
||||
# we also test if the pattern is set correctly up to the end of
|
||||
# the page.
|
||||
co = gdb.execute(f"memory-tag print-allocation-tag {ta}+4096-32", False, True)
|
||||
tag = re.match(PATTERN_1, co)[1]
|
||||
|
||||
co = gdb.execute(f"memory-tag print-allocation-tag {ta}+4096-16", False, True)
|
||||
last_tag = re.match(PATTERN_1, co)[1]
|
||||
|
||||
if tag == "0xa" and last_tag == "0xb":
|
||||
report(True, "Fill pattern is ok.")
|
||||
else:
|
||||
report(False, "Fill pattern failed!")
|
||||
|
||||
except gdb.error:
|
||||
# This usually happens because a GDB version that does not support
|
||||
# memory tagging was used to run the test.
|
||||
report(False, "'memory-tag' command failed!")
|
||||
|
||||
|
||||
main(run_test, expected_arch="aarch64")
|
||||
@@ -0,0 +1,117 @@
|
||||
#
|
||||
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#
|
||||
# Test the SME registers are visible and changeable via gdbstub
|
||||
#
|
||||
# This is launched via tests/guest-debug/run-test.py
|
||||
#
|
||||
|
||||
import argparse
|
||||
import gdb
|
||||
from test_gdbstub import main, report
|
||||
|
||||
MAGIC = 0x01020304
|
||||
BASIC_ZA_TEST = 0
|
||||
TILE_SLICE_TEST = 0
|
||||
|
||||
|
||||
def run_test():
|
||||
"""Run the requested test(s) for SME ZA gdbstub support"""
|
||||
|
||||
if BASIC_ZA_TEST:
|
||||
run_basic_sme_za_gdbstub_support_test()
|
||||
if TILE_SLICE_TEST:
|
||||
run_basic_sme_za_tile_slice_gdbstub_support_test()
|
||||
|
||||
|
||||
def run_basic_sme_za_gdbstub_support_test():
|
||||
"""Test reads and writes to the SME ZA register at the byte level"""
|
||||
|
||||
frame = gdb.selected_frame()
|
||||
rname = "za"
|
||||
za = frame.read_register(rname)
|
||||
report(True, "Reading %s" % rname)
|
||||
|
||||
# Writing to the ZA register, byte by byte.
|
||||
for i in range(0, 16):
|
||||
for j in range(0, 16):
|
||||
cmd = "set $za[%d][%d] = 0x01" % (i, j)
|
||||
gdb.execute(cmd)
|
||||
report(True, "%s" % cmd)
|
||||
|
||||
# Reading from the ZA register, byte by byte.
|
||||
for i in range(0, 16):
|
||||
for j in range(0, 16):
|
||||
reg = "$za[%d][%d]" % (i, j)
|
||||
v = gdb.parse_and_eval(reg)
|
||||
report(str(v.type) == "uint8_t", "size of %s" % (reg))
|
||||
report(v == 0x1, "%s is 0x%x" % (reg, 0x1))
|
||||
|
||||
|
||||
def run_basic_sme_za_tile_slice_gdbstub_support_test():
|
||||
"""Test reads and writes of SME ZA horizontal and vertical tile slices
|
||||
|
||||
Test if SME ZA tile slices, both horizontal and vertical,
|
||||
can be correctly read and written to. The sizes to test
|
||||
are quadwords and doublewords.
|
||||
"""
|
||||
|
||||
sizes = {}
|
||||
sizes["q"] = "uint128_t"
|
||||
sizes["d"] = "uint64_t"
|
||||
|
||||
# Accessing requested sizes of elements of ZA
|
||||
for size in sizes:
|
||||
|
||||
# Accessing various ZA tiles
|
||||
for i in range(0, 4):
|
||||
|
||||
# Accessing various horizontal slices for each ZA tile
|
||||
for j in range(0, 4):
|
||||
# Writing to various elements in each tile slice
|
||||
for k in range(0, 4):
|
||||
cmd = "set $za%dh%c%d[%d] = 0x%x" % (i, size, j, k, MAGIC)
|
||||
gdb.execute(cmd)
|
||||
report(True, "%s" % cmd)
|
||||
|
||||
# Reading from the written elements in each tile slice
|
||||
for k in range(0, 4):
|
||||
reg = "$za%dh%c%d[%d]" % (i, size, j, k)
|
||||
v = gdb.parse_and_eval(reg)
|
||||
report(str(v.type) == sizes[size], "size of %s" % (reg))
|
||||
report(v == MAGIC, "%s is 0x%x" % (reg, MAGIC))
|
||||
|
||||
# Accessing various vertical slices for each ZA tile
|
||||
for j in range(0, 4):
|
||||
# Writing to various elements in each tile slice
|
||||
for k in range(0, 4):
|
||||
cmd = "set $za%dv%c%d[%d] = 0x%x" % (i, size, j, k, MAGIC)
|
||||
gdb.execute(cmd)
|
||||
report(True, "%s" % cmd)
|
||||
|
||||
# Reading from the written elements in each tile slice
|
||||
for k in range(0, 4):
|
||||
reg = "$za%dv%c%d[%d]" % (i, size, j, k)
|
||||
v = gdb.parse_and_eval(reg)
|
||||
report(str(v.type) == sizes[size], "size of %s" % (reg))
|
||||
report(v == MAGIC, "%s is 0x%x" % (reg, MAGIC))
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description="A gdbstub test for SME support")
|
||||
parser.add_argument("--gdb_basic_za_test",
|
||||
help="Enable test for basic SME ZA support",
|
||||
action="store_true")
|
||||
parser.add_argument("--gdb_tile_slice_test",
|
||||
help="Enable test for ZA tile slice support",
|
||||
action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.gdb_basic_za_test:
|
||||
BASIC_ZA_TEST = 1
|
||||
if args.gdb_tile_slice_test:
|
||||
TILE_SLICE_TEST = 1
|
||||
|
||||
main(run_test, expected_arch="aarch64")
|
||||
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Copyright (C) 2025 Linaro Ltd.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#
|
||||
# Test the SME2 registers are visible and changeable via gdbstub
|
||||
#
|
||||
# This is launched via tests/guest-debug/run-test.py
|
||||
#
|
||||
|
||||
import gdb
|
||||
from test_gdbstub import main, report
|
||||
|
||||
|
||||
def run_test():
|
||||
"""Test reads and writes of the SME2 registers"""
|
||||
frame = gdb.selected_frame()
|
||||
rname = "zt0"
|
||||
zt0 = frame.read_register(rname)
|
||||
report(True, "Reading %s" % rname)
|
||||
|
||||
# Writing to the ZT0 register, byte by byte.
|
||||
for i in range(0, 64):
|
||||
cmd = "set $zt0[%d] = 0x01" % (i)
|
||||
gdb.execute(cmd)
|
||||
report(True, "%s" % cmd)
|
||||
|
||||
# Reading from the ZT0 register, byte by byte.
|
||||
for i in range(0, 64):
|
||||
reg = "$zt0[%d]" % (i)
|
||||
v = gdb.parse_and_eval(reg)
|
||||
report(str(v.type) == "uint8_t", "size of %s" % (reg))
|
||||
report(v == 0x1, "%s is 0x%x" % (reg, 0x1))
|
||||
|
||||
main(run_test, expected_arch="aarch64")
|
||||
@@ -0,0 +1,58 @@
|
||||
#
|
||||
# Test the SVE ZReg reports the right amount of data. It uses the
|
||||
# sve-ioctl test and examines the register data each time the
|
||||
# __sve_ld_done breakpoint is hit.
|
||||
#
|
||||
# This is launched via tests/guest-debug/run-test.py
|
||||
#
|
||||
|
||||
import gdb
|
||||
from test_gdbstub import main, report
|
||||
|
||||
initial_vlen = 0
|
||||
|
||||
|
||||
class TestBreakpoint(gdb.Breakpoint):
|
||||
def __init__(self, sym_name="__sve_ld_done"):
|
||||
super(TestBreakpoint, self).__init__(sym_name)
|
||||
# self.sym, ok = gdb.lookup_symbol(sym_name)
|
||||
|
||||
def stop(self):
|
||||
val_i = gdb.parse_and_eval('i')
|
||||
global initial_vlen
|
||||
try:
|
||||
for i in range(0, int(val_i)):
|
||||
val_z = gdb.parse_and_eval("$z0.b.u[%d]" % i)
|
||||
report(int(val_z) == i, "z0.b.u[%d] == %d" % (i, i))
|
||||
for i in range(i + 1, initial_vlen):
|
||||
val_z = gdb.parse_and_eval("$z0.b.u[%d]" % i)
|
||||
report(int(val_z) == 0, "z0.b.u[%d] == 0" % (i))
|
||||
except gdb.error:
|
||||
report(False, "checking zregs (out of range)")
|
||||
|
||||
# Check the aliased V registers are set and GDB has correctly
|
||||
# created them for us having recognised and handled SVE.
|
||||
try:
|
||||
for i in range(0, 16):
|
||||
val_z = gdb.parse_and_eval("$z0.b.u[%d]" % i)
|
||||
val_v = gdb.parse_and_eval("$v0.b.u[%d]" % i)
|
||||
report(int(val_z) == int(val_v),
|
||||
"v0.b.u[%d] == z0.b.u[%d]" % (i, i))
|
||||
except gdb.error:
|
||||
report(False, "checking vregs (out of range)")
|
||||
|
||||
|
||||
def run_test():
|
||||
"Run through the tests one by one"
|
||||
|
||||
print ("Setup breakpoint")
|
||||
bp = TestBreakpoint()
|
||||
|
||||
global initial_vlen
|
||||
vg = gdb.parse_and_eval("$vg")
|
||||
initial_vlen = int(vg) * 8
|
||||
|
||||
gdb.execute("c")
|
||||
|
||||
|
||||
main(run_test, expected_arch="aarch64")
|
||||
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Test the SVE registers are visible and changeable via gdbstub
|
||||
#
|
||||
# This is launched via tests/guest-debug/run-test.py
|
||||
#
|
||||
|
||||
import gdb
|
||||
from test_gdbstub import main, report
|
||||
|
||||
MAGIC = 0xDEADBEEF
|
||||
|
||||
|
||||
def run_test():
|
||||
"Run through the tests one by one"
|
||||
|
||||
gdb.execute("info registers")
|
||||
report(True, "info registers")
|
||||
|
||||
gdb.execute("info registers vector")
|
||||
report(True, "info registers vector")
|
||||
|
||||
# Now all the zregs
|
||||
frame = gdb.selected_frame()
|
||||
for i in range(0, 32):
|
||||
rname = "z%d" % (i)
|
||||
zreg = frame.read_register(rname)
|
||||
report(True, "Reading %s" % rname)
|
||||
for j in range(0, 4):
|
||||
cmd = "set $%s.q.u[%d] = 0x%x" % (rname, j, MAGIC)
|
||||
gdb.execute(cmd)
|
||||
report(True, "%s" % cmd)
|
||||
for j in range(0, 4):
|
||||
reg = "$%s.q.u[%d]" % (rname, j)
|
||||
v = gdb.parse_and_eval(reg)
|
||||
report(str(v.type) == "uint128_t", "size of %s" % (reg))
|
||||
for j in range(0, 8):
|
||||
cmd = "set $%s.d.u[%d] = 0x%x" % (rname, j, MAGIC)
|
||||
gdb.execute(cmd)
|
||||
report(True, "%s" % cmd)
|
||||
for j in range(0, 8):
|
||||
reg = "$%s.d.u[%d]" % (rname, j)
|
||||
v = gdb.parse_and_eval(reg)
|
||||
report(str(v.type) == "uint64_t", "size of %s" % (reg))
|
||||
report(int(v) == MAGIC, "%s is 0x%x" % (reg, MAGIC))
|
||||
|
||||
|
||||
main(run_test, expected_arch="aarch64")
|
||||
@@ -0,0 +1,38 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/shm.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int psize = getpagesize();
|
||||
int id;
|
||||
void *p;
|
||||
|
||||
/*
|
||||
* We need a shared mapping to enter CF_PARALLEL mode.
|
||||
* The easiest way to get that is shmat.
|
||||
*/
|
||||
id = shmget(IPC_PRIVATE, 2 * psize, IPC_CREAT | 0600);
|
||||
if (id < 0) {
|
||||
perror("shmget");
|
||||
return 2;
|
||||
}
|
||||
p = shmat(id, NULL, 0);
|
||||
if (p == MAP_FAILED) {
|
||||
perror("shmat");
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Protect the second page. */
|
||||
if (mprotect(p + psize, psize, PROT_NONE) < 0) {
|
||||
perror("mprotect");
|
||||
return 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load 4 bytes, 6 bytes from the end of the page.
|
||||
* On success this will load 0 from the newly allocated shm.
|
||||
*/
|
||||
return *(int *)(p + psize - 6);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Memory tagging, basic pass cases.
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
int *p0, *p1, *p2;
|
||||
long c;
|
||||
|
||||
enable_mte(PR_MTE_TCF_NONE);
|
||||
p0 = alloc_mte_mem(sizeof(*p0));
|
||||
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(1l));
|
||||
assert(p1 != p0);
|
||||
asm("subp %0,%1,%2" : "=r"(c) : "r"(p0), "r"(p1));
|
||||
assert(c == 0);
|
||||
|
||||
asm("stg %0, [%0]" : : "r"(p1));
|
||||
asm("ldg %0, [%1]" : "=r"(p2) : "r"(p0), "0"(p0));
|
||||
assert(p1 == p2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Memory tagging, write-only tag checking
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
void pass(int sig, siginfo_t *info, void *uc)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
struct sigaction sa;
|
||||
int *p0, *p1, *p2;
|
||||
long excl = 1;
|
||||
|
||||
enable_mte(PR_MTE_TCF_SYNC | PR_MTE_STORE_ONLY);
|
||||
p0 = alloc_mte_mem(sizeof(*p0));
|
||||
|
||||
/* Create two differently tagged pointers. */
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl));
|
||||
asm("gmi %0,%1,%0" : "+r"(excl) : "r" (p1));
|
||||
assert(excl != 1);
|
||||
asm("irg %0,%1,%2" : "=r"(p2) : "r"(p0), "r"(excl));
|
||||
assert(p1 != p2);
|
||||
|
||||
/* Store the tag from the first pointer. */
|
||||
asm("stg %0, [%0]" : : "r"(p1));
|
||||
|
||||
/*
|
||||
* We write to p1 (stg above makes this check pass) and read from
|
||||
* p2 (improperly tagged, but since it's a read, we don't care).
|
||||
*/
|
||||
*p1 = *p2;
|
||||
|
||||
/* enable handler */
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = pass;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
/* now we write to badly tagged p2, should fault. */
|
||||
*p2 = 0;
|
||||
|
||||
abort();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Memory tagging, basic fail cases, synchronous signals.
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
void pass(int sig, siginfo_t *info, void *uc)
|
||||
{
|
||||
assert(info->si_code == SEGV_MTESERR);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
struct sigaction sa;
|
||||
int *p0, *p1, *p2;
|
||||
long excl = 1;
|
||||
|
||||
enable_mte(PR_MTE_TCF_SYNC);
|
||||
p0 = alloc_mte_mem(sizeof(*p0));
|
||||
|
||||
/* Create two differently tagged pointers. */
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl));
|
||||
asm("gmi %0,%1,%0" : "+r"(excl) : "r" (p1));
|
||||
assert(excl != 1);
|
||||
asm("irg %0,%1,%2" : "=r"(p2) : "r"(p0), "r"(excl));
|
||||
assert(p1 != p2);
|
||||
|
||||
/* Store the tag from the first pointer. */
|
||||
asm("stg %0, [%0]" : : "r"(p1));
|
||||
|
||||
*p1 = 0;
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = pass;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
*p2 = 0;
|
||||
|
||||
abort();
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Memory tagging, basic fail cases, asynchronous signals.
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
void pass(int sig, siginfo_t *info, void *uc)
|
||||
{
|
||||
assert(info->si_code == SEGV_MTEAERR);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
struct sigaction sa;
|
||||
long *p0, *p1, *p2;
|
||||
long excl = 1;
|
||||
|
||||
enable_mte(PR_MTE_TCF_ASYNC);
|
||||
p0 = alloc_mte_mem(sizeof(*p0));
|
||||
|
||||
/* Create two differently tagged pointers. */
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl));
|
||||
asm("gmi %0,%1,%0" : "+r"(excl) : "r" (p1));
|
||||
assert(excl != 1);
|
||||
asm("irg %0,%1,%2" : "=r"(p2) : "r"(p0), "r"(excl));
|
||||
assert(p1 != p2);
|
||||
|
||||
/* Store the tag from the first pointer. */
|
||||
asm("stg %0, [%0]" : : "r"(p1));
|
||||
|
||||
*p1 = 0;
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = pass;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
/*
|
||||
* Signal for async error will happen eventually.
|
||||
* For a real kernel this should be after the next IRQ (e.g. timer).
|
||||
* For qemu linux-user, we kick the cpu and exit at the next TB.
|
||||
* In either case, loop until this happens (or killed by timeout).
|
||||
* For extra sauce, yield, producing EXCP_YIELD to cpu_loop().
|
||||
*/
|
||||
asm("str %0, [%0]; yield" : : "r"(p2));
|
||||
while (1);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Memory tagging, re-reading tag checks.
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
void __attribute__((noinline)) tagset(void *p, size_t size)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < size; i += 16) {
|
||||
asm("stg %0, [%0]" : : "r"(p + i));
|
||||
}
|
||||
}
|
||||
|
||||
void __attribute__((noinline)) tagcheck(void *p, size_t size)
|
||||
{
|
||||
size_t i;
|
||||
void *c;
|
||||
|
||||
for (i = 0; i < size; i += 16) {
|
||||
asm("ldg %0, [%1]" : "=r"(c) : "r"(p + i), "0"(p));
|
||||
assert(c == p);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
size_t size = getpagesize() * 4;
|
||||
long excl = 1;
|
||||
int *p0, *p1;
|
||||
|
||||
enable_mte(PR_MTE_TCF_ASYNC);
|
||||
p0 = alloc_mte_mem(size);
|
||||
|
||||
/* Tag the pointer. */
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl));
|
||||
|
||||
tagset(p1, size);
|
||||
tagcheck(p1, size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Memory tagging, faulting unaligned access.
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
void pass(int sig, siginfo_t *info, void *uc)
|
||||
{
|
||||
assert(info->si_code == SEGV_MTESERR);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
struct sigaction sa;
|
||||
void *p0, *p1, *p2;
|
||||
long excl = 1;
|
||||
|
||||
enable_mte(PR_MTE_TCF_SYNC);
|
||||
p0 = alloc_mte_mem(sizeof(*p0));
|
||||
|
||||
/* Create two differently tagged pointers. */
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl));
|
||||
asm("gmi %0,%1,%0" : "+r"(excl) : "r" (p1));
|
||||
assert(excl != 1);
|
||||
asm("irg %0,%1,%2" : "=r"(p2) : "r"(p0), "r"(excl));
|
||||
assert(p1 != p2);
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = pass;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
/* Store store two different tags in sequential granules. */
|
||||
asm("stg %0, [%0]" : : "r"(p1));
|
||||
asm("stg %0, [%0]" : : "r"(p2 + 16));
|
||||
|
||||
/* Perform an unaligned load crossing the granules. */
|
||||
asm volatile("ldr %0, [%1]" : "=r"(p0) : "r"(p1 + 12));
|
||||
abort();
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#include "mte.h"
|
||||
|
||||
void pass(int sig, siginfo_t *info, void *uc)
|
||||
{
|
||||
assert(info->si_code == SEGV_MTESERR);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
enable_mte(PR_MTE_TCF_SYNC);
|
||||
|
||||
void *brk = sbrk(16);
|
||||
if (brk == (void *)-1) {
|
||||
perror("sbrk");
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (mprotect(brk, 16, PROT_READ | PROT_WRITE | PROT_MTE)) {
|
||||
perror("mprotect");
|
||||
return 2;
|
||||
}
|
||||
|
||||
int *p1, *p2;
|
||||
long excl = 1;
|
||||
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(brk), "r"(excl));
|
||||
asm("gmi %0,%1,%0" : "+r"(excl) : "r"(p1));
|
||||
asm("irg %0,%1,%2" : "=r"(p2) : "r"(brk), "r"(excl));
|
||||
asm("stg %0,[%0]" : : "r"(p1));
|
||||
|
||||
*p1 = 0;
|
||||
|
||||
struct sigaction sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = pass;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
*p2 = 0;
|
||||
|
||||
abort();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Memory tagging, unaligned access crossing pages.
|
||||
* https://gitlab.com/qemu-project/qemu/-/issues/403
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
void *p;
|
||||
|
||||
enable_mte(PR_MTE_TCF_SYNC);
|
||||
p = alloc_mte_mem(2 * 0x1000);
|
||||
|
||||
/* Tag the pointer. */
|
||||
p = (void *)((unsigned long)p | (1ul << 56));
|
||||
|
||||
/* Store tag in sequential granules. */
|
||||
asm("stz2g %0, [%0]" : : "r"(p + 0x0ff0));
|
||||
|
||||
/*
|
||||
* Perform an unaligned store with tag 1 crossing the pages.
|
||||
* Failure dies with SIGSEGV.
|
||||
*/
|
||||
asm("str %0, [%0]" : : "r"(p + 0x0ffc));
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* To be compiled with -march=armv8.5-a+memtag
|
||||
*
|
||||
* This test is adapted from a Linux test. Please see:
|
||||
*
|
||||
* https://www.kernel.org/doc/html/next/arch/arm64/memory-tagging-extension.html#example-of-correct-usage
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/auxv.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <string.h>
|
||||
/*
|
||||
* From arch/arm64/include/uapi/asm/hwcap.h
|
||||
*/
|
||||
#define HWCAP2_MTE (1 << 18)
|
||||
|
||||
/*
|
||||
* From arch/arm64/include/uapi/asm/mman.h
|
||||
*/
|
||||
#define PROT_MTE 0x20
|
||||
|
||||
/*
|
||||
* Insert a random logical tag into the given pointer.
|
||||
*/
|
||||
#define insert_random_tag(ptr) ({ \
|
||||
uint64_t __val; \
|
||||
asm("irg %0, %1" : "=r" (__val) : "r" (ptr)); \
|
||||
__val; \
|
||||
})
|
||||
|
||||
/*
|
||||
* Set the allocation tag on the destination address.
|
||||
*/
|
||||
#define set_tag(tagged_addr) do { \
|
||||
asm volatile("stg %0, [%0]" : : "r" (tagged_addr) : "memory"); \
|
||||
} while (0)
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned char *a;
|
||||
unsigned long page_sz = sysconf(_SC_PAGESIZE);
|
||||
unsigned long hwcap2 = getauxval(AT_HWCAP2);
|
||||
|
||||
/* check if MTE is present */
|
||||
if (!(hwcap2 & HWCAP2_MTE)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable the tagged address ABI, synchronous or asynchronous MTE
|
||||
* tag check faults (based on per-CPU preference) and allow all
|
||||
* non-zero tags in the randomly generated set.
|
||||
*/
|
||||
if (prctl(PR_SET_TAGGED_ADDR_CTRL,
|
||||
PR_TAGGED_ADDR_ENABLE | PR_MTE_TCF_SYNC | PR_MTE_TCF_ASYNC |
|
||||
(0xfffe << PR_MTE_TAG_SHIFT),
|
||||
0, 0, 0)) {
|
||||
perror("prctl() failed");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
a = mmap(0, page_sz, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (a == MAP_FAILED) {
|
||||
perror("mmap() failed");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
printf("a[] address is %p\n", a);
|
||||
|
||||
/*
|
||||
* Enable MTE on the above anonymous mmap. The flag could be passed
|
||||
* directly to mmap() and skip this step.
|
||||
*/
|
||||
if (mprotect(a, page_sz, PROT_READ | PROT_WRITE | PROT_MTE)) {
|
||||
perror("mprotect() failed");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* access with the default tag (0) */
|
||||
a[0] = 1;
|
||||
a[1] = 2;
|
||||
|
||||
printf("a[0] = %hhu a[1] = %hhu\n", a[0], a[1]);
|
||||
|
||||
/* set the logical and allocation tags */
|
||||
a = (unsigned char *)insert_random_tag(a);
|
||||
set_tag(a);
|
||||
|
||||
printf("%p\n", a);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Memory tagging, full-address reporting.
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mte.h"
|
||||
|
||||
static void *faulting_ptr;
|
||||
|
||||
void pass(int sig, siginfo_t *info, void *uc)
|
||||
{
|
||||
assert(faulting_ptr == info->si_addr);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
struct sigaction sa;
|
||||
int *p0, *p1, *p2;
|
||||
long excl = 1;
|
||||
|
||||
enable_mte(PR_MTE_TCF_SYNC);
|
||||
p0 = alloc_mte_mem(sizeof(*p0));
|
||||
|
||||
/* Create two differently tagged pointers. */
|
||||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl));
|
||||
asm("gmi %0,%1,%0" : "+r"(excl) : "r" (p1));
|
||||
assert(excl != 1);
|
||||
asm("irg %0,%1,%2" : "=r"(p2) : "r"(p0), "r"(excl));
|
||||
assert(p1 != p2);
|
||||
|
||||
/* Store the tag from the first pointer. */
|
||||
asm("stg %0, [%0]" : : "r"(p1));
|
||||
|
||||
*p1 = 0;
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = pass;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
faulting_ptr = p2;
|
||||
*p2 = 0;
|
||||
|
||||
abort();
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Linux kernel fallback API definitions for MTE and test helpers.
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
#ifndef PR_SET_TAGGED_ADDR_CTRL
|
||||
# define PR_SET_TAGGED_ADDR_CTRL 55
|
||||
#endif
|
||||
#ifndef PR_TAGGED_ADDR_ENABLE
|
||||
# define PR_TAGGED_ADDR_ENABLE (1UL << 0)
|
||||
#endif
|
||||
#ifndef PR_MTE_STORE_ONLY
|
||||
# define PR_MTE_STORE_ONLY (1UL << 19)
|
||||
#endif
|
||||
#ifndef PR_MTE_TCF_SHIFT
|
||||
# define PR_MTE_TCF_SHIFT 1
|
||||
# define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
|
||||
# define PR_MTE_TCF_SYNC (1UL << PR_MTE_TCF_SHIFT)
|
||||
# define PR_MTE_TCF_ASYNC (2UL << PR_MTE_TCF_SHIFT)
|
||||
# define PR_MTE_TAG_SHIFT 3
|
||||
#endif
|
||||
|
||||
#ifndef PROT_MTE
|
||||
# define PROT_MTE 0x20
|
||||
#endif
|
||||
|
||||
#ifndef SEGV_MTEAERR
|
||||
# define SEGV_MTEAERR 8
|
||||
# define SEGV_MTESERR 9
|
||||
#endif
|
||||
|
||||
static void enable_mte(int flags)
|
||||
{
|
||||
int r = prctl(PR_SET_TAGGED_ADDR_CTRL,
|
||||
PR_TAGGED_ADDR_ENABLE | flags | (0xfffe << PR_MTE_TAG_SHIFT),
|
||||
0, 0, 0);
|
||||
if (r < 0) {
|
||||
perror("PR_SET_TAGGED_ADDR_CTRL");
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
static void * alloc_mte_mem(size_t size) __attribute__((unused));
|
||||
static void * alloc_mte_mem(size_t size)
|
||||
{
|
||||
void *p = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_MTE,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (p == MAP_FAILED) {
|
||||
perror("mmap PROT_MTE");
|
||||
exit(2);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#include <assert.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef PR_PAC_RESET_KEYS
|
||||
#define PR_PAC_RESET_KEYS 54
|
||||
#define PR_PAC_APDAKEY (1 << 2)
|
||||
#endif
|
||||
|
||||
#define TESTS 1000
|
||||
|
||||
int main()
|
||||
{
|
||||
int x, i, count = 0;
|
||||
void *p0 = &x, *p1, *p2;
|
||||
float perc;
|
||||
|
||||
for (i = 0; i < TESTS; i++) {
|
||||
asm volatile("pacdza %0" : "=r"(p1) : "0"(p0));
|
||||
prctl(PR_PAC_RESET_KEYS, PR_PAC_APDAKEY, 0, 0, 0);
|
||||
asm volatile("pacdza %0" : "=r"(p2) : "0"(p0));
|
||||
|
||||
if (p1 != p0) {
|
||||
count++;
|
||||
}
|
||||
if (p1 != p2) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
perc = (float) count / (float) (TESTS * 2);
|
||||
printf("Ptr Check: %0.2f%%\n", perc * 100.0);
|
||||
assert(perc > 0.95);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
#include <stdint.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "pauth.h"
|
||||
|
||||
|
||||
static void sigill(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
ucontext_t *uc = vuc;
|
||||
uint64_t test;
|
||||
|
||||
/* There is only one insn below that is allowed to fault. */
|
||||
asm volatile("adr %0, auth2_insn" : "=r"(test));
|
||||
assert(test == uc->uc_mcontext.pc);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static int pac_feature;
|
||||
|
||||
void do_test(uint64_t value)
|
||||
{
|
||||
uint64_t salt1, salt2;
|
||||
uint64_t encode, decode;
|
||||
|
||||
/*
|
||||
* With TBI enabled and a 48-bit VA, there are 7 bits of auth,
|
||||
* and so a 1/128 chance of encode = pac(value,key,salt) producing
|
||||
* an auth for which leaves value unchanged.
|
||||
* Iterate until we find a salt for which encode != value.
|
||||
*/
|
||||
for (salt1 = 1; ; salt1++) {
|
||||
asm volatile("pacda %0, %2" : "=r"(encode) : "0"(value), "r"(salt1));
|
||||
if (encode != value) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* A valid salt must produce a valid authorization. */
|
||||
asm volatile("autda %0, %2" : "=r"(decode) : "0"(encode), "r"(salt1));
|
||||
assert(decode == value);
|
||||
|
||||
/*
|
||||
* An invalid salt usually fails authorization, but again there
|
||||
* is a chance of choosing another salt that works.
|
||||
* Iterate until we find another salt which does fail.
|
||||
*
|
||||
* With FEAT_FPAC, this will SIGILL instead of producing a result.
|
||||
*/
|
||||
for (salt2 = salt1 + 1; ; salt2++) {
|
||||
asm volatile("auth2_insn: autda %0, %2"
|
||||
: "=r"(decode) : "0"(encode), "r"(salt2));
|
||||
if (decode != value) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert(pac_feature < 4); /* No FEAT_FPAC */
|
||||
|
||||
/* The VA bits, bit 55, and the TBI bits, should be unchanged. */
|
||||
assert(((decode ^ value) & 0xff80ffffffffffffull) == 0);
|
||||
|
||||
/*
|
||||
* Without FEAT_Pauth2, bits [54:53] are an error indicator based on
|
||||
* the key used; the DA key above is keynumber 0, so error == 0b01.
|
||||
* Otherwise, bit 55 of the original is sign-extended into the rest
|
||||
* of the auth.
|
||||
*/
|
||||
if (pac_feature < 3) {
|
||||
if ((value >> 55) & 1) {
|
||||
assert(((decode >> 48) & 0xff) == 0b10111111);
|
||||
} else {
|
||||
assert(((decode >> 48) & 0xff) == 0b00100000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
static const struct sigaction sa = {
|
||||
.sa_sigaction = sigill,
|
||||
.sa_flags = SA_SIGINFO
|
||||
};
|
||||
|
||||
pac_feature = get_pac_feature();
|
||||
assert(pac_feature != 0);
|
||||
|
||||
if (pac_feature >= 4) {
|
||||
/* FEAT_FPAC */
|
||||
sigaction(SIGILL, &sa, NULL);
|
||||
}
|
||||
|
||||
do_test(0);
|
||||
do_test(0xda004acedeadbeefull);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "pauth.h"
|
||||
|
||||
#define TESTS 1000
|
||||
|
||||
int main()
|
||||
{
|
||||
char base[TESTS];
|
||||
int i, count = 0;
|
||||
float perc;
|
||||
int pac_feature = get_pac_feature();
|
||||
|
||||
/*
|
||||
* Exit if no PAuth or FEAT_FPAC, which will SIGILL on AUTIA failure
|
||||
* rather than return an error for us to check below.
|
||||
*/
|
||||
if (pac_feature == 0 || pac_feature >= 4) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < TESTS; i++) {
|
||||
uintptr_t in, x, y;
|
||||
|
||||
in = i + (uintptr_t) base;
|
||||
|
||||
asm("mov %0, %[in]\n\t"
|
||||
"pacia %0, sp\n\t"
|
||||
"eor %0, %0, #4\n\t" /* corrupt single bit */
|
||||
"mov %1, %0\n\t"
|
||||
"autia %1, sp\n\t" /* validate corrupted pointer */
|
||||
"xpaci %0\n\t" /* strip pac from corrupted pointer */
|
||||
: /* out */ "=r"(x), "=r"(y)
|
||||
: /* in */ [in] "r" (in)
|
||||
: /* clobbers */);
|
||||
|
||||
/*
|
||||
* Once stripped, the corrupted pointer is of the form 0x0000...wxyz.
|
||||
* We expect the autia to indicate failure, producing a pointer of the
|
||||
* form 0x000e....wxyz. Use xpaci and != for the test, rather than
|
||||
* extracting explicit bits from the top, because the location of the
|
||||
* error code "e" depends on the configuration of virtual memory.
|
||||
*/
|
||||
if (x != y) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
perc = (float) count / (float) TESTS;
|
||||
printf("Checks Passed: %0.2f%%\n", perc * 100.0);
|
||||
assert(perc > 0.95);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#include <assert.h>
|
||||
#include "pauth.h"
|
||||
|
||||
static int x;
|
||||
|
||||
int main()
|
||||
{
|
||||
int *p0 = &x, *p1, *p2, *p3;
|
||||
unsigned long salt = 0;
|
||||
int pac_feature = get_pac_feature();
|
||||
|
||||
/*
|
||||
* Exit if no PAuth or FEAT_FPAC, which will SIGILL on AUTDA failure
|
||||
* rather than return an error for us to check below.
|
||||
*/
|
||||
if (pac_feature == 0 || pac_feature >= 4) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* With TBI enabled and a 48-bit VA, there are 7 bits of auth, and so
|
||||
* a 1/128 chance of auth = pac(ptr,key,salt) producing zero.
|
||||
* Find a salt that creates auth != 0.
|
||||
*/
|
||||
do {
|
||||
salt++;
|
||||
asm("pacda %0, %1" : "=r"(p1) : "r"(salt), "0"(p0));
|
||||
} while (p0 == p1);
|
||||
|
||||
/*
|
||||
* This pac must fail, because the input pointer bears an encryption,
|
||||
* and so is not properly extended within bits [55:47]. This will
|
||||
* toggle bit 54 in the output...
|
||||
*/
|
||||
asm("pacda %0, %1" : "=r"(p2) : "r"(salt), "0"(p1));
|
||||
|
||||
/* ... so that the aut must fail, setting bit 53 in the output ... */
|
||||
asm("autda %0, %1" : "=r"(p3) : "r"(salt), "0"(p2));
|
||||
|
||||
/* ... which means this equality must not hold. */
|
||||
assert(p3 != p0);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Helper for pauth test case
|
||||
*
|
||||
* Copyright (c) 2023 Linaro Ltd
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <sys/auxv.h>
|
||||
|
||||
static int get_pac_feature(void)
|
||||
{
|
||||
unsigned long isar1, isar2;
|
||||
|
||||
assert(getauxval(AT_HWCAP) & HWCAP_CPUID);
|
||||
|
||||
asm("mrs %0, id_aa64isar1_el1" : "=r"(isar1));
|
||||
asm("mrs %0, S3_0_C0_C6_2" : "=r"(isar2)); /* id_aa64isar2_el1 */
|
||||
|
||||
return ((isar1 >> 4) & 0xf) /* APA */
|
||||
| ((isar1 >> 8) & 0xf) /* API */
|
||||
| ((isar2 >> 12) & 0xf); /* APA3 */
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/* Test PC misalignment exception */
|
||||
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static void *expected;
|
||||
|
||||
static void sigbus(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
assert(info->si_code == BUS_ADRALN);
|
||||
assert(info->si_addr == expected);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
void *tmp;
|
||||
|
||||
struct sigaction sa = {
|
||||
.sa_sigaction = sigbus,
|
||||
.sa_flags = SA_SIGINFO
|
||||
};
|
||||
|
||||
if (sigaction(SIGBUS, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
asm volatile("adr %0, 1f + 1\n\t"
|
||||
"str %0, %1\n\t"
|
||||
"br %0\n"
|
||||
"1:"
|
||||
: "=&r"(tmp), "=m"(expected));
|
||||
abort();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Semihosting Tests - AArch64 helper
|
||||
*
|
||||
* Copyright (c) 2019, 2024
|
||||
* Written by Alex Bennée <[email protected]>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
|
||||
{
|
||||
register uintptr_t t asm("x0") = type;
|
||||
register uintptr_t a0 asm("x1") = arg0;
|
||||
asm("hlt 0xf000"
|
||||
: "=r" (t)
|
||||
: "r" (t), "r" (a0));
|
||||
return t;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* SME outer product, 1 x 1.
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static void foo(float *dst)
|
||||
{
|
||||
asm(".arch_extension sme\n\t"
|
||||
"smstart\n\t"
|
||||
"ptrue p0.s, vl4\n\t"
|
||||
"fmov z0.s, #1.0\n\t"
|
||||
/*
|
||||
* An outer product of a vector of 1.0 by itself should be a matrix of 1.0.
|
||||
* Note that we are using tile 1 here (za1.s) rather than tile 0.
|
||||
*/
|
||||
"zero {za}\n\t"
|
||||
"fmopa za1.s, p0/m, p0/m, z0.s, z0.s\n\t"
|
||||
/*
|
||||
* Read the first 4x4 sub-matrix of elements from tile 1:
|
||||
* Note that za1h should be interchangeable here.
|
||||
*/
|
||||
"mov w12, #0\n\t"
|
||||
"mova z0.s, p0/m, za1v.s[w12, #0]\n\t"
|
||||
"mova z1.s, p0/m, za1v.s[w12, #1]\n\t"
|
||||
"mova z2.s, p0/m, za1v.s[w12, #2]\n\t"
|
||||
"mova z3.s, p0/m, za1v.s[w12, #3]\n\t"
|
||||
/*
|
||||
* And store them to the input pointer (dst in the C code):
|
||||
*/
|
||||
"st1w {z0.s}, p0, [%0]\n\t"
|
||||
"add x0, x0, #16\n\t"
|
||||
"st1w {z1.s}, p0, [x0]\n\t"
|
||||
"add x0, x0, #16\n\t"
|
||||
"st1w {z2.s}, p0, [x0]\n\t"
|
||||
"add x0, x0, #16\n\t"
|
||||
"st1w {z3.s}, p0, [x0]\n\t"
|
||||
"smstop"
|
||||
: : "r"(dst)
|
||||
: "x12", "d0", "d1", "d2", "d3", "memory");
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
float dst[16] = { };
|
||||
|
||||
foo(dst);
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (dst[i] != 1.0f) {
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
/* success */
|
||||
return 0;
|
||||
|
||||
failure:
|
||||
for (int i = 0; i < 16; i++) {
|
||||
printf("%f%c", dst[i], i % 4 == 3 ? '\n' : ' ');
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* SME outer product, FZ vs FZ16
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static void test_fmopa(uint32_t *result)
|
||||
{
|
||||
asm(".arch_extension sme\n\t"
|
||||
"smstart\n\t" /* Z*, P* and ZArray cleared */
|
||||
"ptrue p2.b, vl16\n\t" /* Limit vector length to 16 */
|
||||
"ptrue p5.b, vl16\n\t"
|
||||
"movi d0, #0x00ff\n\t" /* fp16 denormal */
|
||||
"movi d16, #0x00ff\n\t"
|
||||
"mov w15, #0x0001000000\n\t" /* FZ=1, FZ16=0 */
|
||||
"msr fpcr, x15\n\t"
|
||||
"fmopa za3.s, p2/m, p5/m, z16.h, z0.h\n\t"
|
||||
"mov w15, #0\n\t"
|
||||
"st1w {za3h.s[w15, 0]}, p2, [%0]\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w {za3h.s[w15, 1]}, p2, [%0]\n\t"
|
||||
"mov w15, #2\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w {za3h.s[w15, 0]}, p2, [%0]\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w {za3h.s[w15, 1]}, p2, [%0]\n\t"
|
||||
"smstop"
|
||||
: "+r"(result) :
|
||||
: "x15", "x16", "p2", "p5", "d0", "d16", "memory");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint32_t result[4 * 4] = { };
|
||||
|
||||
test_fmopa(result);
|
||||
|
||||
if (result[0] != 0x2f7e0100) {
|
||||
printf("Test failed: Incorrect output in first 4 bytes\n"
|
||||
"Expected: %08x\n"
|
||||
"Got: %08x\n",
|
||||
0x2f7e0100, result[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (int i = 1; i < 16; ++i) {
|
||||
if (result[i] != 0) {
|
||||
printf("Test failed: Non-zero word at position %d\n", i);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* SME outer product, [ 1 2 3 4 ] squared
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
static const float i_1234[4] = {
|
||||
1.0f, 2.0f, 3.0f, 4.0f
|
||||
};
|
||||
|
||||
static const float expected[4] = {
|
||||
4.515625f, 5.750000f, 6.984375f, 8.218750f
|
||||
};
|
||||
|
||||
static void test_fmopa(float *result)
|
||||
{
|
||||
asm(".arch_extension sme\n\t"
|
||||
"smstart\n\t" /* ZArray cleared */
|
||||
"ptrue p2.b, vl16\n\t" /* Limit vector length to 16 */
|
||||
"ld1w {z0.s}, p2/z, [%1]\n\t"
|
||||
"mov w15, #0\n\t"
|
||||
"mov za3h.s[w15, 0], p2/m, z0.s\n\t"
|
||||
"mov za3h.s[w15, 1], p2/m, z0.s\n\t"
|
||||
"mov w15, #2\n\t"
|
||||
"mov za3h.s[w15, 0], p2/m, z0.s\n\t"
|
||||
"mov za3h.s[w15, 1], p2/m, z0.s\n\t"
|
||||
"msr fpcr, xzr\n\t"
|
||||
"fmopa za3.s, p2/m, p2/m, z0.h, z0.h\n\t"
|
||||
"mov w15, #0\n\t"
|
||||
"st1w {za3h.s[w15, 0]}, p2, [%0]\n"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w {za3h.s[w15, 1]}, p2, [%0]\n\t"
|
||||
"mov w15, #2\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w {za3h.s[w15, 0]}, p2, [%0]\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w {za3h.s[w15, 1]}, p2, [%0]\n\t"
|
||||
"smstop"
|
||||
: "+r"(result) : "r"(i_1234)
|
||||
: "x15", "x16", "p2", "d0", "memory");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
float result[4 * 4] = { };
|
||||
int ret = 0;
|
||||
|
||||
test_fmopa(result);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
float actual = result[i];
|
||||
if (fabsf(actual - expected[i]) > 0.001f) {
|
||||
printf("Test failed at element %d: Expected %f, got %f\n",
|
||||
i, expected[i], actual);
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* SME outer product, 1 x 1.
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
extern void foo(float *dst);
|
||||
|
||||
asm(
|
||||
" .arch_extension sme\n"
|
||||
" .type foo, @function\n"
|
||||
"foo:\n"
|
||||
" stp x29, x30, [sp, -80]!\n"
|
||||
" mov x29, sp\n"
|
||||
" stp d8, d9, [sp, 16]\n"
|
||||
" stp d10, d11, [sp, 32]\n"
|
||||
" stp d12, d13, [sp, 48]\n"
|
||||
" stp d14, d15, [sp, 64]\n"
|
||||
" smstart\n"
|
||||
" ptrue p0.s, vl4\n"
|
||||
" fmov z0.s, #1.0\n"
|
||||
/*
|
||||
* An outer product of a vector of 1.0 by itself should be a matrix of 1.0.
|
||||
* Note that we are using tile 1 here (za1.s) rather than tile 0.
|
||||
*/
|
||||
" zero {za}\n"
|
||||
" fmopa za1.s, p0/m, p0/m, z0.s, z0.s\n"
|
||||
/*
|
||||
* Read the first 4x4 sub-matrix of elements from tile 1:
|
||||
* Note that za1h should be interchangeable here.
|
||||
*/
|
||||
" mov w12, #0\n"
|
||||
" mova z0.s, p0/m, za1v.s[w12, #0]\n"
|
||||
" mova z1.s, p0/m, za1v.s[w12, #1]\n"
|
||||
" mova z2.s, p0/m, za1v.s[w12, #2]\n"
|
||||
" mova z3.s, p0/m, za1v.s[w12, #3]\n"
|
||||
/*
|
||||
* And store them to the input pointer (dst in the C code):
|
||||
*/
|
||||
" st1w {z0.s}, p0, [x0]\n"
|
||||
" add x0, x0, #16\n"
|
||||
" st1w {z1.s}, p0, [x0]\n"
|
||||
" add x0, x0, #16\n"
|
||||
" st1w {z2.s}, p0, [x0]\n"
|
||||
" add x0, x0, #16\n"
|
||||
" st1w {z3.s}, p0, [x0]\n"
|
||||
" smstop\n"
|
||||
" ldp d8, d9, [sp, 16]\n"
|
||||
" ldp d10, d11, [sp, 32]\n"
|
||||
" ldp d12, d13, [sp, 48]\n"
|
||||
" ldp d14, d15, [sp, 64]\n"
|
||||
" ldp x29, x30, [sp], 80\n"
|
||||
" ret\n"
|
||||
" .size foo, . - foo"
|
||||
);
|
||||
|
||||
int main()
|
||||
{
|
||||
float dst[16];
|
||||
int i, j;
|
||||
|
||||
foo(dst);
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (dst[i] != 1.0f) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 16) {
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
/* failure */
|
||||
for (i = 0; i < 4; ++i) {
|
||||
for (j = 0; j < 4; ++j) {
|
||||
printf("%f ", (double)dst[i * 4 + j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
static const int cmp[4][4] = {
|
||||
{ 110, 134, 158, 182 },
|
||||
{ 390, 478, 566, 654 },
|
||||
{ 670, 822, 974, 1126 },
|
||||
{ 950, 1166, 1382, 1598 }
|
||||
};
|
||||
int dst[4][4];
|
||||
int *tmp = &dst[0][0];
|
||||
|
||||
asm volatile(
|
||||
".arch armv8-r+sme\n\t"
|
||||
"smstart\n\t"
|
||||
"index z0.b, #0, #1\n\t"
|
||||
"movprfx z1, z0\n\t"
|
||||
"add z1.b, z1.b, #16\n\t"
|
||||
"ptrue p0.b\n\t"
|
||||
"smopa za0.s, p0/m, p0/m, z0.b, z1.b\n\t"
|
||||
"ptrue p0.s, vl4\n\t"
|
||||
"mov w12, #0\n\t"
|
||||
"st1w { za0h.s[w12, #0] }, p0, [%0]\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w { za0h.s[w12, #1] }, p0, [%0]\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w { za0h.s[w12, #2] }, p0, [%0]\n\t"
|
||||
"add %0, %0, #16\n\t"
|
||||
"st1w { za0h.s[w12, #3] }, p0, [%0]\n\t"
|
||||
"smstop"
|
||||
: "+r"(tmp) : : "memory");
|
||||
|
||||
if (memcmp(cmp, dst, sizeof(dst)) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* See above for correct results. */
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
printf("%6d", dst[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
static const long cmp[4][4] = {
|
||||
{ 110, 134, 158, 182 },
|
||||
{ 390, 478, 566, 654 },
|
||||
{ 670, 822, 974, 1126 },
|
||||
{ 950, 1166, 1382, 1598 }
|
||||
};
|
||||
long dst[4][4];
|
||||
long *tmp = &dst[0][0];
|
||||
long svl;
|
||||
|
||||
/* Validate that we have a wide enough vector for 4 elements. */
|
||||
asm(".arch armv8-r+sme-i64\n\trdsvl %0, #1" : "=r"(svl));
|
||||
if (svl < 32) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
asm volatile(
|
||||
"smstart\n\t"
|
||||
"index z0.h, #0, #1\n\t"
|
||||
"movprfx z1, z0\n\t"
|
||||
"add z1.h, z1.h, #16\n\t"
|
||||
"ptrue p0.b\n\t"
|
||||
"smopa za0.d, p0/m, p0/m, z0.h, z1.h\n\t"
|
||||
"ptrue p0.d, vl4\n\t"
|
||||
"mov w12, #0\n\t"
|
||||
"st1d { za0h.d[w12, #0] }, p0, [%0]\n\t"
|
||||
"add %0, %0, #32\n\t"
|
||||
"st1d { za0h.d[w12, #1] }, p0, [%0]\n\t"
|
||||
"mov w12, #2\n\t"
|
||||
"add %0, %0, #32\n\t"
|
||||
"st1d { za0h.d[w12, #0] }, p0, [%0]\n\t"
|
||||
"add %0, %0, #32\n\t"
|
||||
"st1d { za0h.d[w12, #1] }, p0, [%0]\n\t"
|
||||
"smstop"
|
||||
: "+r"(tmp) : : "memory");
|
||||
|
||||
if (memcmp(cmp, dst, sizeof(dst)) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* See above for correct results. */
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
printf("%6ld", dst[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* SVE ioctls tests
|
||||
*
|
||||
* Test the SVE width setting ioctls work and provide a base for
|
||||
* testing the gdbstub.
|
||||
*
|
||||
* Copyright (c) 2019 Linaro Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#include <sys/prctl.h>
|
||||
#include <asm/hwcap.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/auxv.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef HWCAP_CPUID
|
||||
#define HWCAP_CPUID (1 << 11)
|
||||
#endif
|
||||
|
||||
#define SVE_MAX_QUADS (2048 / 128)
|
||||
#define BYTES_PER_QUAD (128 / 8)
|
||||
|
||||
#define get_cpu_reg(id) ({ \
|
||||
unsigned long __val; \
|
||||
asm("mrs %0, "#id : "=r" (__val)); \
|
||||
__val; \
|
||||
})
|
||||
|
||||
static int do_sve_ioctl_test(void)
|
||||
{
|
||||
int i, res, init_vq;
|
||||
|
||||
res = prctl(PR_SVE_GET_VL, 0, 0, 0, 0);
|
||||
if (res < 0) {
|
||||
printf("FAILED to PR_SVE_GET_VL (%d)", res);
|
||||
return -1;
|
||||
}
|
||||
init_vq = res & PR_SVE_VL_LEN_MASK;
|
||||
|
||||
for (i = init_vq; i > 15; i /= 2) {
|
||||
printf("Checking PR_SVE_SET_VL=%d\n", i);
|
||||
res = prctl(PR_SVE_SET_VL, i, 0, 0, 0, 0);
|
||||
if (res < 0) {
|
||||
printf("FAILED to PR_SVE_SET_VL (%d)", res);
|
||||
return -1;
|
||||
}
|
||||
asm("index z0.b, #0, #1\n"
|
||||
".global __sve_ld_done\n"
|
||||
"__sve_ld_done:\n"
|
||||
"mov z0.b, #0\n"
|
||||
: /* no outputs kept */
|
||||
: /* no inputs */
|
||||
: "memory", "z0");
|
||||
}
|
||||
printf("PASS\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* we also need to probe for the ioctl support */
|
||||
if (getauxval(AT_HWCAP) & HWCAP_SVE) {
|
||||
return do_sve_ioctl_test();
|
||||
} else {
|
||||
printf("SKIP: no HWCAP_SVE on this system\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
#define N (256 + 16)
|
||||
|
||||
static int __attribute__((noinline)) test(int vl)
|
||||
{
|
||||
unsigned char buf[N];
|
||||
int err = 0;
|
||||
|
||||
for (int i = 0; i < N; ++i) {
|
||||
buf[i] = (unsigned char)i;
|
||||
}
|
||||
|
||||
asm volatile (
|
||||
"mov z0.b, #255\n\t"
|
||||
"str z0, %0"
|
||||
: : "m" (buf) : "z0", "memory");
|
||||
|
||||
for (int i = 0; i < vl; ++i) {
|
||||
if (buf[i] != 0xff) {
|
||||
fprintf(stderr, "vl %d, index %d, expected 255, got %d\n",
|
||||
vl, i, buf[i]);
|
||||
err = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = vl; i < N; ++i) {
|
||||
if (buf[i] != (unsigned char)i) {
|
||||
fprintf(stderr, "vl %d, index %d, expected %d, got %d\n",
|
||||
vl, i, (unsigned char)i, buf[i]);
|
||||
err = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
for (int i = 16; i <= 256; i += 16) {
|
||||
if (prctl(PR_SVE_SET_VL, i, 0, 0, 0, 0) == i) {
|
||||
err |= test(i);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/* WHILEWR / WHILERW regression test */
|
||||
|
||||
#include <sys/prctl.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
unsigned short p;
|
||||
int set_vl_ret;
|
||||
|
||||
set_vl_ret = prctl(PR_SVE_SET_VL, 16, 0, 0, 0, 0);
|
||||
assert(set_vl_ret == 16);
|
||||
|
||||
p = 0xdead;
|
||||
asm("whilewr p0.s, %0, %1\n\t"
|
||||
"str p0, [%2]"
|
||||
: : "r"(8), "r"(11), "r"(&p) : "memory", "p0");
|
||||
assert(p == 0x1111);
|
||||
|
||||
p = 0xdead;
|
||||
asm("whilerw p0.s, %0, %1\n\t"
|
||||
"str p0, [%2]"
|
||||
: : "r"(8), "r"(11), "r"(&p) : "memory", "p0");
|
||||
assert(p == 0x1111);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Check emulated system register access for linux-user mode.
|
||||
*
|
||||
* See: https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt
|
||||
*
|
||||
* Copyright (c) 2019 Linaro
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/auxv.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef HWCAP_CPUID
|
||||
#define HWCAP_CPUID (1 << 11)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Older assemblers don't recognize newer system register names,
|
||||
* but we can still access them by the Sn_n_Cn_Cn_n syntax.
|
||||
* This also means we don't need to specifically request that the
|
||||
* assembler enables whatever architectural features the ID registers
|
||||
* syntax might be gated behind.
|
||||
*/
|
||||
#define SYS_ID_AA64ISAR2_EL1 S3_0_C0_C6_2
|
||||
#define SYS_ID_AA64MMFR2_EL1 S3_0_C0_C7_2
|
||||
#define SYS_ID_AA64ZFR0_EL1 S3_0_C0_C4_4
|
||||
#define SYS_ID_AA64SMFR0_EL1 S3_0_C0_C4_5
|
||||
|
||||
int failed_bit_count;
|
||||
|
||||
/* Read and print system register `id' value */
|
||||
#define get_cpu_reg(id) ({ \
|
||||
unsigned long __val = 0xdeadbeef; \
|
||||
asm("mrs %0, "#id : "=r" (__val)); \
|
||||
printf("%-20s: 0x%016lx\n", #id, __val); \
|
||||
__val; \
|
||||
})
|
||||
|
||||
/* As above but also check no bits outside of `mask' are set*/
|
||||
#define get_cpu_reg_check_mask(id, mask) ({ \
|
||||
unsigned long __cval = get_cpu_reg(id); \
|
||||
unsigned long __extra = __cval & ~mask; \
|
||||
if (__extra) { \
|
||||
printf("%-20s: 0x%016lx\n", " !!extra bits!!", __extra); \
|
||||
failed_bit_count++; \
|
||||
} \
|
||||
})
|
||||
|
||||
/* As above but check RAZ */
|
||||
#define get_cpu_reg_check_zero(id) ({ \
|
||||
unsigned long __val = 0xdeadbeef; \
|
||||
asm("mrs %0, "#id : "=r" (__val)); \
|
||||
if (__val) { \
|
||||
printf("%-20s: 0x%016lx (not RAZ!)\n", #id, __val); \
|
||||
failed_bit_count++; \
|
||||
} \
|
||||
})
|
||||
|
||||
/* Chunk up mask into 63:48, 47:32, 31:16, 15:0 to ease counting */
|
||||
#define _m(a, b, c, d) (0x ## a ## b ## c ## d ##ULL)
|
||||
|
||||
bool should_fail;
|
||||
int should_fail_count;
|
||||
int should_not_fail_count;
|
||||
uintptr_t failed_pc[10];
|
||||
|
||||
void sigill_handler(int signo, siginfo_t *si, void *data)
|
||||
{
|
||||
ucontext_t *uc = (ucontext_t *)data;
|
||||
|
||||
if (should_fail) {
|
||||
should_fail_count++;
|
||||
} else {
|
||||
uintptr_t pc = (uintptr_t) uc->uc_mcontext.pc;
|
||||
failed_pc[should_not_fail_count++] = pc;
|
||||
}
|
||||
uc->uc_mcontext.pc += 4;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
/* Hook in a SIGILL handler */
|
||||
memset(&sa, 0, sizeof(struct sigaction));
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sa.sa_sigaction = &sigill_handler;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
if (sigaction(SIGILL, &sa, 0) != 0) {
|
||||
perror("sigaction");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Counter values have been exposed since Linux 4.12 */
|
||||
printf("Checking Counter registers\n");
|
||||
|
||||
get_cpu_reg(ctr_el0);
|
||||
get_cpu_reg(cntvct_el0);
|
||||
get_cpu_reg(cntfrq_el0);
|
||||
|
||||
/* HWCAP_CPUID indicates we can read feature registers, since Linux 4.11 */
|
||||
if (!(getauxval(AT_HWCAP) & HWCAP_CPUID)) {
|
||||
printf("CPUID registers unavailable\n");
|
||||
return 1;
|
||||
} else {
|
||||
printf("Checking CPUID registers\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Some registers only expose some bits to user-space. Anything
|
||||
* that is IMPDEF is exported as 0 to user-space. The _mask checks
|
||||
* assert no extra bits are set.
|
||||
*
|
||||
* This check is *not* comprehensive as some fields are set to
|
||||
* minimum valid fields - for the purposes of this check allowed
|
||||
* to have non-zero values.
|
||||
*/
|
||||
get_cpu_reg_check_mask(id_aa64isar0_el1, _m(f0ff,ffff,f0ff,fff0));
|
||||
get_cpu_reg_check_mask(id_aa64isar1_el1, _m(00ff,f0ff,ffff,ffff));
|
||||
get_cpu_reg_check_mask(SYS_ID_AA64ISAR2_EL1, _m(00ff,0000,00ff,ffff));
|
||||
/* TGran4 & TGran64 as pegged to -1 */
|
||||
get_cpu_reg_check_mask(id_aa64mmfr0_el1, _m(f000,0000,ff00,0000));
|
||||
get_cpu_reg_check_mask(id_aa64mmfr1_el1, _m(0000,f000,0000,0000));
|
||||
get_cpu_reg_check_mask(SYS_ID_AA64MMFR2_EL1, _m(0000,000f,0000,0000));
|
||||
/* EL1/EL0 reported as AA64 only */
|
||||
get_cpu_reg_check_mask(id_aa64pfr0_el1, _m(000f,000f,00ff,0011));
|
||||
get_cpu_reg_check_mask(id_aa64pfr1_el1, _m(0000,0000,0f00,0fff));
|
||||
/* all hidden, DebugVer fixed to 0x6 (ARMv8 debug architecture) */
|
||||
get_cpu_reg_check_mask(id_aa64dfr0_el1, _m(0000,0000,0000,0006));
|
||||
get_cpu_reg_check_zero(id_aa64dfr1_el1);
|
||||
get_cpu_reg_check_mask(SYS_ID_AA64ZFR0_EL1, _m(0ff0,ff0f,0fff,00ff));
|
||||
get_cpu_reg_check_mask(SYS_ID_AA64SMFR0_EL1, _m(8ff1,fcff,0000,0000));
|
||||
|
||||
get_cpu_reg_check_zero(id_aa64afr0_el1);
|
||||
get_cpu_reg_check_zero(id_aa64afr1_el1);
|
||||
|
||||
get_cpu_reg_check_mask(midr_el1, _m(0000,0000,ffff,ffff));
|
||||
/* mpidr sets bit 31, everything else hidden */
|
||||
get_cpu_reg_check_mask(mpidr_el1, _m(0000,0000,8000,0000));
|
||||
/* REVIDR is all IMPDEF so should be all zeros to user-space */
|
||||
get_cpu_reg_check_zero(revidr_el1);
|
||||
|
||||
/*
|
||||
* There are a block of more registers that are RAZ in the rest of
|
||||
* the Op0=3, Op1=0, CRn=0, CRm=0,4,5,6,7 space. However for
|
||||
* brevity we don't check stuff that is currently un-allocated
|
||||
* here. Feel free to add them ;-)
|
||||
*/
|
||||
|
||||
printf("Remaining registers should fail\n");
|
||||
should_fail = true;
|
||||
|
||||
/* Unexposed register access causes SIGILL */
|
||||
get_cpu_reg(id_mmfr0_el1);
|
||||
get_cpu_reg(id_mmfr1_el1);
|
||||
get_cpu_reg(id_mmfr2_el1);
|
||||
get_cpu_reg(id_mmfr3_el1);
|
||||
|
||||
get_cpu_reg(mvfr0_el1);
|
||||
get_cpu_reg(mvfr1_el1);
|
||||
|
||||
if (should_not_fail_count > 0) {
|
||||
int i;
|
||||
for (i = 0; i < should_not_fail_count; i++) {
|
||||
uintptr_t pc = failed_pc[i];
|
||||
uint32_t insn = *(uint32_t *) pc;
|
||||
printf("insn %#x @ %#lx unexpected FAIL\n", insn, pc);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (failed_bit_count > 0) {
|
||||
printf("Extra information leaked to user-space!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return should_fail_count == 6 ? 0 : 1;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
*
|
||||
* ASID2 Feature presence and enabled TCR2_EL1 bits test
|
||||
*
|
||||
* Copyright (c) 2025 Linaro Ltd
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <minilib.h>
|
||||
|
||||
#define ID_AA64MMFR3_EL1 "S3_0_C0_C7_3"
|
||||
#define ID_AA64MMFR4_EL1 "S3_0_C0_C7_4"
|
||||
#define TCR2_EL1 "S3_0_C2_C0_3"
|
||||
|
||||
int main()
|
||||
{
|
||||
/*
|
||||
* Test for presence of ASID2 and three feature bits enabled by it:
|
||||
* https://developer.arm.com/documentation/109697/2025_09/Feature-descriptions/The-Armv9-5-architecture-extension
|
||||
* Bits added are FNG1, FNG0, and A2. These should be RES0 if A2 is
|
||||
* not enabled and read as the written value if A2 is enabled.
|
||||
*/
|
||||
|
||||
uint64_t out;
|
||||
uint64_t idreg3;
|
||||
uint64_t idreg4;
|
||||
int tcr2_present;
|
||||
int asid2_present;
|
||||
|
||||
/* Mask is FNG1, FNG0, and A2 */
|
||||
const uint64_t feature_mask = (1ULL << 18 | 1ULL << 17 | 1ULL << 16);
|
||||
const uint64_t in = feature_mask;
|
||||
|
||||
asm("mrs %[idreg3], " ID_AA64MMFR3_EL1 "\n\t"
|
||||
: [idreg3] "=r" (idreg3));
|
||||
|
||||
tcr2_present = ((idreg3 & 0xF) != 0);
|
||||
|
||||
if (!tcr2_present) {
|
||||
ml_printf("TCR2 is not present, cannot perform test");
|
||||
return 0;
|
||||
}
|
||||
|
||||
asm("mrs %[idreg4], " ID_AA64MMFR4_EL1 "\n\t"
|
||||
: [idreg4] "=r" (idreg4));
|
||||
|
||||
asid2_present = ((idreg4 & 0xF00) != 0);
|
||||
|
||||
asm("msr " TCR2_EL1 ", %[x0]\n\t"
|
||||
"mrs %[x1], " TCR2_EL1 "\n\t"
|
||||
: [x1] "=r" (out)
|
||||
: [x0] "r" (in));
|
||||
|
||||
if (asid2_present) {
|
||||
if ((out & feature_mask) == in) {
|
||||
ml_printf("OK\n");
|
||||
return 0;
|
||||
} else {
|
||||
ml_printf("FAIL: ASID2 present, but read value %lx != "
|
||||
"written value %lx\n",
|
||||
out & feature_mask, in);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if (out == 0) {
|
||||
ml_printf("TCR2_EL1 reads as RES0 as expected\n");
|
||||
return 0;
|
||||
} else {
|
||||
ml_printf("FAIL: ASID2, missing but read value %lx != 0\n",
|
||||
out & feature_mask, in);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,478 @@
|
||||
/*
|
||||
* Minimal AArch64 system boot code.
|
||||
*
|
||||
* Copyright Linaro Ltd 2019
|
||||
*
|
||||
* Loosely based on the newlib/libgloss setup stubs. Using semihosting
|
||||
* for serial output and exit functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Semihosting interface on ARM AArch64
|
||||
* See "Semihosting for AArch32 and AArch64 Release 2.0" by ARM
|
||||
* w0 - semihosting call number
|
||||
* x1 - semihosting parameter
|
||||
*/
|
||||
#define semihosting_call hlt 0xf000
|
||||
#define SYS_WRITEC 0x03 /* character to debug channel */
|
||||
#define SYS_WRITE0 0x04 /* string to debug channel */
|
||||
#define SYS_GET_CMDLINE 0x15 /* get command line */
|
||||
#define SYS_EXIT 0x18
|
||||
|
||||
.align 12
|
||||
|
||||
.macro ventry label
|
||||
.align 7
|
||||
b \label
|
||||
.endm
|
||||
|
||||
vector_table:
|
||||
/* Current EL with SP0. */
|
||||
ventry curr_sp0_sync /* Synchronous */
|
||||
ventry curr_sp0_irq /* Irq/vIRQ */
|
||||
ventry curr_sp0_fiq /* Fiq/vFIQ */
|
||||
ventry curr_sp0_serror /* SError/VSError */
|
||||
|
||||
/* Current EL with SPx. */
|
||||
ventry curr_spx_sync /* Synchronous */
|
||||
ventry curr_spx_irq /* IRQ/vIRQ */
|
||||
ventry curr_spx_fiq /* FIQ/vFIQ */
|
||||
ventry curr_spx_serror /* SError/VSError */
|
||||
|
||||
/* Lower EL using AArch64. */
|
||||
ventry lower_a64_sync /* Synchronous */
|
||||
ventry lower_a64_irq /* IRQ/vIRQ */
|
||||
ventry lower_a64_fiq /* FIQ/vFIQ */
|
||||
ventry lower_a64_serror /* SError/VSError */
|
||||
|
||||
/* Lower EL using AArch32. */
|
||||
ventry lower_a32_sync /* Synchronous */
|
||||
ventry lower_a32_irq /* IRQ/vIRQ */
|
||||
ventry lower_a32_fiq /* FIQ/vFIQ */
|
||||
ventry lower_a32_serror /* SError/VSError */
|
||||
|
||||
.text
|
||||
.align 4
|
||||
|
||||
/* Common vector handling for now */
|
||||
curr_sp0_sync:
|
||||
curr_sp0_irq:
|
||||
curr_sp0_fiq:
|
||||
curr_sp0_serror:
|
||||
curr_spx_sync:
|
||||
#ifdef LOGGING_VECTOR_TABLE
|
||||
sub sp, sp, #16
|
||||
stp x0, x1, [sp, #0]
|
||||
mrs x0, ESR_EL3
|
||||
lsr x0, x0, #26
|
||||
and x0, x0, #0x3f
|
||||
cmp x0, #37
|
||||
beq data_fault
|
||||
cmp x0, #30
|
||||
beq gpc_fault
|
||||
b generic_exception
|
||||
|
||||
data_fault:
|
||||
mrs x0, FAR_EL3
|
||||
adrp x1, exception_log
|
||||
str x0, [x1]
|
||||
ldr x0, =0x1001
|
||||
str x0, [x1, #8]
|
||||
b skip_return
|
||||
gpc_fault:
|
||||
mrs x0, FAR_EL3
|
||||
adrp x1, exception_log
|
||||
str x0, [x1]
|
||||
ldr x0, =0x1002
|
||||
str x0, [x1, #8]
|
||||
/* Fall through */
|
||||
skip_return:
|
||||
mrs x0, ELR_EL3
|
||||
add x0, x0, #4 /* Skip faulting instruction */
|
||||
msr ELR_EL3, x0
|
||||
ldp x0, x1, [sp, #0]
|
||||
add sp, sp, #16
|
||||
eret
|
||||
#endif
|
||||
curr_spx_irq:
|
||||
curr_spx_fiq:
|
||||
curr_spx_serror:
|
||||
lower_a64_sync:
|
||||
lower_a64_irq:
|
||||
lower_a64_fiq:
|
||||
lower_a64_serror:
|
||||
lower_a32_sync:
|
||||
lower_a32_irq:
|
||||
lower_a32_fiq:
|
||||
lower_a32_serror:
|
||||
generic_exception:
|
||||
adr x1, .unexp_excp
|
||||
exit_msg:
|
||||
mov x0, SYS_WRITE0
|
||||
semihosting_call
|
||||
mov x0, 1 /* EXIT_FAILURE */
|
||||
bl _exit
|
||||
/* never returns */
|
||||
|
||||
.section .rodata
|
||||
.unexp_excp:
|
||||
.string "Unexpected exception.\n"
|
||||
.high_el_msg:
|
||||
.string "Started in lower EL than requested.\n"
|
||||
.unexp_el0:
|
||||
.string "Started in invalid EL.\n"
|
||||
|
||||
.align 8
|
||||
.get_cmd:
|
||||
.quad cmdline
|
||||
.quad 128
|
||||
|
||||
.text
|
||||
.align 4
|
||||
.global __start
|
||||
__start:
|
||||
/*
|
||||
* Initialise the stack for whatever EL we are in before
|
||||
* anything else, we need it to be able to _exit cleanly.
|
||||
* It's smaller than the stack we pass to the C code but we
|
||||
* don't need much.
|
||||
*/
|
||||
adrp x0, system_stack_end
|
||||
add x0, x0, :lo12:system_stack_end
|
||||
mov sp, x0
|
||||
|
||||
/*
|
||||
* The test can set the semihosting command line to the target
|
||||
* EL needed for the test. However if no semihosting args are set we will
|
||||
* end up with -kernel/-append data (see semihosting_arg_fallback).
|
||||
* Keep the normalised target in w11.
|
||||
*/
|
||||
mov x0, SYS_GET_CMDLINE
|
||||
adr x1, .get_cmd
|
||||
semihosting_call
|
||||
adrp x10, cmdline
|
||||
add x10, x10, :lo12:cmdline
|
||||
ldrb w11, [x10]
|
||||
|
||||
/* sanity check, normalise char to EL, clamp to 1 if outside range */
|
||||
subs w11, w11, #'0'
|
||||
b.lt el_default
|
||||
cmp w11, #3
|
||||
b.gt el_default
|
||||
b 1f
|
||||
|
||||
el_high:
|
||||
adr x1, .high_el_msg
|
||||
b exit_msg
|
||||
|
||||
el_default:
|
||||
mov w11, #1
|
||||
|
||||
1:
|
||||
/* Determine current Exception Level */
|
||||
mrs x0, CurrentEL
|
||||
lsr x0, x0, #2 /* CurrentEL[3:2] contains the current EL */
|
||||
|
||||
/* Are we already in a lower EL than we want? */
|
||||
cmp w11, w0
|
||||
bgt el_high
|
||||
|
||||
/* Branch based on current EL */
|
||||
cmp x0, #3
|
||||
b.eq setup_el3
|
||||
cmp x0, #2
|
||||
b.eq setup_el2
|
||||
cmp x0, #1
|
||||
b.eq at_testel /* Already at EL1, skip transition */
|
||||
|
||||
/* Should not be at EL0 - error out */
|
||||
adr x1, .unexp_el0
|
||||
b exit_msg
|
||||
|
||||
setup_el3:
|
||||
/* Ensure we trap if we get anything wrong */
|
||||
adr x0, vector_table
|
||||
msr vbar_el3, x0
|
||||
|
||||
/* Does the test want to be at EL3? */
|
||||
cmp w11, #3
|
||||
beq at_testel
|
||||
|
||||
/* Configure EL3 to for lower states (EL2 or EL1) */
|
||||
mrs x0, scr_el3
|
||||
orr x0, x0, #(1 << 10) /* RW = 1: EL2/EL1 execution state is AArch64 */
|
||||
orr x0, x0, #(1 << 0) /* NS = 1: Non-secure state */
|
||||
msr scr_el3, x0
|
||||
|
||||
/*
|
||||
* We need to check if EL2 is actually enabled via ID_AA64PFR0_EL1,
|
||||
* otherwise we should just jump straight to EL1.
|
||||
*/
|
||||
mrs x0, id_aa64pfr0_el1
|
||||
ubfx x0, x0, #8, #4 /* Extract EL2 field (bits 11:8) */
|
||||
cbz x0, el2_not_present /* If field is 0 no EL2 */
|
||||
|
||||
|
||||
/* Prepare SPSR for exception return to EL2 */
|
||||
mov x0, #0x3c9 /* DAIF bits and EL2h mode (9) */
|
||||
msr spsr_el3, x0
|
||||
|
||||
/* Set EL2 entry point */
|
||||
adr x0, setup_el2
|
||||
msr elr_el3, x0
|
||||
|
||||
/* Return to EL2 */
|
||||
eret
|
||||
|
||||
el2_not_present:
|
||||
/* Initialize SCTLR_EL1 with reset value */
|
||||
msr sctlr_el1, xzr
|
||||
|
||||
/* Set EL1 entry point */
|
||||
adr x0, at_testel
|
||||
msr elr_el3, x0
|
||||
|
||||
/* Prepare SPSR for exception return to EL1h with interrupts masked */
|
||||
mov x0, #0x3c5 /* DAIF bits and EL1h mode (5) */
|
||||
msr spsr_el3, x0
|
||||
|
||||
isb /* Synchronization barrier */
|
||||
eret /* Jump to EL1 */
|
||||
|
||||
setup_el2:
|
||||
/* Ensure we trap if we get anything wrong */
|
||||
adr x0, vector_table
|
||||
msr vbar_el2, x0
|
||||
|
||||
/* Does the test want to be at EL2? */
|
||||
cmp w11, #2
|
||||
beq at_testel
|
||||
|
||||
/* Configure EL2 to allow transition to EL1 */
|
||||
mrs x0, hcr_el2
|
||||
orr x0, x0, #(1 << 31) /* RW = 1: EL1 execution state is AArch64 */
|
||||
msr hcr_el2, x0
|
||||
|
||||
/* Initialize SCTLR_EL1 with reset value */
|
||||
msr sctlr_el1, xzr
|
||||
|
||||
/* Set EL1 entry point */
|
||||
adr x0, at_testel
|
||||
msr elr_el2, x0
|
||||
|
||||
/* Prepare SPSR for exception return to EL1 */
|
||||
mov x0, #(0x5 << 0) /* EL1h (SPx), with interrupts disabled */
|
||||
msr spsr_el2, x0
|
||||
|
||||
/* Return to EL1 */
|
||||
eret
|
||||
|
||||
/*
|
||||
* At the target EL for the test, usually EL1. Note we still
|
||||
* set everything up as if we were at EL1.
|
||||
*/
|
||||
at_testel:
|
||||
/* Installs a table of exception vectors to catch and handle all
|
||||
exceptions by terminating the process with a diagnostic. */
|
||||
adr x0, vector_table
|
||||
msr vbar_el1, x0
|
||||
|
||||
/* Page table setup (identity mapping). */
|
||||
adrp x0, ttb
|
||||
add x0, x0, :lo12:ttb
|
||||
msr ttbr0_el1, x0
|
||||
|
||||
/*
|
||||
* Setup a flat address mapping page-tables. Stage one simply
|
||||
* maps RAM to the first Gb. The stage2 tables have two 2mb
|
||||
* translation block entries covering a series of adjacent
|
||||
* 4k pages.
|
||||
*/
|
||||
|
||||
/* Stage 1 entry: indexed by IA[38:30] */
|
||||
adr x1, . /* phys address */
|
||||
bic x1, x1, #(1 << 30) - 1 /* 1GB alignment*/
|
||||
add x2, x0, x1, lsr #(30 - 3) /* offset in l1 page table */
|
||||
|
||||
/* point to stage 2 table [47:12] */
|
||||
adrp x0, ttb_stage2
|
||||
orr x1, x0, #3 /* ptr to stage 2 */
|
||||
str x1, [x2]
|
||||
|
||||
/* Stage 2 entries: indexed by IA[29:21] */
|
||||
ldr x5, =(((1 << 9) - 1) << 21)
|
||||
|
||||
/* First block: .text/RO/execute enabled */
|
||||
adr x1, . /* phys address */
|
||||
bic x1, x1, #(1 << 21) - 1 /* 2mb block alignment */
|
||||
and x4, x1, x5 /* IA[29:21] */
|
||||
add x2, x0, x4, lsr #(21 - 3) /* offset in l2 page table */
|
||||
ldr x3, =0x401 /* attr(AF, block) */
|
||||
orr x1, x1, x3
|
||||
str x1, [x2] /* 1st 2mb (.text & rodata) */
|
||||
|
||||
/* Second block: .data/RW/no execute */
|
||||
adrp x1, .data
|
||||
add x1, x1, :lo12:.data
|
||||
bic x1, x1, #(1 << 21) - 1 /* 2mb block alignment */
|
||||
and x4, x1, x5 /* IA[29:21] */
|
||||
add x2, x0, x4, lsr #(21 - 3) /* offset in l2 page table */
|
||||
ldr x3, =(3 << 53) | 0x401 /* attr(AF, NX, block) */
|
||||
orr x1, x1, x3
|
||||
str x1, [x2] /* 2nd 2mb (.data & .bss)*/
|
||||
|
||||
/* Third block: at 'mte_page', set in kernel.ld */
|
||||
adrp x1, mte_page
|
||||
add x1, x1, :lo12:mte_page
|
||||
bic x1, x1, #(1 << 21) - 1
|
||||
and x4, x1, x5
|
||||
add x2, x0, x4, lsr #(21 - 3)
|
||||
/* attr(AF, NX, block, AttrIndx=Attr1) */
|
||||
ldr x3, =(3 << 53) | 0x401 | (1 << 2)
|
||||
orr x1, x1, x3
|
||||
str x1, [x2]
|
||||
|
||||
/* Setup/enable the MMU. */
|
||||
|
||||
/*
|
||||
* TCR_EL1 - Translation Control Registers
|
||||
*
|
||||
* IPS[34:32] = 40-bit PA, 1TB
|
||||
* TG0[14:15] = b00 => 4kb granuale
|
||||
* ORGN0[11:10] = Outer: Normal, WB Read-Alloc No Write-Alloc Cacheable
|
||||
* IRGN0[9:8] = Inner: Normal, WB Read-Alloc No Write-Alloc Cacheable
|
||||
* T0SZ[5:0] = 2^(64 - 25)
|
||||
*
|
||||
* The size of T0SZ controls what the initial lookup level. It
|
||||
* would be nice to start at level 2 but unfortunately for a
|
||||
* flat-mapping on the virt machine we need to handle IA's
|
||||
* with at least 1gb range to see RAM. So we start with a
|
||||
* level 1 lookup.
|
||||
*/
|
||||
ldr x0, = (2 << 32) | 25 | (3 << 10) | (3 << 8)
|
||||
msr tcr_el1, x0
|
||||
|
||||
mov x0, #0xee /* Inner/outer cacheable WB */
|
||||
msr mair_el1, x0
|
||||
isb
|
||||
|
||||
/*
|
||||
* SCTLR_EL1 - System Control Register
|
||||
*
|
||||
* WXN[19] = 0 = no effect, Write does not imply XN (execute never)
|
||||
* I[12] = Instruction cachability control
|
||||
* SA[3] = SP alignment check
|
||||
* C[2] = Data cachability control
|
||||
* M[0] = 1, enable stage 1 address translation for EL0/1
|
||||
*/
|
||||
mrs x0, sctlr_el1
|
||||
ldr x1, =0x100d /* bits I(12) SA(3) C(2) M(0) */
|
||||
bic x0, x0, #(1 << 1) /* clear bit A(1) */
|
||||
bic x0, x0, #(1 << 19) /* clear WXN */
|
||||
orr x0, x0, x1 /* set bits */
|
||||
|
||||
dsb sy
|
||||
msr sctlr_el1, x0
|
||||
isb
|
||||
|
||||
/*
|
||||
* Enable FP/SVE registers. The standard C pre-amble will be
|
||||
* saving these and A-profile compilers will use AdvSIMD
|
||||
* registers unless we tell it not to.
|
||||
*/
|
||||
mrs x0, cpacr_el1
|
||||
orr x0, x0, #(3 << 20)
|
||||
orr x0, x0, #(3 << 16)
|
||||
msr cpacr_el1, x0
|
||||
|
||||
/*
|
||||
* Setup some stack space before we enter the test code.
|
||||
* Assume everything except the return value is garbage when we
|
||||
* return, we won't need it.
|
||||
*/
|
||||
adrp x0, stack_end
|
||||
add x0, x0, :lo12:stack_end
|
||||
mov sp, x0
|
||||
bl main
|
||||
|
||||
/* pass return value to sys exit */
|
||||
_exit:
|
||||
mov x1, x0
|
||||
ldr x0, =0x20026 /* ADP_Stopped_ApplicationExit */
|
||||
stp x0, x1, [sp, #-16]!
|
||||
mov x1, sp
|
||||
mov x0, SYS_EXIT
|
||||
semihosting_call
|
||||
/* never returns */
|
||||
|
||||
/*
|
||||
* Helper Functions
|
||||
*/
|
||||
|
||||
/* Output a single character to serial port */
|
||||
.global __sys_outc
|
||||
__sys_outc:
|
||||
stp x0, x1, [sp, #-16]!
|
||||
/* pass address of c on stack */
|
||||
mov x1, sp
|
||||
mov x0, SYS_WRITEC
|
||||
semihosting_call
|
||||
ldp x0, x1, [sp], #16
|
||||
ret
|
||||
|
||||
.data
|
||||
|
||||
.align 8
|
||||
cmdline:
|
||||
.space 128, 0
|
||||
|
||||
.align 12
|
||||
|
||||
/* Translation table
|
||||
* @4k granuale: 9 bit lookup, 512 entries
|
||||
*/
|
||||
ttb:
|
||||
.space 4096, 0
|
||||
|
||||
.align 12
|
||||
ttb_stage2:
|
||||
.space 4096, 0
|
||||
|
||||
.align 12
|
||||
.global realms_gpt0
|
||||
/* GPT stage 0 table */
|
||||
realms_gpt0:
|
||||
.space 4096, 0
|
||||
.align 17
|
||||
.global realms_gpt1
|
||||
/* GPT stage 1 table, initialised to all 0xFF (full access) */
|
||||
realms_gpt1:
|
||||
.space 524288, 0xFF
|
||||
#ifdef LOGGING_VECTOR_TABLE
|
||||
.align 12
|
||||
.global exception_fault_address
|
||||
.type exception_fault_address, @object
|
||||
.size exception_fault_address, 8
|
||||
.global exception_type_code
|
||||
.type exception_type_code, @object
|
||||
.size exception_type_code, 8
|
||||
/*
|
||||
* These fields record details of the last exception, if
|
||||
* LOGGING_VECTOR_TABLE is defined.
|
||||
*/
|
||||
exception_log:
|
||||
exception_fault_address:
|
||||
/* The contents of FAR_EL3 when an exception is taken. */
|
||||
.space 8, 0
|
||||
exception_type_code:
|
||||
/* A generic code indicating what type of exception occurred. */
|
||||
.space 8, 0
|
||||
#endif
|
||||
.align 12
|
||||
system_stack:
|
||||
.space 4096, 0
|
||||
system_stack_end:
|
||||
|
||||
stack:
|
||||
.space 65536, 0
|
||||
stack_end:
|
||||
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2026 Linaro Ltd
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Global variables exported in boot.S */
|
||||
extern volatile uint64_t exception_fault_address; /* Updated by ISR */
|
||||
extern volatile uint64_t exception_type_code; /* Updated by ISR */
|
||||
extern uint64_t realms_gpt0[];
|
||||
extern uint64_t realms_gpt1[];
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* FEAT_XS Test
|
||||
*
|
||||
* Copyright (c) 2024 Linaro Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <minilib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint64_t isar1;
|
||||
|
||||
asm volatile ("mrs %0, id_aa64isar1_el1" : "=r"(isar1));
|
||||
if (((isar1 >> 56) & 0xf) < 1) {
|
||||
ml_printf("FEAT_XS not supported by CPU");
|
||||
return 1;
|
||||
}
|
||||
/* VMALLE1NXS */
|
||||
asm volatile (".inst 0xd508971f");
|
||||
/* VMALLE1OSNXS */
|
||||
asm volatile (".inst 0xd508911f");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2026 Linaro Ltd
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <minilib.h>
|
||||
#include "boot.h"
|
||||
|
||||
#define ID_AA64PFR0_EL1 "S3_0_C0_C4_0"
|
||||
|
||||
#define GPTBR_EL3 "S3_6_C2_C1_4"
|
||||
#define GPCBW_EL3 "S3_6_C2_C1_5"
|
||||
#define GPCCR_EL3 "S3_6_C2_C1_6"
|
||||
#define VBAR_EL3 "S3_6_C12_C0_0"
|
||||
|
||||
#define get_sys_reg(register_name, dest) \
|
||||
asm("mrs %[reg], " register_name "\n\t" : [reg] "=r" (dest))
|
||||
#define set_sys_reg(register_name, value) \
|
||||
asm("msr " register_name ", %[reg]\n\r" : : [reg] "r" (value))
|
||||
|
||||
const uint32_t gpc_granule_size = 4096;
|
||||
const uint32_t gpis_per_64_bits = 16;
|
||||
|
||||
int main(uint64_t sp)
|
||||
{
|
||||
uint64_t out;
|
||||
uint64_t pfr0;
|
||||
uint64_t gpt_base;
|
||||
uint64_t rme_status;
|
||||
uint64_t currentel_raw;
|
||||
uint64_t currentel;
|
||||
uint64_t gpcbw;
|
||||
uint64_t gpt_table0_addr = (uint64_t) realms_gpt0;
|
||||
uint64_t gpt_table1_addr = (uint64_t) realms_gpt1;
|
||||
|
||||
/* Mask is FNG1, FNG0, and A2 */
|
||||
const uint64_t feature_mask = (1ULL << 18 | 1ULL << 17 | 1ULL << 16);
|
||||
const uint64_t in = feature_mask;
|
||||
|
||||
get_sys_reg("CurrentEL", currentel_raw);
|
||||
currentel = (currentel_raw >> 2) & 0x3;
|
||||
|
||||
if (currentel < 3) {
|
||||
ml_printf("FAIL: Test must be run at EL3 (it is %d)\n", currentel);
|
||||
return 1;
|
||||
}
|
||||
|
||||
get_sys_reg(ID_AA64PFR0_EL1, pfr0);
|
||||
|
||||
/* rme_status is 1 for RME, 2 for RME + GPC2, 3 for RME+GPC3 */
|
||||
rme_status = (pfr0 >> 52) & 0xF;
|
||||
if (rme_status < 2) {
|
||||
ml_printf("SKIP: System does not support RME (RME=%ld)\n", rme_status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Configure the level 0 table for the first 4GB of memory */
|
||||
realms_gpt0[0] = gpt_table1_addr | 0x3; /* Covers GB 0; table descriptor */
|
||||
realms_gpt0[1] = 0xf1; /* Covers GB 1; full access */
|
||||
realms_gpt0[2] = 0xf1; /* Covers GB 2; full access */
|
||||
realms_gpt0[3] = 0xf1; /* Covers GB 3; full access */
|
||||
|
||||
/* Pick an artibtrary location to read inside the first 1GB. */
|
||||
uint64_t fault_location = 0x10202008;
|
||||
uint32_t gpi_index = fault_location / gpc_granule_size;
|
||||
realms_gpt1[gpi_index / gpis_per_64_bits] = 0;
|
||||
|
||||
gpt_base = gpt_table0_addr >> 12;
|
||||
set_sys_reg(GPTBR_EL3, gpt_base);
|
||||
|
||||
/*
|
||||
* Default values:
|
||||
* PPS=0: GPC table 0 protects 4GB.
|
||||
* RLPAD=0: Realm physical address spaces are normal
|
||||
* NSPAD=0: Non-secure physical address spaces are normal
|
||||
* SPAD=0: Secure physical address spaces are normal
|
||||
* IRGN=0: Inner non-cacheable
|
||||
* ORGN=0: Outer non-cacheable
|
||||
* PGS=0: Physical granule size is 4KB.
|
||||
* GPCP=0: All GPC faults reported
|
||||
* TBGPCP=0: Trace buffer rejects trace
|
||||
* L0GPTSZ=0: Each entry in table 0 protects 1GB.
|
||||
* APPSAA=0: Accesses above 4GB must be to Non-secure PAs
|
||||
* GPCBW=0: Bypass windows disabled.
|
||||
* NA6, NA7, NSP, SA, NSO are all reserved values for GPI.
|
||||
*/
|
||||
uint64_t gpccr = 0;
|
||||
|
||||
/* Switch on granule protection check */
|
||||
gpccr |= 1 << 16; /* GPC enabled. */
|
||||
gpccr |= 0b10 << 12; /* SH = Outer shareable */
|
||||
set_sys_reg(GPCCR_EL3, gpccr);
|
||||
|
||||
/* Access some memory outside the GPC forbidden region */
|
||||
uint64_t x = *(unsigned int *) (fault_location + 4096 * 16);
|
||||
ml_printf("Fault address: %lx\n", exception_fault_address);
|
||||
if (exception_fault_address != 0) {
|
||||
ml_printf("FAIL: Memory access was blocked by GPC, "
|
||||
"and should not have been\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Access the GPC forbidden region */
|
||||
x = *(unsigned int *) fault_location;
|
||||
|
||||
ml_printf("Fault address: %lx\n", exception_fault_address);
|
||||
if (exception_fault_address != fault_location) {
|
||||
ml_printf("FAIL: Memory access was not blocked by GPC, "
|
||||
"and should have been\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
rme_status = (pfr0 >> 52) & 0xF;
|
||||
if (rme_status < 3) {
|
||||
ml_printf("SKIP: System does not support GPC3 (RME=%ld)\n", rme_status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Clear the exception record */
|
||||
exception_fault_address = 0;
|
||||
|
||||
/* Enable bypass windows */
|
||||
gpccr |= 1 << 29; /* GPC Bypass windows enabled */
|
||||
set_sys_reg(GPCCR_EL3, gpccr);
|
||||
|
||||
gpcbw = 0; /* Base 0GB, Size 1GB, Stride 1TB */
|
||||
set_sys_reg(GPCBW_EL3, gpcbw);
|
||||
ml_printf("GPCBW configured\n");
|
||||
|
||||
/* Access the GPC forbidden region again */
|
||||
x = *(unsigned int *) fault_location;
|
||||
|
||||
ml_printf("Fault address: %lx\n", exception_fault_address);
|
||||
if (exception_fault_address != 0) {
|
||||
ml_printf("FAIL: Memory access was blocked by GPC, "
|
||||
"and should have been allowed by bypass window. code=%lx\n",
|
||||
exception_type_code);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Clear the exception record */
|
||||
exception_fault_address = 0;
|
||||
/* Reconfigure GPCBW to 1GB start */
|
||||
gpcbw = 1; /* Base 1GB, Size 1GB, Stride 1TB */
|
||||
set_sys_reg(GPCBW_EL3, gpcbw);
|
||||
ml_printf("GPCBW reconfigured for 1GB start\n");
|
||||
|
||||
/* Access the GPC forbidden region again */
|
||||
x = *(unsigned int *) fault_location;
|
||||
|
||||
ml_printf("Fault address: %lx\n", exception_fault_address);
|
||||
if (exception_fault_address != fault_location) {
|
||||
ml_printf("FAIL: Memory access was allowed by GPC, "
|
||||
"and should not have been allowed by bypass window. code=%lx\n",
|
||||
exception_type_code);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
ENTRY(__start)
|
||||
|
||||
MEMORY {
|
||||
/* On virt machine RAM starts at 1 GiB. */
|
||||
|
||||
/* Align text and rodata to the 1st 2 MiB chunk. */
|
||||
TXT (rx) : ORIGIN = 1 << 30, LENGTH = 2M
|
||||
/* Align r/w data to the 2nd 2 MiB chunk. */
|
||||
DAT (rw) : ORIGIN = (1 << 30) + 2M, LENGTH = 2M
|
||||
/* Align the MTE-enabled page to the 3rd 2 MiB chunk. */
|
||||
TAG (rw) : ORIGIN = (1 << 30) + 4M, LENGTH = 2M
|
||||
}
|
||||
|
||||
SECTIONS {
|
||||
.text : {
|
||||
*(.text)
|
||||
*(.rodata)
|
||||
} >TXT
|
||||
.data : {
|
||||
*(.data)
|
||||
*(.bss)
|
||||
} >DAT
|
||||
.tag : {
|
||||
/*
|
||||
* Symbol 'mte_page' is used in boot.S to setup the PTE and in the mte.S
|
||||
* test as the address that the MTE instructions operate on.
|
||||
*/
|
||||
mte_page = .;
|
||||
} >TAG
|
||||
/DISCARD/ : {
|
||||
*(.ARM.attributes)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code to help test the MTE gdbstubs in system mode.
|
||||
*
|
||||
* Copyright (c) 2024 Linaro Limited
|
||||
*
|
||||
* Author: Gustavo Romero <gustavo.romero@linaro.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#define addr x0 /* Ptr to the start of the MTE-enabled page. */
|
||||
#define tagged_addr x1 /* 'addr' ptr with a random-generated tag added. */
|
||||
#define tmp0 x2 /* Scratch register. */
|
||||
#define tmp1 x3 /* Scratch register. */
|
||||
#define tmp2 x4 /* Scratch register. */
|
||||
#define tmp3 x5 /* Sctatch register. */
|
||||
|
||||
.file "mte.S"
|
||||
|
||||
.text
|
||||
.align 4
|
||||
|
||||
.globl main
|
||||
.type main, @function
|
||||
|
||||
main:
|
||||
/*
|
||||
* Set MAIR_EL1 (Memory Attribute Index Register). In boot.S, the
|
||||
* attribute index for .mte_page is set to point to MAILR_EL field Attr1
|
||||
* (AttrIndx=Attr1), so set Attr1 as Tagged Normal (MTE) to enable MTE
|
||||
* on this page.
|
||||
*
|
||||
* Attr1 = 0xF0 => Tagged Normal (MTE)
|
||||
*/
|
||||
mrs tmp0, mair_el1
|
||||
orr tmp0, tmp0, (0xF0 << 8)
|
||||
msr mair_el1, tmp0
|
||||
|
||||
/*
|
||||
* Set TCR_EL1 (Translation Control Registers) to ignore the top byte
|
||||
* in the translated addresses so it can be used to keep the tags.
|
||||
*
|
||||
* TBI0[37] = 0b1 => Top Byte ignored and used for tagged addresses
|
||||
*/
|
||||
mrs tmp1, tcr_el1
|
||||
orr tmp1, tmp1, (1 << 37)
|
||||
msr tcr_el1, tmp1
|
||||
|
||||
/*
|
||||
* Set SCTLR_EL1 (System Control Register) to enable the use of MTE
|
||||
* insns., like stg & friends, and to enable synchronous exception in
|
||||
* case of a tag mismatch, i.e., when the logical tag in 'tagged_addr'
|
||||
* is different from the allocation tag related to 'addr' address.
|
||||
*
|
||||
* ATA[43] = 0b1 => Enable access to allocation tags at EL1
|
||||
* TCF[41:40] = 0b01 => Tag Check Faults cause a synchronous exception
|
||||
*
|
||||
*/
|
||||
mrs tmp2, sctlr_el1
|
||||
mov tmp3, (1 << 43) | (1 << 40)
|
||||
orr tmp2, tmp2, tmp3
|
||||
msr sctlr_el1, tmp2
|
||||
|
||||
isb
|
||||
|
||||
/*
|
||||
* MTE-enabled page resides at the 3rd 2MB chunk in the second 1GB
|
||||
* block, i.e., at 0x40400000 address. See .mte_page section in boot.S
|
||||
* and kernel.ld (where the address is effectively computed).
|
||||
*
|
||||
* Load .mte_page address into 'addr' register.
|
||||
*/
|
||||
adrp addr, mte_page
|
||||
add addr, addr, :lo12:mte_page
|
||||
|
||||
/*
|
||||
* Set GCR for random tag generation. 0xA5 is just a random value to set
|
||||
* GCR != 0 so the tag generated by 'irg' insn. is not zero, which is
|
||||
* more interesting for the tests than when tag is zero.
|
||||
*/
|
||||
mov tmp0, 0xA5
|
||||
msr gcr_el1, tmp0
|
||||
|
||||
/*
|
||||
* Generate a logical tag, add it to 'addr' address and put it into
|
||||
* 'tagged_addr'.
|
||||
*/
|
||||
irg tagged_addr, addr
|
||||
|
||||
/*
|
||||
* Store the generated tag to memory region pointed to by 'addr', i.e.
|
||||
* set the allocation tag for granule at 'addr'. The tag is extracted
|
||||
* by stg from tagged_addr pointer.
|
||||
*/
|
||||
stg tagged_addr, [addr]
|
||||
|
||||
/*
|
||||
* Store a random value (0xdeadbeef) to tagged_addr address. This must
|
||||
* not cause any Tag Check Fault since logical tag in tagged_addr and
|
||||
* allocation tag associated with the memory pointed by tagged_addr are
|
||||
* set the same, otherwise something is off and the test fails -- an
|
||||
* exception is generated.
|
||||
*/
|
||||
ldr tmp1, =0xdeadbeef
|
||||
str tmp1, [tagged_addr]
|
||||
|
||||
/* This label is used by GDB Python script test-mte.py. */
|
||||
main_end:
|
||||
ret
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <stdint.h>
|
||||
#include <minilib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
/*
|
||||
* Test vector from QARMA paper (https://eprint.iacr.org/2016/444.pdf)
|
||||
* to verify one computation of the pauth_computepac() function,
|
||||
* which uses sbox2.
|
||||
*
|
||||
* Use PACGA, because it returns the most bits from ComputePAC.
|
||||
* We still only get the most significant 32-bits of the result.
|
||||
*/
|
||||
|
||||
static const uint64_t d[5] = {
|
||||
0xfb623599da6e8127ull,
|
||||
0x477d469dec0b8762ull,
|
||||
0x84be85ce9804e94bull,
|
||||
0xec2802d4e0a488e9ull,
|
||||
0xc003b93999b33765ull & 0xffffffff00000000ull
|
||||
};
|
||||
uint64_t r;
|
||||
|
||||
asm("msr apgakeyhi_el1, %[w0]\n\t"
|
||||
"msr apgakeylo_el1, %[k0]\n\t"
|
||||
"pacga %[r], %[P], %[T]"
|
||||
: [r] "=r"(r)
|
||||
: [P] "r" (d[0]),
|
||||
[T] "r" (d[1]),
|
||||
[w0] "r" (d[2]),
|
||||
[k0] "r" (d[3]));
|
||||
|
||||
if (r == d[4]) {
|
||||
ml_printf("OK\n");
|
||||
return 0;
|
||||
} else {
|
||||
ml_printf("FAIL: %lx != %lx\n", r, d[4]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
*
|
||||
* FEAT_RME_GDI Feature presence and enabled bits test
|
||||
*
|
||||
* Copyright (c) 2026 Linaro Ltd
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <minilib.h>
|
||||
|
||||
#define ID_AA64PFR0_EL1 "S3_0_C0_C4_0"
|
||||
#define ID_AA64MMFR4_EL1 "S3_0_C0_C7_4"
|
||||
|
||||
int main()
|
||||
{
|
||||
uint64_t mmfr4;
|
||||
uint64_t pfr0;
|
||||
int rme_status;
|
||||
int rmegdi_status;
|
||||
|
||||
asm("mrs %[pfr0], " ID_AA64PFR0_EL1 "\n\t"
|
||||
: [pfr0] "=r" (pfr0));
|
||||
|
||||
/* rme_status is 1 for RME, 2 for RME + GPC2, 3 for RME+GPC3 */
|
||||
rme_status = (pfr0 >> 52) & 0xF;
|
||||
|
||||
asm("mrs %[mmfr4], " ID_AA64MMFR4_EL1 "\n\t"
|
||||
: [mmfr4] "=r" (mmfr4));
|
||||
|
||||
rmegdi_status = ((mmfr4 >> 28) & 0xF);
|
||||
|
||||
if (rmegdi_status < 1) {
|
||||
ml_printf("SKIP: GDI not implemented\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check FEAT_RME and FEAT_RME_GPC2 also present */
|
||||
if (rme_status < 2) {
|
||||
ml_printf("FAIL: GDI is %d, but RME is %d; RME should be >= 2\n",
|
||||
rmegdi_status, rme_status);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Semihosting Console Test
|
||||
*
|
||||
* Copyright (c) 2019 Linaro Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <minilib.h>
|
||||
|
||||
#define SYS_READC 0x7
|
||||
|
||||
uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
|
||||
{
|
||||
register uintptr_t t asm("x0") = type;
|
||||
register uintptr_t a0 asm("x1") = arg0;
|
||||
asm("hlt 0xf000"
|
||||
: "=r" (t)
|
||||
: "r" (t), "r" (a0));
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char c;
|
||||
|
||||
ml_printf("Semihosting Console Test\n");
|
||||
ml_printf("hit X to exit:");
|
||||
|
||||
do {
|
||||
c = __semi_call(SYS_READC, 0);
|
||||
__sys_outc(c);
|
||||
} while (c != 'X');
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Semihosting System HEAPINFO Test
|
||||
*
|
||||
* Copyright (c) 2021 Linaro Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <minilib.h>
|
||||
|
||||
#define SYS_HEAPINFO 0x16
|
||||
|
||||
uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
|
||||
{
|
||||
register uintptr_t t asm("x0") = type;
|
||||
register uintptr_t a0 asm("x1") = arg0;
|
||||
asm("hlt 0xf000"
|
||||
: "=r" (t)
|
||||
: "r" (t), "r" (a0)
|
||||
: "memory" );
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[argc])
|
||||
{
|
||||
struct {
|
||||
void *heap_base;
|
||||
void *heap_limit;
|
||||
void *stack_base;
|
||||
void *stack_limit;
|
||||
} info = { };
|
||||
void *ptr_to_info = (void *) &info;
|
||||
uint32_t *ptr_to_heap;
|
||||
int i;
|
||||
|
||||
ml_printf("Semihosting Heap Info Test\n");
|
||||
|
||||
__semi_call(SYS_HEAPINFO, (uintptr_t) &ptr_to_info);
|
||||
|
||||
if (info.heap_base == NULL || info.heap_limit == NULL) {
|
||||
ml_printf("null heap: %p -> %p\n", info.heap_base, info.heap_limit);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Error if heap base is above limit */
|
||||
if ((uintptr_t) info.heap_base >= (uintptr_t) info.heap_limit) {
|
||||
ml_printf("heap base %p >= heap_limit %p\n",
|
||||
info.heap_base, info.heap_limit);
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (info.stack_base == NULL) {
|
||||
ml_printf("null stack: %p -> %p\n", info.stack_base, info.stack_limit);
|
||||
return -3;
|
||||
}
|
||||
|
||||
/*
|
||||
* boot.S put our stack somewhere inside the data segment of the
|
||||
* ELF file, and we know that SYS_HEAPINFO won't pick a range
|
||||
* that overlaps with part of a loaded ELF file. So the info
|
||||
* struct (on the stack) should not be inside the reported heap.
|
||||
*/
|
||||
if (ptr_to_info > info.heap_base && ptr_to_info < info.heap_limit) {
|
||||
ml_printf("info appears to be inside the heap: %p in %p:%p\n",
|
||||
ptr_to_info, info.heap_base, info.heap_limit);
|
||||
return -4;
|
||||
}
|
||||
|
||||
ml_printf("heap: %p -> %p\n", info.heap_base, info.heap_limit);
|
||||
ml_printf("stack: %p <- %p\n", info.stack_limit, info.stack_base);
|
||||
|
||||
/* finally can we read/write the heap */
|
||||
ptr_to_heap = info.heap_base;
|
||||
for (i = 0; i < 512; i++) {
|
||||
*ptr_to_heap++ = i;
|
||||
}
|
||||
ptr_to_heap = info.heap_base;
|
||||
for (i = 0; i < 512; i++) {
|
||||
uint32_t tmp = *ptr_to_heap;
|
||||
if (tmp != i) {
|
||||
ml_printf("unexpected value in heap: %d @ %p", tmp, ptr_to_heap);
|
||||
return -5;
|
||||
}
|
||||
ptr_to_heap++;
|
||||
}
|
||||
ml_printf("r/w to heap up to %p\n", ptr_to_heap);
|
||||
|
||||
ml_printf("Passed HeapInfo checks\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Simple Virtual Timer Test
|
||||
*
|
||||
* Copyright (c) 2020 Linaro Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <minilib.h>
|
||||
|
||||
/* grabbed from Linux */
|
||||
#define __stringify_1(x...) #x
|
||||
#define __stringify(x...) __stringify_1(x)
|
||||
|
||||
#define read_sysreg(r) ({ \
|
||||
uint64_t __val; \
|
||||
asm volatile("mrs %0, " __stringify(r) : "=r" (__val)); \
|
||||
__val; \
|
||||
})
|
||||
|
||||
#define write_sysreg(r, v) do { \
|
||||
uint64_t __val = (uint64_t)(v); \
|
||||
asm volatile("msr " __stringify(r) ", %x0" \
|
||||
: : "rZ" (__val)); \
|
||||
} while (0)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
ml_printf("VTimer Test\n");
|
||||
|
||||
write_sysreg(cntvoff_el2, 1);
|
||||
write_sysreg(cntv_cval_el0, -1);
|
||||
write_sysreg(cntv_ctl_el0, 1);
|
||||
|
||||
ml_printf("cntvoff_el2=%lx\n", read_sysreg(cntvoff_el2));
|
||||
ml_printf("cntv_cval_el0=%lx\n", read_sysreg(cntv_cval_el0));
|
||||
ml_printf("cntv_ctl_el0=%lx\n", read_sysreg(cntv_ctl_el0));
|
||||
|
||||
/* Now read cval a few times */
|
||||
for (i = 0; i < 10; i++) {
|
||||
ml_printf("%d: cntv_cval_el0=%lx\n", i, read_sysreg(cntv_cval_el0));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/* See https://gitlab.com/qemu-project/qemu/-/issues/2150 */
|
||||
|
||||
int main()
|
||||
{
|
||||
asm volatile(
|
||||
"movi v6.4s, #1\n"
|
||||
"movi v7.4s, #0\n"
|
||||
"sub v6.2d, v7.2d, v6.2d\n"
|
||||
: : : "v6", "v7");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/* See https://gitlab.com/qemu-project/qemu/-/issues/2248 */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
__attribute__((noinline))
|
||||
long test(long x, long y, long sh)
|
||||
{
|
||||
long r;
|
||||
asm("cmp %1, %2\n\t"
|
||||
"cset x12, lt\n\t"
|
||||
"and w11, w12, #0xff\n\t"
|
||||
"cmp w11, #0\n\t"
|
||||
"csetm x14, ne\n\t"
|
||||
"lsr x13, x14, %3\n\t"
|
||||
"sxtb %0, w13"
|
||||
: "=r"(r)
|
||||
: "r"(x), "r"(y), "r"(sh)
|
||||
: "x11", "x12", "x13", "x14");
|
||||
return r;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
long r = test(0, 1, 2);
|
||||
assert(r == -1);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/* Copyright (c) 2024 Linaro Ltd */
|
||||
/* See https://gitlab.com/qemu-project/qemu/-/issues/2375 */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int r, z;
|
||||
|
||||
asm("msr fpcr, %2\n\t"
|
||||
"fjcvtzs %w0, %d3\n\t"
|
||||
"cset %1, eq"
|
||||
: "=r"(r), "=r"(z)
|
||||
: "r"(0x01000000L), /* FZ = 1 */
|
||||
"w"(0xfcff00L)); /* denormal */
|
||||
|
||||
assert(r == 0);
|
||||
assert(z == 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
static void *expected;
|
||||
|
||||
void sigsegv(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
ucontext_t *uc = vuc;
|
||||
|
||||
assert(info->si_addr == expected);
|
||||
uc->uc_mcontext.pc += 4;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
struct sigaction sa = {
|
||||
.sa_sigaction = sigsegv,
|
||||
.sa_flags = SA_SIGINFO
|
||||
};
|
||||
|
||||
void *page;
|
||||
long ofs;
|
||||
|
||||
if (sigaction(SIGSEGV, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
page = mmap(0, getpagesize(), PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
if (page == MAP_FAILED) {
|
||||
perror("mmap");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ofs = 0x124;
|
||||
expected = page + ofs;
|
||||
|
||||
asm("ptrue p0.d, vl1\n\t"
|
||||
"dup z0.d, %0\n\t"
|
||||
"ldnt1h {z1.d}, p0/z, [z0.d, %1]\n\t"
|
||||
"dup z1.d, %1\n\t"
|
||||
"ldnt1h {z0.d}, p0/z, [z1.d, %0]"
|
||||
: : "r"(page), "r"(ofs) : "v0", "v1");
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "../multiarch/test-aes-main.c.inc"
|
||||
|
||||
bool test_SB_SR(uint8_t *o, const uint8_t *i)
|
||||
{
|
||||
/* aese also adds round key, so supply zero. */
|
||||
asm("ld1 { v0.16b }, [%1]\n\t"
|
||||
"movi v1.16b, #0\n\t"
|
||||
"aese v0.16b, v1.16b\n\t"
|
||||
"st1 { v0.16b }, [%0]"
|
||||
: : "r"(o), "r"(i) : "v0", "v1", "memory");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool test_MC(uint8_t *o, const uint8_t *i)
|
||||
{
|
||||
asm("ld1 { v0.16b }, [%1]\n\t"
|
||||
"aesmc v0.16b, v0.16b\n\t"
|
||||
"st1 { v0.16b }, [%0]"
|
||||
: : "r"(o), "r"(i) : "v0", "memory");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool test_SB_SR_MC_AK(uint8_t *o, const uint8_t *i, const uint8_t *k)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool test_ISB_ISR(uint8_t *o, const uint8_t *i)
|
||||
{
|
||||
/* aesd also adds round key, so supply zero. */
|
||||
asm("ld1 { v0.16b }, [%1]\n\t"
|
||||
"movi v1.16b, #0\n\t"
|
||||
"aesd v0.16b, v1.16b\n\t"
|
||||
"st1 { v0.16b }, [%0]"
|
||||
: : "r"(o), "r"(i) : "v0", "v1", "memory");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool test_IMC(uint8_t *o, const uint8_t *i)
|
||||
{
|
||||
asm("ld1 { v0.16b }, [%1]\n\t"
|
||||
"aesimc v0.16b, v0.16b\n\t"
|
||||
"st1 { v0.16b }, [%0]"
|
||||
: : "r"(o), "r"(i) : "v0", "memory");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool test_ISB_ISR_AK_IMC(uint8_t *o, const uint8_t *i, const uint8_t *k)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool test_ISB_ISR_IMC_AK(uint8_t *o, const uint8_t *i, const uint8_t *k)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# A super basic AArch64 BE makefile. As we don't have any big-endian
|
||||
# libc available the best we can do is a basic Hello World.
|
||||
|
||||
AARCH64BE_SRC=$(SRC_PATH)/tests/tcg/aarch64_be
|
||||
VPATH += $(AARCH64BE_SRC)
|
||||
|
||||
AARCH64BE_TEST_SRCS=$(notdir $(wildcard $(AARCH64BE_SRC)/*.c))
|
||||
AARCH64BE_TESTS=$(AARCH64BE_TEST_SRCS:.c=)
|
||||
#MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=)
|
||||
|
||||
# We need to specify big-endian cflags
|
||||
CFLAGS +=-mbig-endian -ffreestanding
|
||||
LDFLAGS +=-nostdlib
|
||||
|
||||
TESTS += $(AARCH64BE_TESTS)
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Non-libc syscall hello world for Aarch64 BE
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#define __NR_write 64
|
||||
#define __NR_exit 93
|
||||
|
||||
int write(int fd, char *buf, int len)
|
||||
{
|
||||
register int x0 __asm__("x0") = fd;
|
||||
register char *x1 __asm__("x1") = buf;
|
||||
register int x2 __asm__("x2") = len;
|
||||
register int x8 __asm__("x8") = __NR_write;
|
||||
|
||||
asm volatile("svc #0" : : "r"(x0), "r"(x1), "r"(x2), "r"(x8));
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
void exit(int ret)
|
||||
{
|
||||
register int x0 __asm__("x0") = ret;
|
||||
register int x8 __asm__("x8") = __NR_exit;
|
||||
|
||||
asm volatile("svc #0" : : "r"(x0), "r"(x8));
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
void _start(void)
|
||||
{
|
||||
write(1, "Hello World\n", 12);
|
||||
exit(0);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
#
|
||||
# Alpha system tests
|
||||
#
|
||||
|
||||
ALPHA_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/alpha/system
|
||||
VPATH+=$(ALPHA_SYSTEM_SRC)
|
||||
|
||||
# These objects provide the basic boot code and helper functions for all tests
|
||||
CRT_OBJS=boot.o
|
||||
|
||||
ALPHA_TEST_SRCS=$(wildcard $(ALPHA_SYSTEM_SRC)/*.c)
|
||||
ALPHA_TESTS = $(patsubst $(ALPHA_SYSTEM_SRC)/%.c, %, $(ALPHA_TEST_SRCS))
|
||||
|
||||
CRT_PATH=$(ALPHA_SYSTEM_SRC)
|
||||
LINK_SCRIPT=$(ALPHA_SYSTEM_SRC)/kernel.ld
|
||||
LDFLAGS=-Wl,-T$(LINK_SCRIPT)
|
||||
TESTS+=$(ALPHA_TESTS) $(MULTIARCH_TESTS)
|
||||
CFLAGS+=-nostdlib -g -O1 -mcpu=ev6 $(MINILIB_INC)
|
||||
LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
|
||||
|
||||
# building head blobs
|
||||
.PRECIOUS: $(CRT_OBJS)
|
||||
|
||||
%.o: $(CRT_PATH)/%.S
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -Wa,--noexecstack -c $< -o $@
|
||||
|
||||
# Build and link the tests
|
||||
%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
memory: CFLAGS+=-DCHECK_UNALIGNED=0 -mbwx
|
||||
|
||||
# Running
|
||||
QEMU_OPTS+=-serial chardev:output -kernel
|
||||
@@ -0,0 +1,18 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# Alpha specific tweaks
|
||||
|
||||
ALPHA_SRC=$(SRC_PATH)/tests/tcg/alpha
|
||||
VPATH+=$(ALPHA_SRC)
|
||||
|
||||
ALPHA_TESTS=hello-alpha test-cond test-cmov test-ovf test-cvttq
|
||||
TESTS+=$(ALPHA_TESTS)
|
||||
|
||||
test-cmov: EXTRA_CFLAGS=-DTEST_CMOV
|
||||
test-cmov: test-cond.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
# Force generation of byte read/write
|
||||
test-plugin-mem-access: CFLAGS+=-mbwx
|
||||
|
||||
run-test-cmov: test-cmov
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
write (1, "hello\n", 6);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,511 @@
|
||||
/*
|
||||
* Minimal Alpha system boot code.
|
||||
*
|
||||
* Copyright Linaro Ltd 2019
|
||||
*/
|
||||
|
||||
.set noat
|
||||
.set nomacro
|
||||
.arch ev6
|
||||
.text
|
||||
|
||||
.macro load_pci_io reg
|
||||
/* For typhoon, this is
|
||||
* 0xfffffc0000000000 -- kseg identity map
|
||||
* + 0x10000000000 -- typhoon pio base
|
||||
* + 0x1fc000000 -- typhoon pchip0 pci base
|
||||
* = 0xfffffd01fc000000
|
||||
*/
|
||||
ldah \reg, -3 /* ff..fd0000 */
|
||||
lda \reg, 0x1fc(\reg) /* ff..fd01fc */
|
||||
sll \reg, 24, \reg
|
||||
.endm
|
||||
|
||||
#define com1Rbr 0x3f8
|
||||
#define com1Thr 0x3f8
|
||||
#define com1Ier 0x3f9
|
||||
#define com1Iir 0x3fa
|
||||
#define com1Lcr 0x3fb
|
||||
#define com1Mcr 0x3fc
|
||||
#define com1Lsr 0x3fd
|
||||
#define com1Msr 0x3fe
|
||||
#define com1Scr 0x3ff
|
||||
#define com1Dll 0x3f8
|
||||
#define com1Dlm 0x3f9
|
||||
|
||||
#define PAL_halt 0
|
||||
#define PAL_wrent 52
|
||||
#define PAL_wrkgp 55
|
||||
|
||||
.text
|
||||
.p2align 4
|
||||
.globl _start
|
||||
.ent _start
|
||||
_start:
|
||||
br $gp, .+4
|
||||
ldah $gp, 0($gp) !gpdisp!1
|
||||
lda $gp, 0($gp) !gpdisp!1
|
||||
|
||||
ldah $sp, $stack_end($gp) !gprelhigh
|
||||
lda $sp, $stack_end($sp) !gprellow
|
||||
|
||||
/* Install kernel gp for exception handlers. */
|
||||
mov $gp, $16
|
||||
call_pal PAL_wrkgp
|
||||
|
||||
/* Install exception handlers. */
|
||||
ldah $16, entInt($gp) !gprelhigh
|
||||
lda $16, entInt($16) !gprellow
|
||||
lda $17, 0
|
||||
call_pal PAL_wrent
|
||||
|
||||
ldah $16, entArith($gp) !gprelhigh
|
||||
lda $16, entArith($16) !gprellow
|
||||
lda $17, 1
|
||||
call_pal PAL_wrent
|
||||
|
||||
ldah $16, entMM($gp) !gprelhigh
|
||||
lda $16, entMM($16) !gprellow
|
||||
lda $17, 2
|
||||
call_pal PAL_wrent
|
||||
|
||||
ldah $16, entIF($gp) !gprelhigh
|
||||
lda $16, entIF($16) !gprellow
|
||||
lda $17, 3
|
||||
call_pal PAL_wrent
|
||||
|
||||
ldah $16, entUna($gp) !gprelhigh
|
||||
lda $16, entUna($16) !gprellow
|
||||
lda $17, 4
|
||||
call_pal PAL_wrent
|
||||
|
||||
ldah $16, entSys($gp) !gprelhigh
|
||||
lda $16, entSys($16) !gprellow
|
||||
lda $17, 5
|
||||
call_pal PAL_wrent
|
||||
|
||||
/*
|
||||
* Initialize COM1.
|
||||
*/
|
||||
load_pci_io $1
|
||||
lda $2, 0x87 /* outb(0x87, com1Lcr); */
|
||||
stb $2, com1Lcr($1)
|
||||
stb $31, com1Dlm($1) /* outb(0, com1Dlm); */
|
||||
lda $2, 3 /* baudconst 3 => 56000 */
|
||||
stb $2, com1Dll($1) /* outb(baudconst, com1Dll); */
|
||||
lda $2, 0x07
|
||||
stb $2, com1Lcr($1) /* outb(0x07, com1Lcr) */
|
||||
lda $2, 0x0f
|
||||
stb $2, com1Mcr($1) /* outb(0x0f, com1Mcr) */
|
||||
|
||||
bsr $26, main !samegp
|
||||
|
||||
/* fall through to _exit */
|
||||
.end _start
|
||||
|
||||
.globl _exit
|
||||
.ent _exit
|
||||
_exit:
|
||||
.frame $sp, 0, $26, 0
|
||||
.prologue 0
|
||||
|
||||
/* We cannot return an error code. */
|
||||
call_pal PAL_halt
|
||||
.end _exit
|
||||
|
||||
/*
|
||||
* We have received an exception that we don't handle. Log and exit.
|
||||
*/
|
||||
.ent log_exit
|
||||
log_exit:
|
||||
entInt:
|
||||
entArith:
|
||||
entMM:
|
||||
entIF:
|
||||
entUna:
|
||||
entSys:
|
||||
ldah $16, $errormsg($gp) !gprelhigh
|
||||
lda $16, $errormsg($16) !gprellow
|
||||
bsr $26, __sys_outs !samegp
|
||||
bsr $26, _exit !samegp
|
||||
.end log_exit
|
||||
|
||||
.section .rodata
|
||||
$errormsg:
|
||||
.string "Terminated by exception.\n"
|
||||
.previous
|
||||
|
||||
/*
|
||||
* Helper Functions
|
||||
*/
|
||||
|
||||
/* Output a single character to serial port */
|
||||
.global __sys_outc
|
||||
.ent __sys_outc
|
||||
__sys_outc:
|
||||
.frame $sp, 0, $26, 0
|
||||
.prologue 0
|
||||
|
||||
load_pci_io $1
|
||||
|
||||
/*
|
||||
* while ((inb(com1Lsr) & 0x20) == 0)
|
||||
* continue;
|
||||
*/
|
||||
1: ldbu $0, com1Lsr($1)
|
||||
and $0, 0x20, $0
|
||||
beq $0, 1b
|
||||
|
||||
/* outb(c, com1Thr); */
|
||||
stb $16, com1Thr($1)
|
||||
ret
|
||||
.end __sys_outc
|
||||
|
||||
/* Output a nul-terminated string to serial port */
|
||||
.global __sys_outs
|
||||
.ent __sys_outs
|
||||
__sys_outs:
|
||||
.frame $sp, 0, $26, 0
|
||||
.prologue 0
|
||||
|
||||
load_pci_io $1
|
||||
|
||||
ldbu $2, 0($16)
|
||||
beq $2, 9f
|
||||
|
||||
/*
|
||||
* while ((inb(com1Lsr) & 0x20) == 0)
|
||||
* continue;
|
||||
*/
|
||||
1: ldbu $0, com1Lsr($1)
|
||||
and $0, 0x20, $0
|
||||
beq $0, 1b
|
||||
|
||||
/* outb(c, com1Thr); */
|
||||
stb $2, com1Thr($1)
|
||||
|
||||
addq $16, 1, $16
|
||||
ldbu $2, 0($16)
|
||||
bne $2, 1b
|
||||
|
||||
9: ret
|
||||
.end __sys_outs
|
||||
|
||||
/*
|
||||
* Division routines that are normally in libc.
|
||||
*
|
||||
* These do not follow the C calling convention. Arguments are in $24+$25,
|
||||
* the result is in $27. Register $28 may be clobbered; everything else
|
||||
* must be saved.
|
||||
*
|
||||
* We store the remainder in $28, so that we can share code.
|
||||
*
|
||||
* We do not signal divide by zero.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unsigned 64-bit division.
|
||||
*/
|
||||
|
||||
.globl __divqu
|
||||
.ent __divqu
|
||||
__divqu:
|
||||
.frame $sp, 48, $23
|
||||
subq $sp, 48, $sp
|
||||
stq $0, 0($sp)
|
||||
stq $1, 8($sp)
|
||||
stq $2, 16($sp)
|
||||
stq $3, 24($sp)
|
||||
stq $4, 32($sp)
|
||||
.prologue 0
|
||||
|
||||
#define mask $0
|
||||
#define divisor $1
|
||||
#define compare $2
|
||||
#define tmp1 $3
|
||||
#define tmp2 $4
|
||||
#define quotient $27
|
||||
#define modulus $28
|
||||
|
||||
mov $24, modulus
|
||||
mov $25, divisor
|
||||
mov $31, quotient
|
||||
mov 1, mask
|
||||
beq $25, 9f
|
||||
|
||||
/* Shift left until divisor >= modulus. */
|
||||
1: cmpult divisor, modulus, compare
|
||||
blt divisor, 2f
|
||||
addq divisor, divisor, divisor
|
||||
addq mask, mask, mask
|
||||
bne compare, 1b
|
||||
|
||||
2: addq quotient, mask, tmp2
|
||||
srl mask, 1, mask
|
||||
cmpule divisor, modulus, compare
|
||||
subq modulus, divisor, tmp1
|
||||
cmovne compare, tmp2, quotient
|
||||
srl divisor, 1, divisor
|
||||
cmovne compare, tmp1, modulus
|
||||
bne mask, 2b
|
||||
|
||||
9: ldq $0, 0($sp)
|
||||
ldq $1, 8($sp)
|
||||
ldq $2, 16($sp)
|
||||
ldq $3, 24($sp)
|
||||
ldq $4, 32($sp)
|
||||
addq $sp, 48, $sp
|
||||
ret $31, ($23), 1
|
||||
|
||||
#undef mask
|
||||
#undef divisor
|
||||
#undef compare
|
||||
#undef tmp1
|
||||
#undef tmp2
|
||||
#undef quotient
|
||||
#undef modulus
|
||||
|
||||
.end __divqu
|
||||
|
||||
/*
|
||||
* Unsigned 64-bit remainder.
|
||||
* Note that __divqu above leaves the result in $28.
|
||||
*/
|
||||
|
||||
.globl __remqu
|
||||
.ent __remqu
|
||||
__remqu:
|
||||
.frame $sp, 16, $23
|
||||
subq $sp, 16, $sp
|
||||
stq $23, 0($sp)
|
||||
.prologue 0
|
||||
|
||||
bsr $23, __divqu
|
||||
|
||||
ldq $23, 0($sp)
|
||||
mov $28, $27
|
||||
addq $sp, 16, $sp
|
||||
ret $31, ($23), 1
|
||||
.end __remqu
|
||||
|
||||
/*
|
||||
* Signed 64-bit division.
|
||||
*/
|
||||
|
||||
.globl __divqs
|
||||
.ent __divqs
|
||||
__divqs:
|
||||
.prologue 0
|
||||
|
||||
/* Common case: both arguments are positive. */
|
||||
bis $24, $25, $28
|
||||
bge $28, __divqu
|
||||
|
||||
/* At least one argument is negative. */
|
||||
subq $sp, 32, $sp
|
||||
stq $23, 0($sp)
|
||||
stq $24, 8($sp)
|
||||
stq $25, 16($sp)
|
||||
|
||||
/* Compute absolute values. */
|
||||
subq $31, $24, $28
|
||||
cmovlt $24, $28, $24
|
||||
subq $31, $25, $28
|
||||
cmovlt $25, $28, $25
|
||||
|
||||
bsr $23, __divqu
|
||||
|
||||
ldq $24, 8($sp)
|
||||
ldq $25, 16($sp)
|
||||
|
||||
/* -a / b = a / -b = -(a / b) */
|
||||
subq $31, $27, $23
|
||||
xor $24, $25, $28
|
||||
cmovlt $28, $23, $27
|
||||
|
||||
ldq $23, 0($sp)
|
||||
addq $sp, 32, $sp
|
||||
ret $31, ($23), 1
|
||||
.end __divqs
|
||||
|
||||
/*
|
||||
* Signed 64-bit remainder.
|
||||
*/
|
||||
|
||||
.globl __remqs
|
||||
.ent __remqs
|
||||
__remqs:
|
||||
.prologue 0
|
||||
|
||||
/* Common case: both arguments are positive. */
|
||||
bis $24, $25, $28
|
||||
bge $28, __remqu
|
||||
|
||||
/* At least one argument is negative. */
|
||||
subq $sp, 32, $sp
|
||||
stq $23, 0($sp)
|
||||
stq $24, 8($sp)
|
||||
stq $25, 16($sp)
|
||||
|
||||
/* Compute absolute values. */
|
||||
subq $31, $24, $28
|
||||
cmovlt $24, $28, $24
|
||||
subq $31, $25, $28
|
||||
cmovlt $25, $28, $25
|
||||
|
||||
bsr $23, __divqu
|
||||
|
||||
ldq $23, 0($sp)
|
||||
ldq $24, 8($sp)
|
||||
ldq $25, 16($sp)
|
||||
|
||||
/* -a % b = -(a % b); a % -b = a % b. */
|
||||
subq $31, $28, $27
|
||||
cmovge $24, $28, $27
|
||||
|
||||
addq $sp, 32, $sp
|
||||
ret $31, ($23), 1
|
||||
.end __remqs
|
||||
|
||||
/*
|
||||
* Unsigned 32-bit division.
|
||||
*/
|
||||
|
||||
.globl __divlu
|
||||
.ent __divlu
|
||||
__divlu:
|
||||
.frame $sp, 32, $23
|
||||
subq $sp, 32, $sp
|
||||
stq $23, 0($sp)
|
||||
stq $24, 8($sp)
|
||||
stq $25, 16($sp)
|
||||
.prologue 0
|
||||
|
||||
/* Zero extend and use the 64-bit routine. */
|
||||
zap $24, 0xf0, $24
|
||||
zap $25, 0xf0, $25
|
||||
bsr $23, __divqu
|
||||
|
||||
addl $27, 0, $27
|
||||
ldq $23, 0($sp)
|
||||
ldq $24, 8($sp)
|
||||
ldq $25, 16($sp)
|
||||
addq $sp, 32, $sp
|
||||
ret $31, ($23), 1
|
||||
.end __divlu
|
||||
|
||||
/*
|
||||
* Unsigned 32-bit remainder.
|
||||
*/
|
||||
|
||||
.globl __remlu
|
||||
.ent __remlu
|
||||
__remlu:
|
||||
.frame $sp, 32, $23
|
||||
subq $sp, 32, $sp
|
||||
stq $23, 0($sp)
|
||||
stq $24, 8($sp)
|
||||
stq $25, 16($sp)
|
||||
.prologue 0
|
||||
|
||||
/* Zero extend and use the 64-bit routine. */
|
||||
zap $24, 0xf0, $24
|
||||
zap $25, 0xf0, $25
|
||||
bsr $23, __divqu
|
||||
|
||||
/* Recall that the remainder is returned in $28. */
|
||||
addl $28, 0, $27
|
||||
ldq $23, 0($sp)
|
||||
ldq $24, 8($sp)
|
||||
ldq $25, 16($sp)
|
||||
addq $sp, 32, $sp
|
||||
ret $31, ($23), 1
|
||||
.end __remlu
|
||||
|
||||
/*
|
||||
* Signed 32-bit division.
|
||||
*/
|
||||
|
||||
.globl __divls
|
||||
.ent __divls
|
||||
__divls:
|
||||
.frame $sp, 32, $23
|
||||
subq $sp, 32, $sp
|
||||
stq $23, 0($sp)
|
||||
stq $24, 8($sp)
|
||||
stq $25, 16($sp)
|
||||
.prologue 0
|
||||
|
||||
/* Sign extend. */
|
||||
addl $24, 0, $24
|
||||
addl $25, 0, $25
|
||||
|
||||
/* Compute absolute values. */
|
||||
subq $31, $24, $28
|
||||
cmovlt $24, $28, $24
|
||||
subq $31, $25, $28
|
||||
cmovlt $25, $28, $25
|
||||
|
||||
bsr $23, __divqu
|
||||
|
||||
ldq $24, 8($sp)
|
||||
ldq $25, 16($sp)
|
||||
|
||||
/* Negate the unsigned result, if necessary. */
|
||||
xor $24, $25, $28
|
||||
subl $31, $27, $23
|
||||
addl $27, 0, $27
|
||||
addl $28, 0, $28
|
||||
cmovlt $28, $23, $27
|
||||
|
||||
ldq $23, 0($sp)
|
||||
addq $sp, 32, $sp
|
||||
ret $31, ($23), 1
|
||||
.end __divls
|
||||
|
||||
/*
|
||||
* Signed 32-bit remainder.
|
||||
*/
|
||||
|
||||
.globl __remls
|
||||
.ent __remls
|
||||
__remls:
|
||||
.frame $sp, 32, $23
|
||||
subq $sp, 32, $sp
|
||||
stq $23, 0($sp)
|
||||
stq $24, 8($sp)
|
||||
stq $25, 16($sp)
|
||||
.prologue 0
|
||||
|
||||
/* Sign extend. */
|
||||
addl $24, 0, $24
|
||||
addl $25, 0, $25
|
||||
|
||||
/* Compute absolute values. */
|
||||
subq $31, $24, $28
|
||||
cmovlt $24, $28, $24
|
||||
subq $31, $25, $28
|
||||
cmovlt $25, $28, $25
|
||||
|
||||
bsr $23, __divqu
|
||||
|
||||
ldq $23, 0($sp)
|
||||
ldq $24, 8($sp)
|
||||
ldq $25, 16($sp)
|
||||
|
||||
/* Negate the unsigned result, if necessary. */
|
||||
subl $31, $28, $27
|
||||
addl $28, 0, $28
|
||||
cmovge $24, $28, $27
|
||||
|
||||
addq $sp, 32, $sp
|
||||
ret $31, ($23), 1
|
||||
.end __remls
|
||||
|
||||
.data
|
||||
.p2align 4
|
||||
stack:
|
||||
.skip 65536
|
||||
$stack_end:
|
||||
.type stack,@object
|
||||
.size stack, . - stack
|
||||
@@ -0,0 +1,30 @@
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* Linux kernel legacy start address. */
|
||||
. = 0xfffffc0000310000;
|
||||
_text = .;
|
||||
.text : {
|
||||
*(.text)
|
||||
}
|
||||
.rodata : {
|
||||
*(.rodata)
|
||||
}
|
||||
_etext = .;
|
||||
|
||||
. = ALIGN(8192);
|
||||
_data = .;
|
||||
.got : {
|
||||
*(.got)
|
||||
}
|
||||
.data : {
|
||||
*(.sdata)
|
||||
*(.data)
|
||||
}
|
||||
_edata = .;
|
||||
.bss : {
|
||||
*(.bss)
|
||||
}
|
||||
_end = .;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef TEST_CMOV
|
||||
|
||||
#define TEST_COND(N) \
|
||||
int test_##N (long a) \
|
||||
{ \
|
||||
int res = 1; \
|
||||
\
|
||||
asm ("cmov"#N" %1,$31,%0" \
|
||||
: "+r" (res) : "r" (a)); \
|
||||
return !res; \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define TEST_COND(N) \
|
||||
int test_##N (long a) \
|
||||
{ \
|
||||
int res = 1; \
|
||||
\
|
||||
asm ("b"#N" %1,1f\n\t" \
|
||||
"addq $31,$31,%0\n\t" \
|
||||
"1: unop\n" \
|
||||
: "+r" (res) : "r" (a)); \
|
||||
return res; \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
TEST_COND(eq)
|
||||
TEST_COND(ne)
|
||||
TEST_COND(ge)
|
||||
TEST_COND(gt)
|
||||
TEST_COND(lbc)
|
||||
TEST_COND(lbs)
|
||||
TEST_COND(le)
|
||||
TEST_COND(lt)
|
||||
|
||||
static struct {
|
||||
int (*func)(long);
|
||||
long v;
|
||||
int r;
|
||||
} vectors[] =
|
||||
{
|
||||
{test_eq, 0, 1},
|
||||
{test_eq, 1, 0},
|
||||
|
||||
{test_ne, 0, 0},
|
||||
{test_ne, 1, 1},
|
||||
|
||||
{test_ge, 0, 1},
|
||||
{test_ge, 1, 1},
|
||||
{test_ge, -1, 0},
|
||||
|
||||
{test_gt, 0, 0},
|
||||
{test_gt, 1, 1},
|
||||
{test_gt, -1, 0},
|
||||
|
||||
{test_lbc, 0, 1},
|
||||
{test_lbc, 1, 0},
|
||||
{test_lbc, -1, 0},
|
||||
|
||||
{test_lbs, 0, 0},
|
||||
{test_lbs, 1, 1},
|
||||
{test_lbs, -1, 1},
|
||||
|
||||
{test_le, 0, 1},
|
||||
{test_le, 1, 0},
|
||||
{test_le, -1, 1},
|
||||
|
||||
{test_lt, 0, 0},
|
||||
{test_lt, 1, 0},
|
||||
{test_lt, -1, 1},
|
||||
};
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++)
|
||||
if ((*vectors[i].func)(vectors[i].v) != vectors[i].r) {
|
||||
write(1, "Failed\n", 7);
|
||||
return 1;
|
||||
}
|
||||
write(1, "OK\n", 3);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define FPCR_SUM (1UL << 63)
|
||||
#define FPCR_INED (1UL << 62)
|
||||
#define FPCR_UNFD (1UL << 61)
|
||||
#define FPCR_UNDZ (1UL << 60)
|
||||
#define FPCR_DYN_SHIFT 58
|
||||
#define FPCR_DYN_CHOPPED (0UL << FPCR_DYN_SHIFT)
|
||||
#define FPCR_DYN_MINUS (1UL << FPCR_DYN_SHIFT)
|
||||
#define FPCR_DYN_NORMAL (2UL << FPCR_DYN_SHIFT)
|
||||
#define FPCR_DYN_PLUS (3UL << FPCR_DYN_SHIFT)
|
||||
#define FPCR_DYN_MASK (3UL << FPCR_DYN_SHIFT)
|
||||
#define FPCR_IOV (1UL << 57)
|
||||
#define FPCR_INE (1UL << 56)
|
||||
#define FPCR_UNF (1UL << 55)
|
||||
#define FPCR_OVF (1UL << 54)
|
||||
#define FPCR_DZE (1UL << 53)
|
||||
#define FPCR_INV (1UL << 52)
|
||||
#define FPCR_OVFD (1UL << 51)
|
||||
#define FPCR_DZED (1UL << 50)
|
||||
#define FPCR_INVD (1UL << 49)
|
||||
#define FPCR_DNZ (1UL << 48)
|
||||
#define FPCR_DNOD (1UL << 47)
|
||||
#define FPCR_STATUS_MASK (FPCR_IOV | FPCR_INE | FPCR_UNF \
|
||||
| FPCR_OVF | FPCR_DZE | FPCR_INV)
|
||||
|
||||
static long test_cvttq(long *ret_e, double d)
|
||||
{
|
||||
unsigned long reset = (FPCR_INED | FPCR_UNFD | FPCR_OVFD | FPCR_DZED |
|
||||
FPCR_INVD | FPCR_DYN_NORMAL);
|
||||
long r, e;
|
||||
|
||||
asm("excb\n\t"
|
||||
"mt_fpcr %3\n\t"
|
||||
"excb\n\t"
|
||||
"cvttq/svic %2, %0\n\t"
|
||||
"excb\n\t"
|
||||
"mf_fpcr %1\n\t"
|
||||
"excb\n\t"
|
||||
: "=f"(r), "=f"(e)
|
||||
: "f"(d), "f"(reset));
|
||||
|
||||
*ret_e = e & FPCR_STATUS_MASK;
|
||||
return r;
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
static const struct {
|
||||
double d;
|
||||
long r;
|
||||
long e;
|
||||
} T[] = {
|
||||
{ 1.0, 1, 0 },
|
||||
{ -1.0, -1, 0 },
|
||||
{ 1.5, 1, FPCR_INE },
|
||||
{ 0x1.0p32, 0x0000000100000000ul, 0 },
|
||||
{ -0x1.0p63, 0x8000000000000000ul, 0 },
|
||||
{ 0x1.0p63, 0x8000000000000000ul, FPCR_IOV | FPCR_INE },
|
||||
{ 0x1.0p64, 0x0000000000000000ul, FPCR_IOV | FPCR_INE },
|
||||
{ 0x1.cccp64, 0xccc0000000000000ul, FPCR_IOV | FPCR_INE },
|
||||
{ __builtin_inf(), 0, FPCR_INV },
|
||||
{ __builtin_nan(""), 0, FPCR_INV },
|
||||
};
|
||||
|
||||
int i, err = 0;
|
||||
|
||||
for (i = 0; i < sizeof(T)/sizeof(T[0]); i++) {
|
||||
long e, r = test_cvttq(&e, T[i].d);
|
||||
|
||||
if (r != T[i].r || e != T[i].e) {
|
||||
printf("Fail %a: expect (%016lx : %04lx) got (%016lx : %04lx)\n",
|
||||
T[i].d, T[i].r, T[i].e >> 48, r, e >> 48);
|
||||
err = 1;
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <unistd.h>
|
||||
|
||||
static long test_subqv (long a, long b)
|
||||
{
|
||||
long res;
|
||||
|
||||
asm ("subq/v %1,%2,%0"
|
||||
: "=r" (res) : "r" (a), "r" (b));
|
||||
return res;
|
||||
}
|
||||
static struct {
|
||||
long (*func)(long, long);
|
||||
long a;
|
||||
long b;
|
||||
long r;
|
||||
} vectors[] =
|
||||
{
|
||||
{test_subqv, 0, 0x7d54000, 0xfffffffff82ac000L}
|
||||
};
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++)
|
||||
if ((*vectors[i].func)(vectors[i].a, vectors[i].b) != vectors[i].r) {
|
||||
write(1, "Failed\n", 7);
|
||||
}
|
||||
write(1, "OK\n", 3);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# ARM SoftMMU tests - included from tests/tcg/Makefile
|
||||
#
|
||||
|
||||
ARM_SRC=$(SRC_PATH)/tests/tcg/arm/system
|
||||
|
||||
# Set search path for all sources
|
||||
VPATH += $(ARM_SRC)
|
||||
|
||||
# Specific Test Rules
|
||||
|
||||
test-armv6m-undef: test-armv6m-undef.S
|
||||
$(CC) -mcpu=cortex-m0 -mfloat-abi=soft \
|
||||
-Wl,--build-id=none -x assembler-with-cpp \
|
||||
$< -o $@ -nostdlib -static \
|
||||
-T $(ARM_SRC)/$@.ld
|
||||
|
||||
run-test-armv6m-undef: QEMU_OPTS=-semihosting-config enable=on,target=native,chardev=output -M microbit -kernel
|
||||
|
||||
ARM_TESTS+=test-armv6m-undef
|
||||
|
||||
# These objects provide the basic boot code and helper functions for all tests
|
||||
CRT_OBJS=boot.o
|
||||
|
||||
ARM_TEST_SRCS=$(wildcard $(ARM_SRC)/*.c)
|
||||
ARM_TESTS+=$(patsubst $(ARM_SRC)/%.c, %, $(ARM_TEST_SRCS))
|
||||
|
||||
CRT_PATH=$(ARM_SRC)
|
||||
LINK_SCRIPT=$(ARM_SRC)/kernel.ld
|
||||
LDFLAGS=-Wl,-T$(LINK_SCRIPT)
|
||||
CFLAGS+=-march=armv7-a+fp -ffreestanding -nostdlib -ggdb -O0 $(MINILIB_INC)
|
||||
LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
|
||||
|
||||
# building head blobs
|
||||
.PRECIOUS: $(CRT_OBJS)
|
||||
|
||||
%.o: $(ARM_SRC)/%.S
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -Wa,--noexecstack -c $< -o $@
|
||||
|
||||
# Build and link the tests
|
||||
%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
memory: CFLAGS+=-DCHECK_UNALIGNED=0
|
||||
|
||||
# Running
|
||||
QEMU_BASE_MACHINE=-M virt -cpu max -display none
|
||||
QEMU_OPTS+=$(QEMU_BASE_MACHINE) -semihosting-config enable=on,target=native,chardev=output -kernel
|
||||
|
||||
# console test is manual only
|
||||
QEMU_SEMIHOST=-serial none -chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline
|
||||
run-semiconsole: QEMU_OPTS=$(QEMU_BASE_MACHINE) $(QEMU_SEMIHOST) -kernel
|
||||
run-semiconsole: semiconsole
|
||||
$(call skip-test, $<, "MANUAL ONLY")
|
||||
$(if $(V),@printf " %-7s %s %s\n" "TO RUN" $(notdir $(QEMU)) "$(QEMU_OPTS) $<")
|
||||
run-plugin-semiconsole-with-%: semiconsole
|
||||
$(call skip-test, $<, "MANUAL ONLY")
|
||||
|
||||
# Simple Record/Replay Test
|
||||
.PHONY: memory-record
|
||||
run-memory-record: memory-record memory
|
||||
$(call run-test, $<, \
|
||||
$(QEMU) -monitor none -display none \
|
||||
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
|
||||
-icount shift=5$(COMMA)rr=record$(COMMA)rrfile=record.bin \
|
||||
$(QEMU_OPTS) memory)
|
||||
|
||||
.PHONY: memory-replay
|
||||
run-memory-replay: memory-replay run-memory-record
|
||||
$(call run-test, $<, \
|
||||
$(QEMU) -monitor none -display none \
|
||||
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
|
||||
-icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \
|
||||
$(QEMU_OPTS) memory)
|
||||
|
||||
EXTRA_RUNS+=run-memory-replay
|
||||
|
||||
TESTS += $(ARM_TESTS) $(MULTIARCH_TESTS)
|
||||
EXTRA_RUNS+=$(MULTIARCH_RUNS)
|
||||
@@ -0,0 +1,87 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# ARM - included from tests/tcg/Makefile
|
||||
#
|
||||
|
||||
ARM_SRC=$(SRC_PATH)/tests/tcg/arm
|
||||
|
||||
# Set search path for all sources
|
||||
VPATH += $(ARM_SRC)
|
||||
|
||||
config-cc.mak: Makefile
|
||||
$(quiet-@)( \
|
||||
$(call cc-option,-fno-integrated-as, CROSS_CC_HAS_FNIA)) 3> config-cc.mak
|
||||
-include config-cc.mak
|
||||
|
||||
float_madds: CFLAGS+=-mfpu=neon-vfpv4
|
||||
|
||||
# Basic Hello World
|
||||
ARM_TESTS = hello-arm
|
||||
hello-arm: CFLAGS+=-marm -ffreestanding -fno-stack-protector
|
||||
hello-arm: LDFLAGS+=-nostdlib
|
||||
|
||||
# Float-convert Tests
|
||||
ARM_TESTS += fcvt
|
||||
fcvt: LDFLAGS += -lm
|
||||
fcvt: CFLAGS += -march=armv8.2-a+fp16 -mfpu=neon-fp-armv8
|
||||
run-fcvt: fcvt
|
||||
$(call run-test,fcvt,$(QEMU) $<)
|
||||
$(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref)
|
||||
|
||||
# PC alignment test
|
||||
ARM_TESTS += pcalign-a32
|
||||
pcalign-a32: CFLAGS+=-marm
|
||||
|
||||
ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y)
|
||||
|
||||
# Semihosting smoke test for linux-user
|
||||
semihosting: CFLAGS += -mthumb
|
||||
|
||||
ARM_TESTS += semihosting-arm
|
||||
semihosting-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
|
||||
semihosting-arm: semihosting.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
run-semihosting-arm: semihosting-arm
|
||||
$(call run-test,$<,$(QEMU) $< 2> $<.err)
|
||||
|
||||
ARM_TESTS += semiconsole-arm
|
||||
|
||||
semiconsole: CFLAGS += -mthumb
|
||||
|
||||
semiconsole-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
|
||||
semiconsole-arm: semihosting.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
run-semiconsole-arm: semiconsole-arm
|
||||
$(call skip-test, $<, "MANUAL ONLY")
|
||||
|
||||
endif
|
||||
|
||||
ARM_TESTS += commpage
|
||||
|
||||
# Vector SHA1
|
||||
# Work around compiler false-positive warning, as we do for the 'sha1' test
|
||||
sha1-vector: CFLAGS=-O3 -Wno-stringop-overread
|
||||
sha1-vector: sha1.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
run-sha1-vector: sha1-vector run-sha1
|
||||
$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
|
||||
$(call diff-out, sha1-vector, sha1.out)
|
||||
|
||||
ARM_TESTS += sha1-vector
|
||||
|
||||
# Vector versions of sha512 (-O3 triggers vectorisation)
|
||||
sha512-vector: CFLAGS=-O3
|
||||
sha512-vector: sha512.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
||||
|
||||
ARM_TESTS += sha512-vector
|
||||
|
||||
ifeq ($(CONFIG_PLUGIN),y)
|
||||
# Require emitting arm32 instructions, otherwise the vCPU might accidentally
|
||||
# try to execute Thumb instructions in arm32 mode after qemu_plugin_set_pc()
|
||||
test-plugin-set-pc: CFLAGS+=-marm
|
||||
endif
|
||||
|
||||
TESTS += $(ARM_TESTS)
|
||||
@@ -0,0 +1,6 @@
|
||||
These are ARM specific guest programs
|
||||
|
||||
hello-arm
|
||||
---------
|
||||
|
||||
A very simple inline assembly, write syscall based hello world
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Verify the COMMPAGE emulation
|
||||
*
|
||||
* The ARM commpage is a set of user space helper functions provided
|
||||
* by the kernel in an effort to ease portability of user space code
|
||||
* between different CPUs with potentially different capabilities. It
|
||||
* is a 32 bit invention and similar to the vdso segment in many ways.
|
||||
*
|
||||
* The ABI is documented in the Linux kernel:
|
||||
* Documentation/arm/kernel_userspace_helpers.rst
|
||||
*
|
||||
* Copyright (c) 2020 Linaro Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define ARM_COMMPAGE (0xffff0f00u)
|
||||
#define ARM_KUSER_VERSION (*(int32_t *)(ARM_COMMPAGE + 0xfc))
|
||||
typedef void * (get_tls_fn)(void);
|
||||
#define ARM_KUSER_GET_TLS (*(get_tls_fn *)(ARM_COMMPAGE + 0xe0))
|
||||
typedef int (cmpxchg_fn)(int oldval, int newval, volatile int *ptr);
|
||||
#define ARM_KUSER_CMPXCHG (*(cmpxchg_fn *)(ARM_COMMPAGE + 0xc0))
|
||||
typedef void (dmb_fn)(void);
|
||||
#define ARM_KUSER_DMB (*(dmb_fn *)(ARM_COMMPAGE + 0xa0))
|
||||
typedef int (cmpxchg64_fn)(const int64_t *oldval,
|
||||
const int64_t *newval,
|
||||
volatile int64_t *ptr);
|
||||
#define ARM_KUSER_CMPXCHG64 (*(cmpxchg64_fn *)(ARM_COMMPAGE + 0x60))
|
||||
|
||||
#define fail_unless(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
fprintf(stderr, "FAILED at %s:%d\n", __FILE__, __LINE__); \
|
||||
exit(EXIT_FAILURE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
int main(int argc, char *argv[argc])
|
||||
{
|
||||
void *kuser_tls;
|
||||
int val = 1;
|
||||
const int64_t oldval = 1, newval = 2;
|
||||
int64_t val64 = 1;
|
||||
|
||||
fail_unless(ARM_KUSER_VERSION == 0x5);
|
||||
kuser_tls = ARM_KUSER_GET_TLS();
|
||||
printf("TLS = %p\n", kuser_tls);
|
||||
fail_unless(kuser_tls != 0);
|
||||
fail_unless(ARM_KUSER_CMPXCHG(1, 2, &val) == 0);
|
||||
printf("val = %d\n", val);
|
||||
/* this is a crash test, not checking an actual barrier occurs */
|
||||
ARM_KUSER_DMB();
|
||||
fail_unless(ARM_KUSER_CMPXCHG64(&oldval, &newval, &val64) == 0);
|
||||
printf("val64 = %lld\n", val64);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,467 @@
|
||||
/*
|
||||
* Test Floating Point Conversion
|
||||
*/
|
||||
|
||||
/* we want additional float type definitions */
|
||||
#define __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
#define __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
#include <fenv.h>
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
static char flag_str[256];
|
||||
|
||||
static char *get_flag_state(int flags)
|
||||
{
|
||||
if (flags) {
|
||||
snprintf(flag_str, sizeof(flag_str), "%s %s %s %s %s",
|
||||
flags & FE_OVERFLOW ? "OVERFLOW" : "",
|
||||
flags & FE_UNDERFLOW ? "UNDERFLOW" : "",
|
||||
flags & FE_DIVBYZERO ? "DIV0" : "",
|
||||
flags & FE_INEXACT ? "INEXACT" : "",
|
||||
flags & FE_INVALID ? "INVALID" : "");
|
||||
} else {
|
||||
snprintf(flag_str, sizeof(flag_str), "OK");
|
||||
}
|
||||
|
||||
return flag_str;
|
||||
}
|
||||
|
||||
static void print_double_number(int i, double num)
|
||||
{
|
||||
uint64_t double_as_hex = *(uint64_t *) #
|
||||
int flags = fetestexcept(FE_ALL_EXCEPT);
|
||||
char *fstr = get_flag_state(flags);
|
||||
|
||||
printf("%02d DOUBLE: %02.20e / %#020" PRIx64 " (%#x => %s)\n",
|
||||
i, num, double_as_hex, flags, fstr);
|
||||
}
|
||||
|
||||
static void print_single_number(int i, float num)
|
||||
{
|
||||
uint32_t single_as_hex = *(uint32_t *) #
|
||||
int flags = fetestexcept(FE_ALL_EXCEPT);
|
||||
char *fstr = get_flag_state(flags);
|
||||
|
||||
printf("%02d SINGLE: %02.20e / %#010x (%#x => %s)\n",
|
||||
i, num, single_as_hex, flags, fstr);
|
||||
}
|
||||
|
||||
static void print_half_number(int i, uint16_t num)
|
||||
{
|
||||
int flags = fetestexcept(FE_ALL_EXCEPT);
|
||||
char *fstr = get_flag_state(flags);
|
||||
|
||||
printf("%02d HALF: %#04x (%#x => %s)\n",
|
||||
i, num, flags, fstr);
|
||||
}
|
||||
|
||||
static void print_int64(int i, int64_t num)
|
||||
{
|
||||
uint64_t int64_as_hex = *(uint64_t *) #
|
||||
int flags = fetestexcept(FE_ALL_EXCEPT);
|
||||
char *fstr = get_flag_state(flags);
|
||||
|
||||
printf("%02d INT64: %20" PRId64 "/%#020" PRIx64 " (%#x => %s)\n",
|
||||
i, num, int64_as_hex, flags, fstr);
|
||||
}
|
||||
|
||||
#ifndef SNANF
|
||||
/* Signaling NaN macros, if supported. */
|
||||
# define SNANF (__builtin_nansf (""))
|
||||
# define SNAN (__builtin_nans (""))
|
||||
# define SNANL (__builtin_nansl (""))
|
||||
#endif
|
||||
|
||||
float single_numbers[] = { -SNANF,
|
||||
-NAN,
|
||||
-INFINITY,
|
||||
-FLT_MAX,
|
||||
-1.111E+31,
|
||||
-1.111E+30,
|
||||
-1.08700982e-12,
|
||||
-1.78051176e-20,
|
||||
-FLT_MIN,
|
||||
0.0,
|
||||
FLT_MIN,
|
||||
2.98023224e-08,
|
||||
5.96046E-8, /* min positive FP16 subnormal */
|
||||
6.09756E-5, /* max subnormal FP16 */
|
||||
6.10352E-5, /* min positive normal FP16 */
|
||||
1.0,
|
||||
1.0009765625, /* smallest float after 1.0 FP16 */
|
||||
2.0,
|
||||
M_E, M_PI,
|
||||
65503.0,
|
||||
65504.0, /* max FP16 */
|
||||
65505.0,
|
||||
131007.0,
|
||||
131008.0, /* max AFP */
|
||||
131009.0,
|
||||
1.111E+30,
|
||||
FLT_MAX,
|
||||
INFINITY,
|
||||
NAN,
|
||||
SNANF };
|
||||
|
||||
static void convert_single_to_half(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting single-precision to half-precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(single_numbers); ++i) {
|
||||
float input = single_numbers[i];
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_single_number(i, input);
|
||||
#if defined(__arm__)
|
||||
uint32_t output;
|
||||
asm("vcvtb.f16.f32 %0, %1" : "=t" (output) : "x" (input));
|
||||
#else
|
||||
uint16_t output;
|
||||
asm("fcvt %h0, %s1" : "=w" (output) : "w" (input));
|
||||
#endif
|
||||
print_half_number(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
static void convert_single_to_double(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting single-precision to double-precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(single_numbers); ++i) {
|
||||
float input = single_numbers[i];
|
||||
/* uint64_t output; */
|
||||
double output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_single_number(i, input);
|
||||
#if defined(__arm__)
|
||||
asm("vcvt.f64.f32 %P0, %1" : "=w" (output) : "t" (input));
|
||||
#else
|
||||
asm("fcvt %d0, %s1" : "=w" (output) : "w" (input));
|
||||
#endif
|
||||
print_double_number(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
static void convert_single_to_integer(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting single-precision to integer\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(single_numbers); ++i) {
|
||||
float input = single_numbers[i];
|
||||
int64_t output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_single_number(i, input);
|
||||
#if defined(__arm__)
|
||||
/* asm("vcvt.s32.f32 %s0, %s1" : "=t" (output) : "t" (input)); */
|
||||
output = input;
|
||||
#else
|
||||
#ifdef FPRCVT
|
||||
asm("fcvtzs d0, %s1\r\n"
|
||||
"fmov %0, d0" :
|
||||
"=r" (output) : "w" (input));
|
||||
#else
|
||||
asm("fcvtzs %0, %s1" : "=r" (output) : "w" (input));
|
||||
#endif
|
||||
#endif
|
||||
print_int64(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
/* This allows us to initialise some doubles as pure hex */
|
||||
typedef union {
|
||||
double d;
|
||||
uint64_t h;
|
||||
} test_doubles;
|
||||
|
||||
test_doubles double_numbers[] = {
|
||||
{SNAN},
|
||||
{-NAN},
|
||||
{-INFINITY},
|
||||
{-DBL_MAX},
|
||||
{-FLT_MAX-1.0},
|
||||
{-FLT_MAX},
|
||||
{-1.111E+31},
|
||||
{-1.111E+30}, /* half prec */
|
||||
{-2.0}, {-1.0},
|
||||
{-DBL_MIN},
|
||||
{-FLT_MIN},
|
||||
{0.0},
|
||||
{FLT_MIN},
|
||||
{2.98023224e-08},
|
||||
{5.96046E-8}, /* min positive FP16 subnormal */
|
||||
{6.09756E-5}, /* max subnormal FP16 */
|
||||
{6.10352E-5}, /* min positive normal FP16 */
|
||||
{1.0},
|
||||
{1.0009765625}, /* smallest float after 1.0 FP16 */
|
||||
{DBL_MIN},
|
||||
{1.3789972848607228e-308},
|
||||
{1.4914738736681624e-308},
|
||||
{1.0}, {2.0},
|
||||
{M_E}, {M_PI},
|
||||
{65503.0},
|
||||
{65504.0}, /* max FP16 */
|
||||
{65505.0},
|
||||
{131007.0},
|
||||
{131008.0}, /* max AFP */
|
||||
{131009.0},
|
||||
{.h = 0x41dfffffffc00000 }, /* to int = 0x7fffffff */
|
||||
{FLT_MAX},
|
||||
{FLT_MAX + 1.0},
|
||||
{DBL_MAX},
|
||||
{INFINITY},
|
||||
{NAN},
|
||||
{.h = 0x7ff0000000000001}, /* SNAN */
|
||||
{SNAN},
|
||||
};
|
||||
|
||||
static void convert_double_to_half(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting double-precision to half-precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(double_numbers); ++i) {
|
||||
double input = double_numbers[i].d;
|
||||
uint16_t output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_double_number(i, input);
|
||||
|
||||
/* as we don't have _Float16 support */
|
||||
#if defined(__arm__)
|
||||
/* asm("vcvtb.f16.f64 %0, %P1" : "=t" (output) : "x" (input)); */
|
||||
output = input;
|
||||
#else
|
||||
asm("fcvt %h0, %d1" : "=w" (output) : "w" (input));
|
||||
#endif
|
||||
print_half_number(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
static void convert_double_to_single(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting double-precision to single-precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(double_numbers); ++i) {
|
||||
double input = double_numbers[i].d;
|
||||
float output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_double_number(i, input);
|
||||
|
||||
#if defined(__arm__)
|
||||
asm("vcvt.f32.f64 %0, %P1" : "=w" (output) : "x" (input));
|
||||
#else
|
||||
asm("fcvt %s0, %d1" : "=w" (output) : "w" (input));
|
||||
#endif
|
||||
|
||||
print_single_number(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
static void convert_double_to_integer(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting double-precision to integer\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(double_numbers); ++i) {
|
||||
double input = double_numbers[i].d;
|
||||
int64_t output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_double_number(i, input);
|
||||
#if defined(__arm__)
|
||||
/* asm("vcvt.s32.f32 %s0, %s1" : "=t" (output) : "t" (input)); */
|
||||
output = input;
|
||||
#else
|
||||
asm("fcvtzs %0, %d1" : "=r" (output) : "w" (input));
|
||||
#endif
|
||||
print_int64(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
/* no handy defines for these numbers */
|
||||
uint16_t half_numbers[] = {
|
||||
0xffff, /* -NaN / AHP -Max */
|
||||
0xfcff, /* -NaN / AHP */
|
||||
0xfc01, /* -NaN / AHP */
|
||||
0xfc00, /* -Inf */
|
||||
0xfbff, /* -Max */
|
||||
0xc000, /* -2 */
|
||||
0xbc00, /* -1 */
|
||||
0x8001, /* -MIN subnormal */
|
||||
0x8000, /* -0 */
|
||||
0x0000, /* +0 */
|
||||
0x0001, /* MIN subnormal */
|
||||
0x3c00, /* 1 */
|
||||
0x7bff, /* Max */
|
||||
0x7c00, /* Inf */
|
||||
0x7c01, /* NaN / AHP */
|
||||
0x7cff, /* NaN / AHP */
|
||||
0x7fff, /* NaN / AHP +Max*/
|
||||
};
|
||||
|
||||
static void convert_half_to_double(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting half-precision to double-precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(half_numbers); ++i) {
|
||||
uint16_t input = half_numbers[i];
|
||||
double output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_half_number(i, input);
|
||||
#if defined(__arm__)
|
||||
/* asm("vcvtb.f64.f16 %P0, %1" : "=w" (output) : "t" (input)); */
|
||||
output = input;
|
||||
#else
|
||||
asm("fcvt %d0, %h1" : "=w" (output) : "w" (input));
|
||||
#endif
|
||||
print_double_number(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
static void convert_half_to_single(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting half-precision to single-precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(half_numbers); ++i) {
|
||||
uint16_t input = half_numbers[i];
|
||||
float output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_half_number(i, input);
|
||||
#if defined(__arm__)
|
||||
/*
|
||||
* Clang refuses to allocate an integer to a fp register.
|
||||
* Perform the move from a general register by hand.
|
||||
*/
|
||||
asm("vmov %0, %1\n\t"
|
||||
"vcvtb.f32.f16 %0, %0" : "=w" (output) : "r" (input));
|
||||
#else
|
||||
asm("fcvt %s0, %h1" : "=w" (output) : "w" (input));
|
||||
#endif
|
||||
print_single_number(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
static void convert_half_to_integer(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Converting half-precision to integer\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(half_numbers); ++i) {
|
||||
uint16_t input = half_numbers[i];
|
||||
int64_t output;
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
|
||||
print_half_number(i, input);
|
||||
#if defined(__arm__)
|
||||
/* asm("vcvt.s32.f16 %0, %1" : "=t" (output) : "t" (input)); v8.2*/
|
||||
output = input;
|
||||
#else
|
||||
asm("fcvt %s0, %h1" : "=w" (output) : "w" (input));
|
||||
#endif
|
||||
print_int64(i, output);
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
int flag;
|
||||
char *desc;
|
||||
} float_mapping;
|
||||
|
||||
float_mapping round_flags[] = {
|
||||
{ FE_TONEAREST, "to nearest" },
|
||||
{ FE_UPWARD, "upwards" },
|
||||
{ FE_DOWNWARD, "downwards" },
|
||||
{ FE_TOWARDZERO, "to zero" }
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[argc])
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("#### Enabling IEEE Half Precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(round_flags); ++i) {
|
||||
fesetround(round_flags[i].flag);
|
||||
printf("### Rounding %s\n", round_flags[i].desc);
|
||||
convert_single_to_half();
|
||||
convert_single_to_double();
|
||||
convert_double_to_half();
|
||||
convert_double_to_single();
|
||||
convert_half_to_single();
|
||||
convert_half_to_double();
|
||||
}
|
||||
|
||||
/* convert to integer */
|
||||
convert_single_to_integer();
|
||||
convert_double_to_integer();
|
||||
convert_half_to_integer();
|
||||
|
||||
|
||||
/* And now with ARM alternative FP16 */
|
||||
#if defined(__arm__)
|
||||
asm("vmrs r1, fpscr\n\t"
|
||||
"orr r1, r1, %[flags]\n\t"
|
||||
"vmsr fpscr, r1"
|
||||
: /* no output */ : [flags] "n" (1 << 26) : "r1" );
|
||||
#else
|
||||
asm("mrs x1, fpcr\n\t"
|
||||
"orr x1, x1, %[flags]\n\t"
|
||||
"msr fpcr, x1\n\t"
|
||||
: /* no output */ : [flags] "n" (1 << 26) : "x1" );
|
||||
#endif
|
||||
|
||||
printf("#### Enabling ARM Alternative Half Precision\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(round_flags); ++i) {
|
||||
fesetround(round_flags[i].flag);
|
||||
printf("### Rounding %s\n", round_flags[i].desc);
|
||||
convert_single_to_half();
|
||||
convert_single_to_double();
|
||||
convert_double_to_half();
|
||||
convert_double_to_single();
|
||||
convert_half_to_single();
|
||||
convert_half_to_double();
|
||||
}
|
||||
|
||||
/* convert to integer */
|
||||
convert_single_to_integer();
|
||||
convert_double_to_integer();
|
||||
convert_half_to_integer();
|
||||
|
||||
return 0;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,988 @@
|
||||
### Rounding to nearest
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-inf:0xff800000) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000000000000000000p-25:0x33000000) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe600000000000000p-25:0x337ffff3) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801a00000000000000p-15:0x387fc00d) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000c00000000000000p-14:0x38800006) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0a800000000000000p+1:0x402df854) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb600000000000000p+1:0x40490fdb) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.00000000000000000000p+31:0x4f000000) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (INEXACT )
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (INEXACT )
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(inf:0x7f800000) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding upwards
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000200000000000000p-25:0x33000001) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe800000000000000p-25:0x337ffff4) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801c00000000000000p-15:0x387fc00e) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000e00000000000000p-14:0x38800007) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-149:0x00000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x1.00000000000000000000p-149:0x00000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x1.00000000000000000000p-149:0x00000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0aa00000000000000p+1:0x402df855) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb600000000000000p+1:0x40490fdb) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.00000000000000000000p+31:0x4f000000) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (INEXACT )
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (INEXACT )
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(inf:0x7f800000) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding downwards
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-inf:0xff800000) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-149:0x80000001) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000000000000000000p-25:0x33000000) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe600000000000000p-25:0x337ffff3) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801a00000000000000p-15:0x387fc00d) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000c00000000000000p-14:0x38800006) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0a800000000000000p+1:0x402df854) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb400000000000000p+1:0x40490fda) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.fffffe00000000000000p+30:0x4effffff) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (INEXACT )
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (INEXACT )
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding to zero
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-nan:0x00fff8000000000000)
|
||||
to single: f32(-nan:0xffc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-inf:0x00fff0000000000000)
|
||||
to single: f32(-inf:0xff800000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OVERFLOW INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000)
|
||||
to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654)
|
||||
to single: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9)
|
||||
to single: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) (INEXACT )
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK)
|
||||
to int32: -2 (OK)
|
||||
to int64: -2 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK)
|
||||
to int32: -1 (OK)
|
||||
to int64: -1 (INEXACT )
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INEXACT INVALID)
|
||||
from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000)
|
||||
to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000)
|
||||
to single: f32(-0x1.00000000000000000000p-126:0x80800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.00000000000000000000p+0:00000000000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from double: f64(0x1.00000000000000000000p-126:0x003810000000000000)
|
||||
to single: f32(0x1.00000000000000000000p-126:0x00800000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000001c5f680000000p-25:0x003e600000001c5f68)
|
||||
to single: f32(0x1.00000000000000000000p-25:0x33000000) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ffffe6cb2fa820000000p-25:0x003e6ffffe6cb2fa82)
|
||||
to single: f32(0x1.ffffe600000000000000p-25:0x337ffff3) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.ff801a9af58a10000000p-15:0x003f0ff801a9af58a1)
|
||||
to single: f32(0x1.ff801a00000000000000p-15:0x387fc00d) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000c06a1ef50000000p-14:0x003f100000c06a1ef5)
|
||||
to single: f32(0x1.00000c00000000000000p-14:0x38800006) (INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000)
|
||||
to single: f32(0x1.00400000000000000000p+0:0x3f802000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p-1022:0x000010000000000000)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from double: f64(0x0.9ea82a22876800000000p-1022:0x000009ea82a2287680)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x0.ab98fba8432100000000p-1022:0x00000ab98fba843210)
|
||||
to single: f32(0x0.00000000000000000000p+0:0000000000) (UNDERFLOW INEXACT )
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (UNDERFLOW INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (UNDERFLOW INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+0:0x3f800000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from double: f64(0x1.00000000000000000000p+1:0x004000000000000000)
|
||||
to single: f32(0x1.00000000000000000000p+1:0x40000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.5bf0a8b1457690000000p+1:0x004005bf0a8b145769)
|
||||
to single: f32(0x1.5bf0a800000000000000p+1:0x402df854) (INEXACT )
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from double: f64(0x1.921fb54442d180000000p+1:0x00400921fb54442d18)
|
||||
to single: f32(0x1.921fb400000000000000p+1:0x40490fda) (INEXACT )
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000)
|
||||
to single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+15:0x477fe000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000)
|
||||
to single: f32(0x1.ffc20000000000000000p+15:0x477fe100) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000)
|
||||
to single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000)
|
||||
to single: f32(0x1.ffc00000000000000000p+16:0x47ffe000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000)
|
||||
to single: f32(0x1.ffc10000000000000000p+16:0x47ffe080) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from double: f64(0x1.fffffffc000000000000p+30:0x0041dfffffffc00000)
|
||||
to single: f32(0x1.fffffe00000000000000p+30:0x4effffff) (INEXACT )
|
||||
to int32: 2147483647 (OK)
|
||||
to int64: 2147483647 (INEXACT )
|
||||
to uint32: 2147483647 (OK)
|
||||
to uint64: 2147483647 (INEXACT )
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff)
|
||||
to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OVERFLOW INEXACT )
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from double: f64(inf:0x007ff0000000000000)
|
||||
to single: f32(inf:0x7f800000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from double: f64(nan:0x007ff8000000000000)
|
||||
to single: f32(nan:0x7fc00000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff0000000000001)
|
||||
to single: f32(nan:0x7fc00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from double: f64(nan:0x007ff4000000000000)
|
||||
to single: f32(nan:0x7fe00000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
@@ -0,0 +1,748 @@
|
||||
### Rounding to nearest
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding upwards
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding downwards
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
### Rounding to zero
|
||||
from single: f32(-nan:0xffa00000)
|
||||
to double: f64(-nan:0x00fffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-nan:0xffc00000)
|
||||
to double: f64(-nan:0x00fff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-inf:0xff800000)
|
||||
to double: f64(-inf:0x00fff0000000000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK)
|
||||
to int32: -2147483648 (INVALID)
|
||||
to int64: 1 (INEXACT INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
to double: f64(-0x1.50544400000000000000p-66:0x00bbd5054440000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
to double: f64(-0x1.00000000000000000000p-126:0x00b810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x0.00000000000000000000p+0:0000000000)
|
||||
to double: f64(0x0.00000000000000000000p+0:00000000000000000000) (OK)
|
||||
to int32: 0 (OK)
|
||||
to int64: 0 (OK)
|
||||
to uint32: 0 (OK)
|
||||
to uint64: 0 (OK)
|
||||
from single: f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
to double: f64(0x1.00000000000000000000p-126:0x003810000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
to double: f64(0x1.00000000000000000000p-25:0x003e60000000000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
to double: f64(0x1.ffffe600000000000000p-25:0x003e6ffffe60000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
to double: f64(0x1.ff801a00000000000000p-15:0x003f0ff801a0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
to double: f64(0x1.00000c00000000000000p-14:0x003f100000c0000000) (OK)
|
||||
to int32: 0 (INEXACT )
|
||||
to int64: 0 (INEXACT )
|
||||
to uint32: 0 (INEXACT )
|
||||
to uint64: 0 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
to double: f64(0x1.00000000000000000000p+0:0x003ff0000000000000) (OK)
|
||||
to int32: 1 (OK)
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (OK)
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
to double: f64(0x1.00400000000000000000p+0:0x003ff0040000000000) (OK)
|
||||
to int32: 1 (INEXACT )
|
||||
to int64: 1 (INEXACT )
|
||||
to uint32: 1 (INEXACT )
|
||||
to uint64: 1 (INEXACT )
|
||||
from single: f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
to double: f64(0x1.00000000000000000000p+1:0x004000000000000000) (OK)
|
||||
to int32: 2 (OK)
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (OK)
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
to double: f64(0x1.5bf0a800000000000000p+1:0x004005bf0a80000000) (OK)
|
||||
to int32: 2 (INEXACT )
|
||||
to int64: 2 (INEXACT )
|
||||
to uint32: 2 (INEXACT )
|
||||
to uint64: 2 (INEXACT )
|
||||
from single: f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
to double: f64(0x1.921fb600000000000000p+1:0x00400921fb60000000) (OK)
|
||||
to int32: 3 (INEXACT )
|
||||
to int64: 3 (INEXACT )
|
||||
to uint32: 3 (INEXACT )
|
||||
to uint64: 3 (INEXACT )
|
||||
from single: f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
to double: f64(0x1.ffbe0000000000000000p+15:0x0040effbe000000000) (OK)
|
||||
to int32: 65503 (OK)
|
||||
to int64: 65503 (INEXACT )
|
||||
to uint32: 65503 (OK)
|
||||
to uint64: 65503 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+15:0x0040effc0000000000) (OK)
|
||||
to int32: 65504 (OK)
|
||||
to int64: 65504 (INEXACT )
|
||||
to uint32: 65504 (OK)
|
||||
to uint64: 65504 (INEXACT )
|
||||
from single: f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
to double: f64(0x1.ffc20000000000000000p+15:0x0040effc2000000000) (OK)
|
||||
to int32: 65505 (OK)
|
||||
to int64: 65505 (INEXACT )
|
||||
to uint32: 65505 (OK)
|
||||
to uint64: 65505 (INEXACT )
|
||||
from single: f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
to double: f64(0x1.ffbf0000000000000000p+16:0x0040fffbf000000000) (OK)
|
||||
to int32: 131007 (OK)
|
||||
to int64: 131007 (INEXACT )
|
||||
to uint32: 131007 (OK)
|
||||
to uint64: 131007 (INEXACT )
|
||||
from single: f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
to double: f64(0x1.ffc00000000000000000p+16:0x0040fffc0000000000) (OK)
|
||||
to int32: 131008 (OK)
|
||||
to int64: 131008 (INEXACT )
|
||||
to uint32: 131008 (OK)
|
||||
to uint64: 131008 (INEXACT )
|
||||
from single: f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
to double: f64(0x1.ffc10000000000000000p+16:0x0040fffc1000000000) (OK)
|
||||
to int32: 131009 (OK)
|
||||
to int64: 131009 (INEXACT )
|
||||
to uint32: 131009 (OK)
|
||||
to uint64: 131009 (INEXACT )
|
||||
from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
to double: f64(0x1.c0bab600000000000000p+99:0x00462c0bab60000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INEXACT INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INEXACT INVALID)
|
||||
from single: f32(inf:0x7f800000)
|
||||
to double: f64(inf:0x007ff0000000000000) (OK)
|
||||
to int32: 2147483647 (INVALID)
|
||||
to int64: -1 (INVALID)
|
||||
to uint32: -1 (INVALID)
|
||||
to uint64: -1 (INVALID)
|
||||
from single: f32(nan:0x7fc00000)
|
||||
to double: f64(nan:0x007ff8000000000000) (OK)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
from single: f32(nan:0x7fa00000)
|
||||
to double: f64(nan:0x007ffc000000000000) (INVALID)
|
||||
to int32: 0 (INVALID)
|
||||
to int64: 0 (INVALID)
|
||||
to uint32: 0 (INVALID)
|
||||
to uint64: 0 (INVALID)
|
||||
@@ -0,0 +1,768 @@
|
||||
### Rounding to nearest
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27fa00000000000000p+60:0x5d8613fd) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46200000000000000p+34:0x50936231) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f94000000000000000p-106:0x0ac8fca0) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f75000000000000000p-40:0xab98fba8) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x0.00000000000000000000p+0:0x80000000) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe600000000000000p-25:0x337ffff3) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe600000000000000p-50:0x26fffff3) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.0007fe00000000000000p-25:0x330003ff) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f200000000000000p-24:0x338000f9) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000c00000000000000p-14:0x38800006) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf400000000000000p-24:0x3387fdfa) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801c00000000000000p-15:0x387fc00e) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000000000000000000p+0:0x3f800000) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040200000000000000p+0:0x3f800201) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d200000000000000p+2:0x409711e9) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804200000000000000p+3:0x41094021) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458000000000000000p+3:0x4128a2c0) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0400000000000000p+3:0x41100602) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1400000000000000p+15:0x477fe78a) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3c00000000000000p+17:0x4848f69e) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56000000000000000p+17:0x482de2b0) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edf000000000000000p+18:0x488476f8) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0800000000000000p+31:0x4f7fbf04) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7a00000000000000p+18:0x4884773d) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+31:0x4f7fc004) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840800000000000000p+31:0x4f7fc204) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+31:0x4f7fc104) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860800000000000000p+31:0x4f7fc304) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+32:0x4fffc104) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+32:0x4fffc004) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830800000000000000p+32:0x4fffc184) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8800000000000000p+33:0x507fbfc4) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840800000000000000p+32:0x4fffc204) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800800000000000000p+33:0x507fc004) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820800000000000000p+33:0x507fc104) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810800000000000000p+33:0x507fc084) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab600000000000000p+99:0x71605d5b) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0838000000000000000p+116:0x79e041c0) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c0829e00000000000000p+116:0x79e0414f) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (32/0)
|
||||
### Rounding upwards
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27fa00000000000000p+60:0x5d8613fd) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46200000000000000p+34:0x50936231) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f94000000000000000p-106:0x0ac8fca0) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f74e00000000000000p-40:0xab98fba7) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544200000000000000p-66:0x9ea82a21) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x0.00000000000000000000p+0:0x80000000) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe800000000000000p-25:0x337ffff4) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe800000000000000p-50:0x26fffff4) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000200000000000000p-25:0x33000001) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801c00000000000000p-15:0x387fc00e) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00080000000000000000p-25:0x33000400) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f400000000000000p-24:0x338000fa) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000e00000000000000p-14:0x38800007) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf600000000000000p-24:0x3387fdfb) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801c00000000000000p-15:0x387fc00e) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000200000000000000p+0:0x3f800001) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01a00000000000000p-14:0x38ffe00d) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01a00000000000000p-14:0x38ffe00d) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440200000000000000p+0:0x3f802201) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440200000000000000p+0:0x3f802201) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040200000000000000p+0:0x3f800201) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d400000000000000p+2:0x409711ea) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804200000000000000p+3:0x41094021) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458200000000000000p+3:0x4128a2c1) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0600000000000000p+3:0x41100603) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1600000000000000p+15:0x477fe78b) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3c00000000000000p+17:0x4848f69e) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56200000000000000p+17:0x482de2b1) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edf000000000000000p+18:0x488476f8) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0a00000000000000p+31:0x4f7fbf05) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7a00000000000000p+18:0x4884773d) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800a00000000000000p+31:0x4f7fc005) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840800000000000000p+31:0x4f7fc204) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+31:0x4f7fc104) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860800000000000000p+31:0x4f7fc304) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820800000000000000p+32:0x4fffc104) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800a00000000000000p+32:0x4fffc005) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830800000000000000p+32:0x4fffc184) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8a00000000000000p+33:0x507fbfc5) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840800000000000000p+32:0x4fffc204) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800a00000000000000p+33:0x507fc005) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820800000000000000p+33:0x507fc104) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810800000000000000p+33:0x507fc084) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab800000000000000p+99:0x71605d5c) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0838000000000000000p+116:0x79e041c0) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c082a000000000000000p+116:0x79e04150) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-148:0x00000002) flags=UNDERFLOW INEXACT (32/0)
|
||||
### Rounding downwards
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27f800000000000000p+60:0x5d8613fc) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46000000000000000p+34:0x50936230) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f93e00000000000000p-106:0x0ac8fc9f) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f75000000000000000p-40:0xab98fba8) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x1.00000000000000000000p-149:0x80000001) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe600000000000000p-25:0x337ffff3) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe600000000000000p-50:0x26fffff3) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.0007fe00000000000000p-25:0x330003ff) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f200000000000000p-24:0x338000f9) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000c00000000000000p-14:0x38800006) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf400000000000000p-24:0x3387fdfa) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000000000000000000p+0:0x3f800000) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040000000000000000p+0:0x3f800200) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d200000000000000p+2:0x409711e9) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804000000000000000p+3:0x41094020) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458000000000000000p+3:0x4128a2c0) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0400000000000000p+3:0x41100602) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1400000000000000p+15:0x477fe78a) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3a00000000000000p+17:0x4848f69d) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56000000000000000p+17:0x482de2b0) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edee00000000000000p+18:0x488476f7) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0800000000000000p+31:0x4f7fbf04) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7800000000000000p+18:0x4884773c) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+31:0x4f7fc004) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840600000000000000p+31:0x4f7fc203) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+31:0x4f7fc103) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860600000000000000p+31:0x4f7fc303) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+32:0x4fffc103) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+32:0x4fffc004) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830600000000000000p+32:0x4fffc183) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8800000000000000p+33:0x507fbfc4) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840600000000000000p+32:0x4fffc203) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800800000000000000p+33:0x507fc004) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820600000000000000p+33:0x507fc103) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810600000000000000p+33:0x507fc083) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab600000000000000p+99:0x71605d5b) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0837e00000000000000p+116:0x79e041bf) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c0829e00000000000000p+116:0x79e0414f) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (32/0)
|
||||
### Rounding to zero
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/0)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/1)
|
||||
op : f32(-inf:0xff800000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (0/2)
|
||||
op : f32(-nan:0xffc00000) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/0)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-nan:0xffc00000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/1)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-nan:0xffc00000) + f32(-inf:0xff800000)
|
||||
res: f32(-nan:0xffc00000) flags=OK (1/2)
|
||||
op : f32(-inf:0xff800000) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/0)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-inf:0xff800000)
|
||||
res: f32(-inf:0xff800000) flags=OK (2/1)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-inf:0xff800000) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (2/2)
|
||||
op : f32(-0x1.fffffe00000000000000p+127:0xff7fffff) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/0)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/1)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.fffffe00000000000000p+127:0xff7fffff) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (3/2)
|
||||
op : f32(-0x1.1874b200000000000000p+103:0xf30c3a59) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (4/0)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
|
||||
res: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) flags=INEXACT (4/1)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.1874b200000000000000p+103:0xf30c3a59) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (4/2)
|
||||
op : f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(0x1.0c27f800000000000000p+60:0x5d8613fc) flags=INEXACT (5/0)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
|
||||
res: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) flags=INEXACT (5/1)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(0x1.26c46000000000000000p+34:0x50936230) flags=INEXACT (5/2)
|
||||
op : f32(-0x1.31f75000000000000000p-40:0xab98fba8) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(0x1.91f93e00000000000000p-106:0x0ac8fc9f) flags=INEXACT (6/0)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(-0x1.31f75000000000000000p-40:0xab98fba8)
|
||||
res: f32(-0x1.31f74e00000000000000p-40:0xab98fba7) flags=INEXACT (6/1)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(-0x1.31f75000000000000000p-40:0xab98fba8) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544200000000000000p-66:0x9ea82a21) flags=INEXACT (6/2)
|
||||
op : f32(-0x1.50544400000000000000p-66:0x9ea82a22) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (7/0)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(-0x1.50544400000000000000p-66:0x9ea82a22)
|
||||
res: f32(-0x1.50544400000000000000p-66:0x9ea82a22) flags=OK (7/1)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(-0x1.50544400000000000000p-66:0x9ea82a22) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (7/2)
|
||||
op : f32(-0x1.00000000000000000000p-126:0x80800000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (8/0)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(-0x1.00000000000000000000p-126:0x80800000)
|
||||
res: f32(-0x1.00000000000000000000p-126:0x80800000) flags=OK (8/1)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(-0x1.00000000000000000000p-126:0x80800000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(-0x0.00000000000000000000p+0:0x80000000) flags=UNDERFLOW INEXACT (8/2)
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=OK (9/0)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=UNDERFLOW INEXACT (9/1)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x0.00000000000000000000p+0:0000000000) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.00000000000000000000p-126:0x00800000) flags=OK (9/2)
|
||||
op : f32(0x1.00000000000000000000p-126:0x00800000) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.ffffe600000000000000p-25:0x337ffff3) flags=INEXACT (10/0)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.00000000000000000000p-126:0x00800000)
|
||||
res: f32(0x1.ffffe600000000000000p-50:0x26fffff3) flags=INEXACT (10/1)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.00000000000000000000p-126:0x00800000) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.00000000000000000000p-25:0x33000000) flags=INEXACT (10/2)
|
||||
op : f32(0x1.00000000000000000000p-25:0x33000000) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (11/0)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000000000000000000p-25:0x33000000)
|
||||
res: f32(0x1.0007fe00000000000000p-25:0x330003ff) flags=INEXACT (11/1)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000000000000000000p-25:0x33000000) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0001f200000000000000p-24:0x338000f9) flags=INEXACT (11/2)
|
||||
op : f32(0x1.ffffe600000000000000p-25:0x337ffff3) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00000c00000000000000p-14:0x38800006) flags=INEXACT (12/0)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.ffffe600000000000000p-25:0x337ffff3)
|
||||
res: f32(0x1.0ffbf400000000000000p-24:0x3387fdfa) flags=INEXACT (12/1)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.ffffe600000000000000p-25:0x337ffff3) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ff801a00000000000000p-15:0x387fc00d) flags=INEXACT (12/2)
|
||||
op : f32(0x1.ff801a00000000000000p-15:0x387fc00d) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00000000000000000000p+0:0x3f800000) flags=INEXACT (13/0)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.ff801a00000000000000p-15:0x387fc00d)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/1)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.ff801a00000000000000p-15:0x387fc00d) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.ffc01800000000000000p-14:0x38ffe00c) flags=INEXACT (13/2)
|
||||
op : f32(0x1.00000c00000000000000p-14:0x38800006) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/0)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000c00000000000000p-14:0x38800006)
|
||||
res: f32(0x1.00440000000000000000p+0:0x3f802200) flags=INEXACT (14/1)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000c00000000000000p-14:0x38800006) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.00040000000000000000p+0:0x3f800200) flags=INEXACT (14/2)
|
||||
op : f32(0x1.00000000000000000000p+0:0x3f800000) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/0)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.00000000000000000000p+0:0x3f800000)
|
||||
res: f32(0x1.80400000000000000000p+1:0x40402000) flags=OK (15/1)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.00000000000000000000p+0:0x3f800000) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.80200000000000000000p+1:0x40401000) flags=OK (15/2)
|
||||
op : f32(0x1.00400000000000000000p+0:0x3f802000) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.2e185400000000000000p+2:0x40970c2a) flags=OK (16/0)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.00400000000000000000p+0:0x3f802000)
|
||||
res: f32(0x1.9c00a800000000000000p+2:0x40ce0054) flags=OK (16/1)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.00400000000000000000p+0:0x3f802000) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.2e23d200000000000000p+2:0x409711e9) flags=INEXACT (16/2)
|
||||
op : f32(0x1.00000000000000000000p+1:0x40000000) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.12804000000000000000p+3:0x41094020) flags=INEXACT (17/0)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.00000000000000000000p+1:0x40000000)
|
||||
res: f32(0x1.51458000000000000000p+3:0x4128a2c0) flags=INEXACT (17/1)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.00000000000000000000p+1:0x40000000) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.200c0400000000000000p+3:0x41100602) flags=INEXACT (17/2)
|
||||
op : f32(0x1.5bf0a800000000000000p+1:0x402df854) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ffcf1400000000000000p+15:0x477fe78a) flags=INEXACT (18/0)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.5bf0a800000000000000p+1:0x402df854)
|
||||
res: f32(0x1.91ed3a00000000000000p+17:0x4848f69d) flags=INEXACT (18/1)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.5bf0a800000000000000p+1:0x402df854) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.5bc56000000000000000p+17:0x482de2b0) flags=INEXACT (18/2)
|
||||
op : f32(0x1.921fb600000000000000p+1:0x40490fdb) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.08edee00000000000000p+18:0x488476f7) flags=INEXACT (19/0)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.921fb600000000000000p+1:0x40490fdb)
|
||||
res: f32(0x1.ff7e0800000000000000p+31:0x4f7fbf04) flags=INEXACT (19/1)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.921fb600000000000000p+1:0x40490fdb) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.08ee7800000000000000p+18:0x4884773c) flags=INEXACT (19/2)
|
||||
op : f32(0x1.ffbe0000000000000000p+15:0x477fdf00) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+31:0x4f7fc004) flags=INEXACT (20/0)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbe0000000000000000p+15:0x477fdf00)
|
||||
res: f32(0x1.ff840600000000000000p+31:0x4f7fc203) flags=INEXACT (20/1)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbe0000000000000000p+15:0x477fdf00) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+31:0x4f7fc103) flags=INEXACT (20/2)
|
||||
op : f32(0x1.ffc00000000000000000p+15:0x477fe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff860600000000000000p+31:0x4f7fc303) flags=INEXACT (21/0)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+15:0x477fe000)
|
||||
res: f32(0x1.ff820600000000000000p+32:0x4fffc103) flags=INEXACT (21/1)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+15:0x477fe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff800800000000000000p+32:0x4fffc004) flags=INEXACT (21/2)
|
||||
op : f32(0x1.ffc20000000000000000p+15:0x477fe100) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff830600000000000000p+32:0x4fffc183) flags=INEXACT (22/0)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc20000000000000000p+15:0x477fe100)
|
||||
res: f32(0x1.ff7f8800000000000000p+33:0x507fbfc4) flags=INEXACT (22/1)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc20000000000000000p+15:0x477fe100) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff840600000000000000p+32:0x4fffc203) flags=INEXACT (22/2)
|
||||
op : f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.ff800800000000000000p+33:0x507fc004) flags=INEXACT (23/0)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.ffbf0000000000000000p+16:0x47ffdf80)
|
||||
res: f32(0x1.ff820600000000000000p+33:0x507fc103) flags=INEXACT (23/1)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.ffbf0000000000000000p+16:0x47ffdf80) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.ff810600000000000000p+33:0x507fc083) flags=INEXACT (23/2)
|
||||
op : f32(0x1.ffc00000000000000000p+16:0x47ffe000) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.c0bab600000000000000p+99:0x71605d5b) flags=INEXACT (24/0)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.ffc00000000000000000p+16:0x47ffe000)
|
||||
res: f32(0x1.c0837e00000000000000p+116:0x79e041bf) flags=INEXACT (24/1)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.ffc00000000000000000p+16:0x47ffe000) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.c0829e00000000000000p+116:0x79e0414f) flags=INEXACT (24/2)
|
||||
op : f32(0x1.ffc10000000000000000p+16:0x47ffe080) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/0)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(0x1.ffc10000000000000000p+16:0x47ffe080)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/1)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(0x1.ffc10000000000000000p+16:0x47ffe080) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) flags=OVERFLOW INEXACT (25/2)
|
||||
op : f32(0x1.c0bab600000000000000p+99:0x71605d5b) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/0)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(0x1.c0bab600000000000000p+99:0x71605d5b)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/1)
|
||||
op : f32(inf:0x7f800000) * f32(0x1.c0bab600000000000000p+99:0x71605d5b) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(inf:0x7f800000) flags=OK (26/2)
|
||||
op : f32(0x1.fffffe00000000000000p+127:0x7f7fffff) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/0)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(0x1.fffffe00000000000000p+127:0x7f7fffff)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/1)
|
||||
op : f32(nan:0x7fc00000) * f32(0x1.fffffe00000000000000p+127:0x7f7fffff) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fc00000) flags=OK (27/2)
|
||||
op : f32(inf:0x7f800000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/0)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(inf:0x7f800000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/1)
|
||||
op : f32(nan:0x7fa00000) * f32(inf:0x7f800000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (28/2)
|
||||
op : f32(nan:0x7fc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (29/0)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(nan:0x7fc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/1)
|
||||
op : f32(-nan:0xffa00000) * f32(nan:0x7fc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (29/2)
|
||||
op : f32(nan:0x7fa00000) * f32(-nan:0xffa00000) + f32(-nan:0xffc00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/0)
|
||||
op : f32(-nan:0xffa00000) * f32(-nan:0xffc00000) + f32(nan:0x7fa00000)
|
||||
res: f32(nan:0x7fe00000) flags=INVALID (30/1)
|
||||
op : f32(-nan:0xffc00000) * f32(nan:0x7fa00000) + f32(-nan:0xffa00000)
|
||||
res: f32(-nan:0xffe00000) flags=INVALID (30/2)
|
||||
# LP184149
|
||||
op : f32(0x0.00000000000000000000p+0:0000000000) * f32(0x1.00000000000000000000p-1:0x3f000000) + f32(0x0.00000000000000000000p+0:0000000000)
|
||||
res: f32(0x0.00000000000000000000p+0:0000000000) flags=OK (31/0)
|
||||
op : f32(0x1.00000000000000000000p-149:0x00000001) * f32(0x1.00000000000000000000p-149:0x00000001) + f32(0x1.00000000000000000000p-149:0x00000001)
|
||||
res: f32(0x1.00000000000000000000p-149:0x00000001) flags=UNDERFLOW INEXACT (32/0)
|
||||
@@ -0,0 +1,113 @@
|
||||
#define __NR_SYSCALL_BASE 0x900000
|
||||
#define __NR_exit1 (__NR_SYSCALL_BASE+ 1)
|
||||
#define __NR_write (__NR_SYSCALL_BASE+ 4)
|
||||
|
||||
#define __sys2(x) #x
|
||||
#define __sys1(x) __sys2(x)
|
||||
|
||||
#ifndef __syscall
|
||||
#define __syscall(name) "swi\t" __sys1(__NR_##name) "\n\t"
|
||||
#endif
|
||||
|
||||
#define __syscall_return(type, res) \
|
||||
do { \
|
||||
return (type) (res); \
|
||||
} while (0)
|
||||
|
||||
#define _syscall0(type,name) \
|
||||
type name(void) { \
|
||||
long __res; \
|
||||
__asm__ __volatile__ ( \
|
||||
__syscall(name) \
|
||||
"mov %0,r0" \
|
||||
:"=r" (__res) : : "r0","lr"); \
|
||||
__syscall_return(type,__res); \
|
||||
}
|
||||
|
||||
#define _syscall1(type,name,type1,arg1) \
|
||||
type name(type1 arg1) { \
|
||||
long __res; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mov\tr0,%1\n\t" \
|
||||
__syscall(name) \
|
||||
"mov %0,r0" \
|
||||
: "=r" (__res) \
|
||||
: "r" ((long)(arg1)) \
|
||||
: "r0","lr"); \
|
||||
__syscall_return(type,__res); \
|
||||
}
|
||||
|
||||
#define _syscall2(type,name,type1,arg1,type2,arg2) \
|
||||
type name(type1 arg1,type2 arg2) { \
|
||||
long __res; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mov\tr0,%1\n\t" \
|
||||
"mov\tr1,%2\n\t" \
|
||||
__syscall(name) \
|
||||
"mov\t%0,r0" \
|
||||
: "=r" (__res) \
|
||||
: "r" ((long)(arg1)),"r" ((long)(arg2)) \
|
||||
: "r0","r1","lr"); \
|
||||
__syscall_return(type,__res); \
|
||||
}
|
||||
|
||||
|
||||
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
|
||||
type name(type1 arg1,type2 arg2,type3 arg3) { \
|
||||
long __res; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mov\tr0,%1\n\t" \
|
||||
"mov\tr1,%2\n\t" \
|
||||
"mov\tr2,%3\n\t" \
|
||||
__syscall(name) \
|
||||
"mov\t%0,r0" \
|
||||
: "=r" (__res) \
|
||||
: "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)) \
|
||||
: "r0","r1","r2","lr"); \
|
||||
__syscall_return(type,__res); \
|
||||
}
|
||||
|
||||
|
||||
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
||||
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
|
||||
long __res; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mov\tr0,%1\n\t" \
|
||||
"mov\tr1,%2\n\t" \
|
||||
"mov\tr2,%3\n\t" \
|
||||
"mov\tr3,%4\n\t" \
|
||||
__syscall(name) \
|
||||
"mov\t%0,r0" \
|
||||
: "=r" (__res) \
|
||||
: "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)) \
|
||||
: "r0","r1","r2","r3","lr"); \
|
||||
__syscall_return(type,__res); \
|
||||
}
|
||||
|
||||
|
||||
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
|
||||
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
|
||||
long __res; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mov\tr0,%1\n\t" \
|
||||
"mov\tr1,%2\n\t" \
|
||||
"mov\tr2,%3\n\t" \
|
||||
"mov\tr3,%4\n\t" \
|
||||
"mov\tr4,%5\n\t" \
|
||||
__syscall(name) \
|
||||
"mov\t%0,r0" \
|
||||
: "=r" (__res) \
|
||||
: "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)), \
|
||||
"r" ((long)(arg5)) \
|
||||
: "r0","r1","r2","r3","r4","lr"); \
|
||||
__syscall_return(type,__res); \
|
||||
}
|
||||
|
||||
_syscall1(int,exit1,int,status);
|
||||
_syscall3(int,write,int,fd,const char *,buf, int, len);
|
||||
|
||||
void _start(void)
|
||||
{
|
||||
write(1, "Hello World\n", 12);
|
||||
exit1(0);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/* Test PC misalignment exception */
|
||||
|
||||
#ifdef __thumb__
|
||||
#error "This test must be compiled for ARM"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static void *expected;
|
||||
|
||||
static void sigbus(int sig, siginfo_t *info, void *vuc)
|
||||
{
|
||||
assert(info->si_code == BUS_ADRALN);
|
||||
assert(info->si_addr == expected);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
void *tmp;
|
||||
|
||||
struct sigaction sa = {
|
||||
.sa_sigaction = sigbus,
|
||||
.sa_flags = SA_SIGINFO
|
||||
};
|
||||
|
||||
if (sigaction(SIGBUS, &sa, NULL) < 0) {
|
||||
perror("sigaction");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
asm volatile("adr %0, 1f + 2\n\t"
|
||||
"str %0, %1\n\t"
|
||||
"bx %0\n"
|
||||
"1:"
|
||||
: "=&r"(tmp), "=m"(expected));
|
||||
|
||||
/*
|
||||
* From v8, it is CONSTRAINED UNPREDICTABLE whether BXWritePC aligns
|
||||
* the address or not. If so, we can legitimately fall through.
|
||||
*/
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Semihosting Tests - ARM Helper
|
||||
*
|
||||
* Copyright (c) 2019, 2024
|
||||
* Written by Alex Bennée <[email protected]>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
|
||||
{
|
||||
register uintptr_t t asm("r0") = type;
|
||||
register uintptr_t a0 asm("r1") = arg0;
|
||||
#ifdef __thumb__
|
||||
# define SVC "svc 0xab"
|
||||
#else
|
||||
# define SVC "svc 0x123456"
|
||||
#endif
|
||||
asm(SVC : "=r" (t)
|
||||
: "r" (t), "r" (a0));
|
||||
return t;
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
/*
|
||||
* Minimal ArmV7 system boot code.
|
||||
*
|
||||
* Using semihosting for serial output and exit functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Semihosting interface on ARM AArch32
|
||||
* R0 - semihosting call number
|
||||
* R1 - semihosting parameter
|
||||
*/
|
||||
#define semihosting_call svc 0x123456
|
||||
#define SYS_WRITEC 0x03 /* character to debug channel */
|
||||
#define SYS_WRITE0 0x04 /* string to debug channel */
|
||||
#define SYS_EXIT 0x18
|
||||
|
||||
#define ADP_Stopped_ApplicationExit 0x20026
|
||||
#define ADP_Stopped_InternalError 0x20024
|
||||
|
||||
/*
|
||||
* Helper macro for annotating functions with elf type and size.
|
||||
*/
|
||||
.macro endf name
|
||||
.global \name
|
||||
.type \name, %function
|
||||
.size \name, . - \name
|
||||
.endm
|
||||
|
||||
.section .interrupt_vector, "ax"
|
||||
.align 5
|
||||
|
||||
vector_table:
|
||||
b reset /* reset vector */
|
||||
b undef_instr /* undefined instruction vector */
|
||||
b software_intr /* software interrupt vector */
|
||||
b prefetch_abort /* prefetch abort vector */
|
||||
b data_abort /* data abort vector */
|
||||
nop /* reserved */
|
||||
b IRQ_handler /* IRQ vector */
|
||||
b FIQ_handler /* FIQ vector */
|
||||
|
||||
endf vector_table
|
||||
|
||||
.text
|
||||
__start:
|
||||
ldr r0, =vector_table
|
||||
mcr p15, 0, r0, c12, c0, 0 /* Set up VBAR */
|
||||
|
||||
ldr sp, =stack_end /* Set up the stack */
|
||||
bl mmu_setup /* Set up the MMU */
|
||||
bl main /* Jump to main */
|
||||
|
||||
endf __start
|
||||
|
||||
_exit:
|
||||
cmp r0, #0
|
||||
ite EQ // if-then-else. "EQ" is for if equal, else otherwise
|
||||
ldreq r1, =ADP_Stopped_ApplicationExit // if r0 == 0
|
||||
ldrne r1, =ADP_Stopped_InternalError // else
|
||||
mov r0, #SYS_EXIT
|
||||
semihosting_call
|
||||
|
||||
endf _exit
|
||||
|
||||
/*
|
||||
* Helper Functions
|
||||
*/
|
||||
|
||||
mmu_setup:
|
||||
/*
|
||||
* The MMU setup for this is very simple using two stage one
|
||||
* translations. The first 1Mb section points to the text
|
||||
* section and the second points to the data and rss.
|
||||
* Currently the fattest test only needs ~50k for that so we
|
||||
* have plenty of space.
|
||||
*
|
||||
* The short descriptor Section format is as follows:
|
||||
*
|
||||
* PA[31:20] - Section Base Address
|
||||
* NS[19] - Non-secure bit
|
||||
* 0[18] - Section (1 for Super Section)
|
||||
* nG[17] - Not global bit
|
||||
* S[16] - Shareable
|
||||
* TEX[14:12] - Memory Region Attributes
|
||||
* AP[15, 11:10] - Access Permission Bits
|
||||
* IMPDEF[9]
|
||||
* Domain[8:5]
|
||||
* XN[4] - Execute never bit
|
||||
* C[3] - Memory Region Attributes
|
||||
* B[2] - Memory Region Attributes
|
||||
* 1[1]
|
||||
* PXN[0] - Privileged Execute Never
|
||||
*
|
||||
* r0 - point at the table
|
||||
* r1 - address
|
||||
* r2 - entry
|
||||
* r3 - common section bits
|
||||
* r4 - scratch
|
||||
*/
|
||||
|
||||
/*
|
||||
* Memory Region Bits
|
||||
*
|
||||
* TEX[14:12] = 000
|
||||
* C[3] = 1
|
||||
* B[2] = 1
|
||||
*
|
||||
* Outer and Inner WB, no write allocate
|
||||
*/
|
||||
mov r3, #0
|
||||
ldr r4, =(3 << 2)
|
||||
orr r3, r4, r4
|
||||
|
||||
/* Section bit */
|
||||
orr r3, r3, #2
|
||||
|
||||
/* Page table setup (identity mapping). */
|
||||
ldr r0, =ttb
|
||||
|
||||
/* First block: .text/RO/execute enabled */
|
||||
ldr r1, =.text
|
||||
ldr r2, =0xFFF00000 /* 1MB block alignment */
|
||||
and r2, r1, r2
|
||||
orr r2, r2, r3 /* common bits */
|
||||
orr r2, r2, #(1 << 15) /* AP[2] = 1 */
|
||||
orr r2, r2, #(1 << 10) /* AP[0] = 1 => RO @ PL1 */
|
||||
|
||||
lsr r4, r2, #(20 - 2)
|
||||
str r2, [r0, r4, lsl #0] /* write entry */
|
||||
|
||||
/* Second block: .data/RW/no execute */
|
||||
ldr r1, =.data
|
||||
ldr r2, =0xFFF00000 /* 1MB block alignment */
|
||||
and r2, r1, r2
|
||||
orr r2, r2, r3 /* common bits */
|
||||
orr r2, r2, #(1 << 10) /* AP[0] = 1 => RW @ PL1 */
|
||||
orr r2, r2, #(1 << 4) /* XN[4] => no execute */
|
||||
|
||||
lsr r4, r2, #(20 - 2)
|
||||
str r2, [r0, r4, lsl #0] /* write entry */
|
||||
|
||||
/*
|
||||
* DACR - Domain Control
|
||||
*
|
||||
* Enable client mode for domain 0 (we don't use any others)
|
||||
*/
|
||||
ldr r0, =0x1
|
||||
mcr p15, 0, r0, c3, c0, 0
|
||||
|
||||
/*
|
||||
* TTCBR - Translation Table Base Control Register
|
||||
*
|
||||
* EAE[31] = 0, 32-bit translation, short descriptor format
|
||||
* N[2:0] = 5 ( TTBRO uses 31:14-5 => 9 bit lookup stage )
|
||||
*/
|
||||
ldr r0, =0x5
|
||||
mcr p15, 0, r0, c1, c0, 2
|
||||
|
||||
/*
|
||||
* TTBR0 -Translation Table Base Register 0
|
||||
*
|
||||
* [31:9] = Base address of table
|
||||
*
|
||||
* QEMU doesn't really care about the cache sharing
|
||||
* attributes so we don't need to either.
|
||||
*/
|
||||
ldr r0, =ttb
|
||||
mcr p15, 0, r0, c2, c0, 0
|
||||
|
||||
/*
|
||||
* SCTLR- System Control Register
|
||||
*
|
||||
* TE[30] = 0, exceptions to A32 state
|
||||
* AFE[29] = 0, AP[0] is the access permissions bit
|
||||
* EE[25] = 0, Little-endian
|
||||
* WXN[19] = 0 = no effect, Write does not imply XN (execute never)
|
||||
* I[12] = Instruction cachability control
|
||||
* C[2] = Data cachability control
|
||||
* M[0] = 1, enable stage 1 address translation for EL0/1
|
||||
*
|
||||
* At this point virtual memory is enabled.
|
||||
*/
|
||||
ldr r0, =0x1005
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
isb
|
||||
|
||||
mov pc, lr /* done, return to caller */
|
||||
|
||||
endf mmu_setup
|
||||
|
||||
/* Output a single character to serial port */
|
||||
__sys_outc:
|
||||
STMFD sp!, {r0-r1} // push r0, r1 onto stack
|
||||
mov r1, sp
|
||||
mov r0, #SYS_WRITEC
|
||||
semihosting_call
|
||||
LDMFD sp!, {r0-r1} // pop r0, r1 from stack
|
||||
bx lr
|
||||
|
||||
endf __sys_outc
|
||||
|
||||
reset:
|
||||
ldr r1, =reset_error
|
||||
b exception_handler
|
||||
|
||||
endf reset
|
||||
|
||||
undef_instr:
|
||||
ldr r1, =undef_intr_error
|
||||
b exception_handler
|
||||
|
||||
endf undef_instr
|
||||
|
||||
software_intr:
|
||||
ldr r1, =software_intr_error
|
||||
b exception_handler
|
||||
|
||||
endf software_intr
|
||||
|
||||
prefetch_abort:
|
||||
ldr r1, =prefetch_abort_error
|
||||
b exception_handler
|
||||
|
||||
endf prefetch_abort
|
||||
|
||||
data_abort:
|
||||
ldr r1, =data_abort_error
|
||||
b exception_handler
|
||||
|
||||
endf data_abort
|
||||
|
||||
IRQ_handler:
|
||||
ldr r1, =irq_error
|
||||
b exception_handler
|
||||
|
||||
endf IRQ_handler
|
||||
|
||||
FIQ_handler:
|
||||
ldr r1, =fiq_error
|
||||
b exception_handler
|
||||
|
||||
endf FIQ_handler
|
||||
|
||||
/*
|
||||
* Initiate a exit semihosting call whenever there is any exception
|
||||
* r1 already holds the string.
|
||||
*/
|
||||
exception_handler:
|
||||
mov r0, #SYS_WRITE0
|
||||
semihosting_call
|
||||
mov r0, #SYS_EXIT
|
||||
mov r1, #1
|
||||
semihosting_call
|
||||
|
||||
endf exception_handler
|
||||
|
||||
/*
|
||||
* We implement a stub raise() function which errors out as tests
|
||||
* shouldn't trigger maths errors.
|
||||
*/
|
||||
.global raise
|
||||
raise:
|
||||
mov r0, #SYS_WRITE0
|
||||
ldr r1, =maths_error
|
||||
semihosting_call
|
||||
mov r0, #SYS_EXIT
|
||||
ldr r1, =ADP_Stopped_InternalError
|
||||
semihosting_call
|
||||
|
||||
endf raise
|
||||
|
||||
.data
|
||||
|
||||
.data
|
||||
|
||||
reset_error:
|
||||
.ascii "Reset exception occurred.\n\0"
|
||||
|
||||
undef_intr_error:
|
||||
.ascii "Undefined Instruction Exception Occurred.\n\0"
|
||||
|
||||
software_intr_error:
|
||||
.ascii "Software Interrupt Occurred.\n\0"
|
||||
|
||||
prefetch_abort_error:
|
||||
.ascii "Prefetch Abort Occurred.\n\0"
|
||||
|
||||
data_abort_error:
|
||||
.ascii "Data Abort Occurred.\n\0"
|
||||
|
||||
irq_error:
|
||||
.ascii "IRQ exception occurred.\n\0"
|
||||
|
||||
fiq_error:
|
||||
.ascii "FIQ exception occurred.\n\0"
|
||||
|
||||
maths_error:
|
||||
.ascii "Software maths exception.\n\0"
|
||||
|
||||
|
||||
/*
|
||||
* 1st Stage Translation table
|
||||
* 4096 entries, indexed by [31:20]
|
||||
* each entry covers 1Mb of address space
|
||||
* aligned on 16kb
|
||||
*/
|
||||
.align 15
|
||||
ttb:
|
||||
.space (4096 * 4), 0
|
||||
|
||||
.align 12
|
||||
|
||||
/* Space for stack */
|
||||
.align 5
|
||||
.section .bss
|
||||
stack:
|
||||
.space 65536, 0
|
||||
stack_end:
|
||||
@@ -0,0 +1,24 @@
|
||||
ENTRY(__start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* virt machine, RAM starts at 1gb */
|
||||
. = (1 << 30);
|
||||
.text : {
|
||||
*(.text)
|
||||
}
|
||||
.rodata : {
|
||||
*(.rodata)
|
||||
}
|
||||
/* align r/w section to next 2mb */
|
||||
. = ALIGN(1 << 21);
|
||||
.data : {
|
||||
*(.data)
|
||||
}
|
||||
.bss : {
|
||||
*(.bss)
|
||||
}
|
||||
/DISCARD/ : {
|
||||
*(.ARM.attributes)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Semihosting Console Test
|
||||
*
|
||||
* Copyright (c) 2019 Linaro Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <minilib.h>
|
||||
|
||||
#define SYS_READC 0x7
|
||||
|
||||
uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
|
||||
{
|
||||
register uintptr_t t asm("r0") = type;
|
||||
register uintptr_t a0 asm("r1") = arg0;
|
||||
#ifdef __thumb__
|
||||
# define SVC "svc 0xab"
|
||||
#else
|
||||
# define SVC "svc 0x123456"
|
||||
#endif
|
||||
asm(SVC : "=r" (t)
|
||||
: "r" (t), "r" (a0));
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char c;
|
||||
|
||||
ml_printf("Semihosting Console Test\n");
|
||||
ml_printf("hit X to exit:");
|
||||
|
||||
do {
|
||||
c = __semi_call(SYS_READC, 0);
|
||||
__sys_outc(c);
|
||||
} while (c != 'X');
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Test ARMv6-M UNDEFINED 32-bit instructions
|
||||
*
|
||||
* Copyright 2018 Red Hat Inc.
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2
|
||||
* or later. See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test that UNDEFINED 32-bit instructions fault as expected. This is an
|
||||
* interesting test because ARMv6-M shares code with its more fully-featured
|
||||
* siblings and it's necessary to verify that its limited instruction set is
|
||||
* emulated correctly.
|
||||
*
|
||||
* The emulator must be invoked with -semihosting so that the test case can
|
||||
* terminate with exit code 0 on success or 1 on failure.
|
||||
*
|
||||
* Failures can be debugged with -d in_asm,int,exec,cpu and the
|
||||
* gdbstub (-S -s).
|
||||
*/
|
||||
|
||||
.syntax unified
|
||||
.cpu cortex-m0
|
||||
.thumb
|
||||
|
||||
/*
|
||||
* Memory map
|
||||
*/
|
||||
#define SRAM_BASE 0x20000000
|
||||
#define SRAM_SIZE (16 * 1024)
|
||||
|
||||
/*
|
||||
* Semihosting interface on ARM T32
|
||||
* See "Semihosting for AArch32 and AArch64 Version 2.0 Documentation" by ARM
|
||||
*/
|
||||
#define semihosting_call bkpt 0xab
|
||||
#define SYS_EXIT 0x18
|
||||
|
||||
vector_table:
|
||||
.word SRAM_BASE + SRAM_SIZE /* 0. SP_main */
|
||||
.word exc_reset_thumb /* 1. Reset */
|
||||
.word 0 /* 2. NMI */
|
||||
.word exc_hard_fault_thumb /* 3. HardFault */
|
||||
.rept 7
|
||||
.word 0 /* 4-10. Reserved */
|
||||
.endr
|
||||
.word 0 /* 11. SVCall */
|
||||
.word 0 /* 12. Reserved */
|
||||
.word 0 /* 13. Reserved */
|
||||
.word 0 /* 14. PendSV */
|
||||
.word 0 /* 15. SysTick */
|
||||
.rept 32
|
||||
.word 0 /* 16-47. External Interrupts */
|
||||
.endr
|
||||
|
||||
exc_reset:
|
||||
.equ exc_reset_thumb, exc_reset + 1
|
||||
.global exc_reset_thumb
|
||||
/* The following 32-bit UNDEFINED instructions are tested by executing
|
||||
* them. The HardFault exception handler should execute and return to
|
||||
* the next test case. If no exception is raised the test fails.
|
||||
*/
|
||||
|
||||
/* Table A5-9 32-bit Thumb encoding */
|
||||
.short 0b1110100000000000
|
||||
.short 0b0000000000000000
|
||||
b not_reached
|
||||
.short 0b1110100000000000
|
||||
.short 0b1000000000000000
|
||||
b not_reached
|
||||
.short 0b1111100000000000
|
||||
.short 0b0000000000000000
|
||||
b not_reached
|
||||
.short 0b1111100000000000
|
||||
.short 0b1000000000000000
|
||||
b not_reached
|
||||
.short 0b1111000000000000
|
||||
.short 0b0000000000000000
|
||||
b not_reached
|
||||
|
||||
/* Table A5-10 Branch and miscellaneous control instructions */
|
||||
.short 0b1111011111110000
|
||||
.short 0b1010000000000000
|
||||
b not_reached
|
||||
|
||||
/* The following are valid 32-bit instructions that must not raise a
|
||||
* HardFault.
|
||||
*/
|
||||
|
||||
/* B4.2.3 Move to Special Register (moves to IPSR are ignored) */
|
||||
msr ipsr, r0
|
||||
b 1f
|
||||
b not_reached
|
||||
1:
|
||||
/* B4.2.2 Move from Special Register */
|
||||
mrs r0, ipsr
|
||||
b 1f
|
||||
b not_reached
|
||||
1:
|
||||
/* A6.7.13 Branch with Link (immediate) */
|
||||
bl 1f
|
||||
1:
|
||||
b 1f
|
||||
b not_reached
|
||||
1:
|
||||
/* A6.7.21 Data Memory Barrier */
|
||||
dmb
|
||||
b 1f
|
||||
b not_reached
|
||||
1:
|
||||
/* A6.7.22 Data Synchronization Barrier */
|
||||
dsb
|
||||
b 1f
|
||||
b not_reached
|
||||
1:
|
||||
/* A6.7.24 Instruction Memory Barrier */
|
||||
isb
|
||||
b 1f
|
||||
b not_reached
|
||||
1:
|
||||
|
||||
/* Success! */
|
||||
movs r0, 1
|
||||
b exit
|
||||
|
||||
not_reached: /* Failure :( */
|
||||
movs r0, 0
|
||||
b exit
|
||||
|
||||
/* When a HardFault occurs, return to pc+6 (test cases are 3 halfwords long) */
|
||||
exc_hard_fault:
|
||||
.equ exc_hard_fault_thumb, exc_hard_fault + 1
|
||||
.global exc_hard_fault_thumb
|
||||
ldr r0, [sp, 0x18]
|
||||
adds r0, 6
|
||||
str r0, [sp, 0x18]
|
||||
bx lr
|
||||
|
||||
/*
|
||||
* exit: Terminate emulator
|
||||
* @r0: 0 - failure, 1 - success
|
||||
*/
|
||||
exit:
|
||||
movs r1, 0
|
||||
cmp r0, 1
|
||||
bne 1f
|
||||
ldr r1, ADP_Stopped_ApplicationExit
|
||||
1:
|
||||
movs r0, SYS_EXIT
|
||||
semihosting_call
|
||||
.align 2
|
||||
ADP_Stopped_ApplicationExit:
|
||||
.word 0x20026
|
||||
@@ -0,0 +1,21 @@
|
||||
ENTRY(exc_reset_thumb)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x0;
|
||||
.text : {
|
||||
*(.text)
|
||||
}
|
||||
.data : {
|
||||
*(.data)
|
||||
}
|
||||
.rodata : {
|
||||
*(.rodata)
|
||||
}
|
||||
.bss : {
|
||||
*(.bss)
|
||||
}
|
||||
/DISCARD/ : {
|
||||
*(.ARM.attributes)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
##
|
||||
## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
# Hexagon doesn't support gdb, so skip the EXTRA_RUNS
|
||||
EXTRA_RUNS =
|
||||
|
||||
CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal
|
||||
CFLAGS += -fno-unroll-loops -fno-stack-protector
|
||||
|
||||
HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon
|
||||
VPATH += $(HEX_SRC)
|
||||
|
||||
%: $(HEX_SRC)/%.S $(HEX_SRC)/crt.S
|
||||
$(CC) -static -mv67 -nostdlib $^ -o $@
|
||||
|
||||
HEX_TESTS = first
|
||||
HEX_TESTS += hex_sigsegv
|
||||
HEX_TESTS += misc
|
||||
HEX_TESTS += usr
|
||||
HEX_TESTS += preg_alias
|
||||
HEX_TESTS += dual_stores
|
||||
HEX_TESTS += multi_result
|
||||
HEX_TESTS += mem_noshuf
|
||||
HEX_TESTS += mem_noshuf_exception
|
||||
HEX_TESTS += circ
|
||||
HEX_TESTS += brev
|
||||
HEX_TESTS += load_unpack
|
||||
HEX_TESTS += load_align
|
||||
HEX_TESTS += atomics
|
||||
HEX_TESTS += fpstuff
|
||||
HEX_TESTS += overflow
|
||||
HEX_TESTS += signal_context
|
||||
HEX_TESTS += reg_mut
|
||||
HEX_TESTS += read_write_overlap
|
||||
HEX_TESTS += vector_add_int
|
||||
HEX_TESTS += scatter_gather
|
||||
HEX_TESTS += hvx_misc
|
||||
HEX_TESTS += hvx_histogram
|
||||
HEX_TESTS += fp_hvx
|
||||
HEX_TESTS += fp_hvx_cvt
|
||||
HEX_TESTS += fp_hvx_cmp
|
||||
HEX_TESTS += fp_hvx_disabled
|
||||
HEX_TESTS += invalid-slots
|
||||
HEX_TESTS += valid-slots
|
||||
HEX_TESTS += invalid-encoding
|
||||
HEX_TESTS += multiple-writes
|
||||
HEX_TESTS += unaligned_pc
|
||||
HEX_TESTS += unaligned_data
|
||||
|
||||
HEX_TESTS += test_abs
|
||||
HEX_TESTS += test_bitcnt
|
||||
HEX_TESTS += test_bitsplit
|
||||
HEX_TESTS += test_call
|
||||
HEX_TESTS += test_clobber
|
||||
HEX_TESTS += test_cmp
|
||||
HEX_TESTS += test_dotnew
|
||||
HEX_TESTS += test_ext
|
||||
HEX_TESTS += test_fibonacci
|
||||
HEX_TESTS += test_hl
|
||||
HEX_TESTS += test_hwloops
|
||||
HEX_TESTS += test_jmp
|
||||
HEX_TESTS += test_lsr
|
||||
HEX_TESTS += test_mpyi
|
||||
HEX_TESTS += test_packet
|
||||
HEX_TESTS += test_reorder
|
||||
HEX_TESTS += test_round
|
||||
HEX_TESTS += test_vavgw
|
||||
HEX_TESTS += test_vcmpb
|
||||
HEX_TESTS += test_vcmpw
|
||||
HEX_TESTS += test_vlsrw
|
||||
HEX_TESTS += test_vmaxh
|
||||
HEX_TESTS += test_vminh
|
||||
HEX_TESTS += test_vpmpyh
|
||||
HEX_TESTS += test_vspliceb
|
||||
|
||||
HEX_TESTS += check_rev_gating
|
||||
HEX_TESTS += test_pnew_jump_loads
|
||||
|
||||
HEX_TESTS += v68_scalar
|
||||
HEX_TESTS += v68_hvx
|
||||
HEX_TESTS += v69_hvx
|
||||
HEX_TESTS += v73_scalar
|
||||
|
||||
TESTS += $(HEX_TESTS)
|
||||
|
||||
atomics: atomics.c hex_test.h
|
||||
brev: brev.c hex_test.h
|
||||
circ: circ.c hex_test.h
|
||||
dual_stores: dual_stores.c hex_test.h
|
||||
fpstuff: fpstuff.c hex_test.h
|
||||
hex_sigsegv: hex_sigsegv.c hex_test.h
|
||||
load_align: load_align.c hex_test.h
|
||||
load_unpack: load_unpack.c hex_test.h
|
||||
mem_noshuf_exception: mem_noshuf_exception.c hex_test.h
|
||||
mem_noshuf: mem_noshuf.c hex_test.h
|
||||
misc: misc.c hex_test.h
|
||||
multi_result: multi_result.c hex_test.h
|
||||
overflow: overflow.c hex_test.h
|
||||
preg_alias: preg_alias.c hex_test.h
|
||||
read_write_overlap: read_write_overlap.c hex_test.h
|
||||
reg_mut: reg_mut.c hex_test.h
|
||||
test_pnew_jump_loads: test_pnew_jump_loads.c hex_test.h
|
||||
unaligned_data: unaligned_data.c hex_test.h
|
||||
unaligned_pc: unaligned_pc.c
|
||||
|
||||
# Compile for v66 so that the ELF selects a v66 CPU; the test then
|
||||
# exercises revision gating by executing a v68 .word instruction.
|
||||
run-check_rev_gating: QEMU_OPTS += -cpu v66
|
||||
check_rev_gating: check_rev_gating.c
|
||||
$(CC) $(CFLAGS) -mv66 -O2 $< -o $@ $(LDFLAGS)
|
||||
|
||||
# This test has to be compiled for the -mv67t target
|
||||
usr: usr.c hex_test.h
|
||||
$(CC) $(CFLAGS) -mv67t -O2 -Wno-inline-asm -Wno-expansion-to-defined $< -o $@ $(LDFLAGS)
|
||||
|
||||
# Build this test with -mv71 to exercise the CABAC instruction
|
||||
misc: misc.c
|
||||
$(CC) $(CFLAGS) -mv71 -O2 $< -o $@ $(LDFLAGS)
|
||||
scatter_gather: CFLAGS += -mhvx
|
||||
vector_add_int: CFLAGS += -mhvx -fvectorize
|
||||
hvx_misc: hvx_misc.c hvx_misc.h
|
||||
hvx_misc: CFLAGS += -mhvx
|
||||
hvx_histogram: CFLAGS += -mhvx -Wno-gnu-folding-constant
|
||||
v68_hvx: v68_hvx.c hvx_misc.h v6mpy_ref.c.inc
|
||||
v68_hvx: CFLAGS += -mhvx -Wno-unused-function
|
||||
v69_hvx: v69_hvx.c hvx_misc.h
|
||||
v69_hvx: CFLAGS += -mhvx -Wno-unused-function
|
||||
v73_scalar: CFLAGS += -Wno-unused-function
|
||||
fp_hvx: fp_hvx.c hvx_misc.h hex_test.h
|
||||
fp_hvx: CFLAGS += -mhvx -mhvx-ieee-fp
|
||||
fp_hvx_disabled: fp_hvx_disabled.c hvx_misc.h hex_test.h
|
||||
fp_hvx_disabled: CFLAGS += -mhvx -mhvx-ieee-fp
|
||||
fp_hvx_cvt: fp_hvx_cvt.c hvx_misc.h hex_test.h
|
||||
fp_hvx_cvt: CFLAGS += -mhvx -mhvx-ieee-fp
|
||||
fp_hvx_cmp: fp_hvx_cmp.c hvx_misc.h hex_test.h
|
||||
fp_hvx_cmp: CFLAGS += -mhvx -mhvx-ieee-fp
|
||||
|
||||
run-fp_hvx_disabled: QEMU_OPTS += -cpu v73,ieee-fp=false
|
||||
|
||||
hvx_histogram: hvx_histogram.c hvx_histogram_row.S
|
||||
$(CC) $(CFLAGS) $(CROSS_CC_GUEST_CFLAGS) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
ifeq ($(CONFIG_PLUGIN),y)
|
||||
# LLVM is way too aggressive with inlining and dead code elimination even at
|
||||
# -O0, which interferes with the test. What looks like dead code in this test
|
||||
# to the compiler isn't actually dead code, so we need to disable all potential
|
||||
# LLVM optimization passes.
|
||||
test-plugin-set-pc: CFLAGS += -Xclang -disable-llvm-passes
|
||||
endif
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
|
||||
int err;
|
||||
|
||||
#include "hex_test.h"
|
||||
|
||||
static inline int32_t atomic_inc32(int32_t *x)
|
||||
{
|
||||
int32_t old, dummy;
|
||||
__asm__ __volatile__(
|
||||
"1: %0 = memw_locked(%2)\n\t"
|
||||
" %1 = add(%0, #1)\n\t"
|
||||
" memw_locked(%2, p0) = %1\n\t"
|
||||
" if (!p0) jump 1b\n\t"
|
||||
: "=&r"(old), "=&r"(dummy)
|
||||
: "r"(x)
|
||||
: "p0", "memory");
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline int64_t atomic_inc64(int64_t *x)
|
||||
{
|
||||
int64_t old, dummy;
|
||||
__asm__ __volatile__(
|
||||
"1: %0 = memd_locked(%2)\n\t"
|
||||
" %1 = #1\n\t"
|
||||
" %1 = add(%0, %1)\n\t"
|
||||
" memd_locked(%2, p0) = %1\n\t"
|
||||
" if (!p0) jump 1b\n\t"
|
||||
: "=&r"(old), "=&r"(dummy)
|
||||
: "r"(x)
|
||||
: "p0", "memory");
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline int32_t atomic_dec32(int32_t *x)
|
||||
{
|
||||
int32_t old, dummy;
|
||||
__asm__ __volatile__(
|
||||
"1: %0 = memw_locked(%2)\n\t"
|
||||
" %1 = add(%0, #-1)\n\t"
|
||||
" memw_locked(%2, p0) = %1\n\t"
|
||||
" if (!p0) jump 1b\n\t"
|
||||
: "=&r"(old), "=&r"(dummy)
|
||||
: "r"(x)
|
||||
: "p0", "memory");
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline int64_t atomic_dec64(int64_t *x)
|
||||
{
|
||||
int64_t old, dummy;
|
||||
__asm__ __volatile__(
|
||||
"1: %0 = memd_locked(%2)\n\t"
|
||||
" %1 = #-1\n\t"
|
||||
" %1 = add(%0, %1)\n\t"
|
||||
" memd_locked(%2, p0) = %1\n\t"
|
||||
" if (!p0) jump 1b\n\t"
|
||||
: "=&r"(old), "=&r"(dummy)
|
||||
: "r"(x)
|
||||
: "p0", "memory");
|
||||
return old;
|
||||
}
|
||||
|
||||
#define LOOP_CNT 1000
|
||||
volatile int32_t tick32 = 1; /* Using volatile because we are testing atomics */
|
||||
volatile int64_t tick64 = 1; /* Using volatile because we are testing atomics */
|
||||
|
||||
void *thread1_func(void *arg)
|
||||
{
|
||||
for (int i = 0; i < LOOP_CNT; i++) {
|
||||
atomic_inc32(&tick32);
|
||||
atomic_dec64(&tick64);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *thread2_func(void *arg)
|
||||
{
|
||||
for (int i = 0; i < LOOP_CNT; i++) {
|
||||
atomic_dec32(&tick32);
|
||||
atomic_inc64(&tick64);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void test_pthread(void)
|
||||
{
|
||||
pthread_t tid1, tid2;
|
||||
|
||||
pthread_create(&tid1, NULL, thread1_func, "hello1");
|
||||
pthread_create(&tid2, NULL, thread2_func, "hello2");
|
||||
pthread_join(tid1, NULL);
|
||||
pthread_join(tid2, NULL);
|
||||
|
||||
check32(tick32, 1);
|
||||
check64(tick64, 1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
test_pthread();
|
||||
puts(err ? "FAIL" : "PASS");
|
||||
return err;
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int err;
|
||||
|
||||
#include "hex_test.h"
|
||||
|
||||
#define NBITS 8
|
||||
#define SIZE (1 << NBITS)
|
||||
|
||||
int64_t dbuf[SIZE] __attribute__((aligned(1 << 16))) = {0};
|
||||
int32_t wbuf[SIZE] __attribute__((aligned(1 << 16))) = {0};
|
||||
int16_t hbuf[SIZE] __attribute__((aligned(1 << 16))) = {0};
|
||||
uint8_t bbuf[SIZE] __attribute__((aligned(1 << 16))) = {0};
|
||||
|
||||
/*
|
||||
* We use the C preporcessor to deal with the combinations of types
|
||||
*/
|
||||
|
||||
#define BREV_LOAD(SZ, RES, ADDR, INC) \
|
||||
__asm__( \
|
||||
"m0 = %2\n\t" \
|
||||
"%0 = mem" #SZ "(%1++m0:brev)\n\t" \
|
||||
: "=r"(RES), "+r"(ADDR) \
|
||||
: "r"(INC) \
|
||||
: "m0")
|
||||
|
||||
#define BREV_LOAD_b(RES, ADDR, INC) \
|
||||
BREV_LOAD(b, RES, ADDR, INC)
|
||||
#define BREV_LOAD_ub(RES, ADDR, INC) \
|
||||
BREV_LOAD(ub, RES, ADDR, INC)
|
||||
#define BREV_LOAD_h(RES, ADDR, INC) \
|
||||
BREV_LOAD(h, RES, ADDR, INC)
|
||||
#define BREV_LOAD_uh(RES, ADDR, INC) \
|
||||
BREV_LOAD(uh, RES, ADDR, INC)
|
||||
#define BREV_LOAD_w(RES, ADDR, INC) \
|
||||
BREV_LOAD(w, RES, ADDR, INC)
|
||||
#define BREV_LOAD_d(RES, ADDR, INC) \
|
||||
BREV_LOAD(d, RES, ADDR, INC)
|
||||
|
||||
#define BREV_STORE(SZ, PART, ADDR, VAL, INC) \
|
||||
__asm__( \
|
||||
"m0 = %2\n\t" \
|
||||
"mem" #SZ "(%0++m0:brev) = %1" PART "\n\t" \
|
||||
: "+r"(ADDR) \
|
||||
: "r"(VAL), "r"(INC) \
|
||||
: "m0", "memory")
|
||||
|
||||
#define BREV_STORE_b(ADDR, VAL, INC) \
|
||||
BREV_STORE(b, "", ADDR, VAL, INC)
|
||||
#define BREV_STORE_h(ADDR, VAL, INC) \
|
||||
BREV_STORE(h, "", ADDR, VAL, INC)
|
||||
#define BREV_STORE_f(ADDR, VAL, INC) \
|
||||
BREV_STORE(h, ".H", ADDR, VAL, INC)
|
||||
#define BREV_STORE_w(ADDR, VAL, INC) \
|
||||
BREV_STORE(w, "", ADDR, VAL, INC)
|
||||
#define BREV_STORE_d(ADDR, VAL, INC) \
|
||||
BREV_STORE(d, "", ADDR, VAL, INC)
|
||||
|
||||
#define BREV_STORE_NEW(SZ, ADDR, VAL, INC) \
|
||||
__asm__( \
|
||||
"m0 = %2\n\t" \
|
||||
"{\n\t" \
|
||||
" r5 = %1\n\t" \
|
||||
" mem" #SZ "(%0++m0:brev) = r5.new\n\t" \
|
||||
"}\n\t" \
|
||||
: "+r"(ADDR) \
|
||||
: "r"(VAL), "r"(INC) \
|
||||
: "r5", "m0", "memory")
|
||||
|
||||
#define BREV_STORE_bnew(ADDR, VAL, INC) \
|
||||
BREV_STORE_NEW(b, ADDR, VAL, INC)
|
||||
#define BREV_STORE_hnew(ADDR, VAL, INC) \
|
||||
BREV_STORE_NEW(h, ADDR, VAL, INC)
|
||||
#define BREV_STORE_wnew(ADDR, VAL, INC) \
|
||||
BREV_STORE_NEW(w, ADDR, VAL, INC)
|
||||
|
||||
uint32_t bitreverse(uint32_t x)
|
||||
{
|
||||
uint32_t result = 0;
|
||||
for (int i = 0; i < NBITS; i++) {
|
||||
result <<= 1;
|
||||
result |= x & 1;
|
||||
x >>= 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t sext8(int32_t x)
|
||||
{
|
||||
return (x << 24) >> 24;
|
||||
}
|
||||
|
||||
#define TEST_BREV_LOAD(SZ, TYPE, BUF, SHIFT, EXP) \
|
||||
do { \
|
||||
p = BUF; \
|
||||
for (int i = 0; i < SIZE; i++) { \
|
||||
TYPE result; \
|
||||
BREV_LOAD_##SZ(result, p, 1 << (SHIFT - NBITS)); \
|
||||
check32(result, EXP); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define TEST_BREV_STORE(SZ, TYPE, BUF, VAL, SHIFT) \
|
||||
do { \
|
||||
p = BUF; \
|
||||
memset(BUF, 0xff, sizeof(BUF)); \
|
||||
for (int i = 0; i < SIZE; i++) { \
|
||||
BREV_STORE_##SZ(p, (TYPE)(VAL), 1 << (SHIFT - NBITS)); \
|
||||
} \
|
||||
for (int i = 0; i < SIZE; i++) { \
|
||||
check32(BUF[i], bitreverse(i)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define TEST_BREV_STORE_NEW(SZ, BUF, SHIFT) \
|
||||
do { \
|
||||
p = BUF; \
|
||||
memset(BUF, 0xff, sizeof(BUF)); \
|
||||
for (int i = 0; i < SIZE; i++) { \
|
||||
BREV_STORE_##SZ(p, i, 1 << (SHIFT - NBITS)); \
|
||||
} \
|
||||
for (int i = 0; i < SIZE; i++) { \
|
||||
check32(BUF[i], bitreverse(i)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* We'll set high_half[i] = i << 16 for use in the .H form of store
|
||||
* which stores from the high half of the word.
|
||||
*/
|
||||
int high_half[SIZE];
|
||||
|
||||
int main()
|
||||
{
|
||||
void *p;
|
||||
|
||||
for (int i = 0; i < SIZE; i++) {
|
||||
bbuf[i] = bitreverse(i);
|
||||
hbuf[i] = bitreverse(i);
|
||||
wbuf[i] = bitreverse(i);
|
||||
dbuf[i] = bitreverse(i);
|
||||
high_half[i] = i << 16;
|
||||
}
|
||||
|
||||
TEST_BREV_LOAD(b, int32_t, bbuf, 16, sext8(i));
|
||||
TEST_BREV_LOAD(ub, int32_t, bbuf, 16, i);
|
||||
TEST_BREV_LOAD(h, int32_t, hbuf, 15, i);
|
||||
TEST_BREV_LOAD(uh, int32_t, hbuf, 15, i);
|
||||
TEST_BREV_LOAD(w, int32_t, wbuf, 14, i);
|
||||
TEST_BREV_LOAD(d, int64_t, dbuf, 13, i);
|
||||
|
||||
TEST_BREV_STORE(b, int32_t, bbuf, i, 16);
|
||||
TEST_BREV_STORE(h, int32_t, hbuf, i, 15);
|
||||
TEST_BREV_STORE(f, int32_t, hbuf, high_half[i], 15);
|
||||
TEST_BREV_STORE(w, int32_t, wbuf, i, 14);
|
||||
TEST_BREV_STORE(d, int64_t, dbuf, i, 13);
|
||||
|
||||
TEST_BREV_STORE_NEW(bnew, bbuf, 16);
|
||||
TEST_BREV_STORE_NEW(hnew, hbuf, 15);
|
||||
TEST_BREV_STORE_NEW(wnew, wbuf, 14);
|
||||
|
||||
puts(err ? "FAIL" : "PASS");
|
||||
return err ? 1 : 0;
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Test that instructions from a newer revision than the running CPU
|
||||
* are rejected with SIGILL.
|
||||
*
|
||||
* Compiled with -mv66 so that e_flags selects CPU v66. The test embeds
|
||||
* a v68 instruction (L2_loadw_aq: "r0 = memw_aq(r0)") via .word
|
||||
* encoding. The revision-gated decoder must reject it, and linux-user
|
||||
* must deliver SIGILL.
|
||||
*
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void *resume_pc;
|
||||
static int signals_handled;
|
||||
static int expected_signals;
|
||||
|
||||
static void handle_sigill(int sig, siginfo_t *info, void *puc)
|
||||
{
|
||||
ucontext_t *uc = (ucontext_t *)puc;
|
||||
|
||||
if (sig != SIGILL) {
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
uc->uc_mcontext.r0 = SIGILL;
|
||||
uc->uc_mcontext.pc = (unsigned long)resume_pc;
|
||||
signals_handled++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to execute an instruction introduced after v66
|
||||
* On a v66 CPU this must raise SIGILL.
|
||||
*
|
||||
* Since we are building for v66, the assembler will reject
|
||||
* the instructions, so introduce them with .word.
|
||||
*/
|
||||
#define TRY_FUNC(NAME, WORD) \
|
||||
static int try_##NAME(void) \
|
||||
{ \
|
||||
int sig; \
|
||||
expected_signals++; \
|
||||
asm volatile( \
|
||||
"r0 = #0\n" \
|
||||
"r1 = ##1f\n" \
|
||||
"memw(%1) = r1\n" \
|
||||
WORD \
|
||||
"1:\n" \
|
||||
"%0 = r0\n" \
|
||||
: "=r"(sig) \
|
||||
: "r"(&resume_pc) \
|
||||
: "r0", "r1", "memory"); \
|
||||
return sig; \
|
||||
}
|
||||
|
||||
TRY_FUNC(v68_loadw_aq,
|
||||
".word 0x9200c800 /* { r0 = memw_aq(r0) } */\n")
|
||||
TRY_FUNC(v68_loadd_aq,
|
||||
".word 0x9201d800 /* r1:0 = memd_aq(r1) */\n")
|
||||
TRY_FUNC(v68_release_at,
|
||||
".word 0xa0e0c00c /* release(r0):at */\n")
|
||||
TRY_FUNC(v68_release_st,
|
||||
".word 0xa0e0c02c /* release(r0):st */\n")
|
||||
TRY_FUNC(v68_storew_rl_at,
|
||||
".word 0xa0a0c108 /* memw_rl(r0):at = r1 */\n")
|
||||
TRY_FUNC(v68_stored_rl_at,
|
||||
".word 0xa0e2c008 /* memd_rl(r2):at = r1:0 */\n")
|
||||
TRY_FUNC(v68_storew_rl_st,
|
||||
".word 0xa0a0c128 /* memw_rl(r0):st = r1 */\n")
|
||||
TRY_FUNC(v68_stored_rl_st,
|
||||
".word 0xa0e2c028 /* memd_rl(r2):st = r1:0 */\n")
|
||||
|
||||
TRY_FUNC(v68hvx_v6mpy,
|
||||
".word 0x1f42e424 /* v5:4.w = v6mpy(v5:4.ub, v3:2.b, #1):v */\n")
|
||||
|
||||
TRY_FUNC(v69hvx_vasrvuhubrndsat,
|
||||
".word 0x1d06c465 /* v5.ub = vasr(v5:4.uh, v6.ub):rnd:sat */\n")
|
||||
TRY_FUNC(v69hvx_vasrvuhubsat,
|
||||
".word 0x1d06c445 /* v5.ub = vasr(v5:4.uh, v6.ub):sat */\n")
|
||||
TRY_FUNC(v69hvx_vasrvwuhrndsat,
|
||||
".word 0x1d06c425 /* v5.uh = vasr(v5:4.w, v6.uh):rnd:sat */\n")
|
||||
TRY_FUNC(v69hvx_vasrvwuhsat,
|
||||
".word 0x1d06c405 /* v5.uh = vasr(v5:4.w, v6.uh):sat */\n")
|
||||
TRY_FUNC(v69hvx_vassign_tmp,
|
||||
".word 0x1e014dcc /* { v12.tmp = v13 */\n"
|
||||
".word 0x1c43cc04 /* v4.w = vadd(v12.w, v3.w) } */\n")
|
||||
TRY_FUNC(v69hvx_vcombine_tmp,
|
||||
".word 0x1eae4fec /* { v13:12.tmp = vcombine(v15, v14) */\n"
|
||||
".word 0x1c434c04 /* v4.w = vadd(v12.w, v3.w) */\n"
|
||||
".word 0x1e03edf0 /* v16 = v13 } */\n")
|
||||
TRY_FUNC(v69hvx_vmpyuhvs,
|
||||
".word 0x1fc5e4e4 /* v4.uh = vmpy(V4.uh, v5.uh):>>16 */\n")
|
||||
|
||||
TRY_FUNC(v73_callrh,
|
||||
".word 0x50c5c000 /* callrh r5 */\n")
|
||||
TRY_FUNC(v73_jumprh,
|
||||
".word 0x52c0c000 /* jumprh r0 */\n")
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct sigaction act;
|
||||
|
||||
memset(&act, 0, sizeof(act));
|
||||
act.sa_sigaction = handle_sigill;
|
||||
act.sa_flags = SA_SIGINFO;
|
||||
assert(sigaction(SIGILL, &act, NULL) == 0);
|
||||
|
||||
assert(try_v68_loadw_aq() == SIGILL);
|
||||
assert(try_v68_loadd_aq() == SIGILL);
|
||||
assert(try_v68_release_at() == SIGILL);
|
||||
assert(try_v68_release_st() == SIGILL);
|
||||
assert(try_v68_storew_rl_at() == SIGILL);
|
||||
assert(try_v68_stored_rl_at() == SIGILL);
|
||||
assert(try_v68_storew_rl_st() == SIGILL);
|
||||
assert(try_v68_stored_rl_st() == SIGILL);
|
||||
|
||||
assert(try_v68hvx_v6mpy() == SIGILL);
|
||||
|
||||
assert(try_v69hvx_vasrvuhubrndsat() == SIGILL);
|
||||
assert(try_v69hvx_vasrvuhubsat() == SIGILL);
|
||||
assert(try_v69hvx_vasrvwuhrndsat() == SIGILL);
|
||||
assert(try_v69hvx_vasrvwuhsat() == SIGILL);
|
||||
assert(try_v69hvx_vassign_tmp() == SIGILL);
|
||||
assert(try_v69hvx_vcombine_tmp() == SIGILL);
|
||||
assert(try_v69hvx_vmpyuhvs() == SIGILL);
|
||||
|
||||
assert(try_v73_callrh() == SIGILL);
|
||||
assert(try_v73_jumprh() == SIGILL);
|
||||
|
||||
assert(signals_handled == expected_signals);
|
||||
|
||||
puts("PASS");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user