unicorn/qemu
Aleksandar Markovic 84b516d9db
target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>
New set of helpers for handling nan2008-syle versions of instructions
<CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>, for Mips R6.

All involved instructions have float operand and integer result. Their
core functionality is implemented via invocations of appropriate SoftFloat
functions. The problematic cases are when the operand is a NaN, and also
when the operand (float) is out of the range of the result.

Here one can distinguish three cases:

CASE MIPS-A: (FCR31.NAN2008 == 1)

1. Operand is a NaN, result should be 0;
2. Operand is larger than INT_MAX, result should be INT_MAX;
3. Operand is smaller than INT_MIN, result should be INT_MIN.

CASE MIPS-B: (FCR31.NAN2008 == 0)

1. Operand is a NaN, result should be INT_MAX;
2. Operand is larger than INT_MAX, result should be INT_MAX;
3. Operand is smaller than INT_MIN, result should be INT_MAX.

CASE SoftFloat:

1. Operand is a NaN, result is INT_MAX;
2. Operand is larger than INT_MAX, result is INT_MAX;
3. Operand is smaller than INT_MIN, result is INT_MIN.

Current implementation of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>
implements case MIPS-B. This patch relates to case MIPS-A. For case
MIPS-A, only return value for NaN-operands should be corrected after
appropriate SoftFloat library function is called.

Related MSA instructions FTRUNC_S and FTINT_S already handle well
all cases, in the fashion similar to the code from this patch.

Backports commit 87552089b62fa229d2ff86906e4e779177fb5835 from qemu
2018-02-24 21:14:04 -05:00
..
crypto
default-configs
docs
fpu softfloat: Handle snan_bit_is_one == 0 in MIPS pickNaNMulAdd() 2018-02-24 20:40:11 -05:00
hw qemu-common: push cpu.h inclusion out of qemu-common.h 2018-02-24 01:50:56 -05:00
include softfloat: Implement run-time-configurable meaning of signaling NaN bit 2018-02-24 20:27:12 -05:00
qapi qapi: Change visit_type_FOO() to no longer return partial objects 2018-02-23 19:53:17 -05:00
qobject util: move declarations out of qemu-common.h 2018-02-22 09:25:48 -05:00
qom qom: API to get instance_size of a type 2018-02-24 19:00:16 -05:00
scripts qapi: Change visit_type_FOO() to no longer return partial objects 2018-02-23 19:53:17 -05:00
target-arm softfloat: Implement run-time-configurable meaning of signaling NaN bit 2018-02-24 20:27:12 -05:00
target-i386 exec: [tcg] Track which vCPU is performing translation and execution 2018-02-24 19:21:39 -05:00
target-m68k softfloat: Implement run-time-configurable meaning of signaling NaN bit 2018-02-24 20:27:12 -05:00
target-mips target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D> 2018-02-24 21:14:04 -05:00
target-sparc exec: [tcg] Track which vCPU is performing translation and execution 2018-02-24 19:21:39 -05:00
tcg exec: [tcg] Track which vCPU is performing translation and execution 2018-02-24 19:21:39 -05:00
util util: align memory allocations to 2M on AArch64 2018-02-23 13:56:59 -05:00
aarch64.h target-arm: Provide hook to tell GICv3 about changes of security state 2018-02-24 19:09:22 -05:00
aarch64eb.h target-arm: Provide hook to tell GICv3 about changes of security state 2018-02-24 19:09:22 -05:00
accel.c accel: make configure_accelerator return void 2018-02-24 00:31:28 -05:00
arm.h target-arm: Provide hook to tell GICv3 about changes of security state 2018-02-24 19:09:22 -05:00
armeb.h target-arm: Provide hook to tell GICv3 about changes of security state 2018-02-24 19:09:22 -05:00
CODING_STYLE
configure configure: Enable -Werror for MinGW builds, too 2018-02-24 18:56:05 -05:00
COPYING
COPYING.LIB
cpu-exec-common.c cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc() 2018-02-24 17:25:28 -05:00
cpu-exec.c tb hash: hash phys_pc, pc, and flags with xxhash 2018-02-24 18:00:14 -05:00
cpus.c cpu: move exec-all.h inclusion out of cpu.h 2018-02-24 02:39:08 -05:00
cputlb.c memory: split memory_region_from_host from qemu_ram_addr_from_host 2018-02-24 16:06:49 -05:00
exec.c exec: hide mr->ram_addr from qemu_get_ram_ptr users 2018-02-24 16:17:49 -05:00
gen_all_header.sh
glib_compat.c glib_compat: backport hashtable iterator interfaces 2018-02-21 13:18:44 -05:00
HACKING
header_gen.py target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D> 2018-02-24 21:14:04 -05:00
ioport.c hw: remove pio_addr_t 2018-02-24 02:43:16 -05:00
LICENSE
m68k.h qom: API to get instance_size of a type 2018-02-24 19:00:16 -05:00
Makefile Makefile: Add a FORCE target 2018-02-24 17:03:51 -05:00
Makefile.objs
Makefile.target
memory_mapping.c include/qemu/osdep.h: Don't include qapi/error.h 2018-02-21 23:08:18 -05:00
memory.c exec: hide mr->ram_addr from qemu_get_ram_ptr users 2018-02-24 16:17:49 -05:00
mips64.h target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D> 2018-02-24 21:14:04 -05:00
mips64el.h target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D> 2018-02-24 21:14:04 -05:00
mips.h target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D> 2018-02-24 21:14:04 -05:00
mipsel.h target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D> 2018-02-24 21:14:04 -05:00
powerpc.h qom: API to get instance_size of a type 2018-02-24 19:00:16 -05:00
qapi-schema.json
qemu-log.c log: move qemu_log_close/qemu_log_flush from header to log.c 2018-02-22 11:13:17 -05:00
qemu-timer.c
rules.mak Makefile: add dependency on scripts/create_config 2018-02-24 17:05:03 -05:00
softmmu_template.h
sparc64.h qom: API to get instance_size of a type 2018-02-24 19:00:16 -05:00
sparc.h qom: API to get instance_size of a type 2018-02-24 19:00:16 -05:00
tcg-runtime.c
translate-all.c exec: [tcg] Track which vCPU is performing translation and execution 2018-02-24 19:21:39 -05:00
translate-all.h user-exec: Push resume-from-signal code out to handle_cpu_signal() 2018-02-24 17:21:06 -05:00
translate-common.c
unicorn_common.h
VERSION
vl.c hw: explicitly include qemu/log.h 2018-02-24 02:00:45 -05:00
vl.h
x86_64.h qom: API to get instance_size of a type 2018-02-24 19:00:16 -05:00