unicorn/qemu/target/i386
Peter Maydell 5899803c3c
target/i386: Return 'indefinite integer value' for invalid SSE fp->int conversions
The x86 architecture requires that all conversions from floating
point to integer which raise the 'invalid' exception (infinities of
both signs, NaN, and all values which don't fit in the destination
integer) return what the x86 spec calls the "indefinite integer
value", which is 0x8000_0000 for 32-bits or 0x8000_0000_0000_0000 for
64-bits. The softfloat functions return the more usual behaviour of
positive overflows returning the maximum value that fits in the
destination integer format and negative overflows returning the
minimum value that fits.

Wrap the softfloat functions in x86-specific versions which
detect the 'invalid' condition and return the indefinite integer.

Note that we don't use these wrappers for the 3DNow! pf2id and pf2iw
instructions, which do return the minimum value that fits in
an int32 if the input float is a large negative number.

Fixes: https://bugs.launchpad.net/qemu/+bug/1815423

Backports commit 1e8a98b53867f61da9ca09f411288e2085d323c4 from qemu
2019-11-18 21:48:03 -05:00
..
arch_memory_mapping.c
bpt_helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
cc_helper_template.h
cc_helper.c
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 19:35:46 -04:00
cpu-qom.h i386: Register versioned CPU models 2019-08-08 19:01:35 -04:00
cpu.c target-i386: adds PV_SCHED_YIELD CPUID feature bit 2019-11-18 21:38:26 -05:00
cpu.h i386: Register versioned CPU models 2019-08-08 19:01:35 -04:00
excp_helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
fpu_helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
helper.h target/i386: Implement CPUID_EXT_RDRAND 2019-05-23 15:12:50 -04:00
int_helper.c target/i386: Implement CPUID_EXT_RDRAND 2019-05-23 15:12:50 -04:00
Makefile.objs
mem_helper.c cpu: Replace ENV_GET_CPU with env_cpu 2019-06-12 11:16:16 -04:00
misc_helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
mpx_helper.c
ops_sse_header.h
ops_sse.h target/i386: Return 'indefinite integer value' for invalid SSE fp->int conversions 2019-11-18 21:48:03 -05:00
seg_helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
shift_helper_template.h
smm_helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
svm_helper.c target/i386: Use env_cpu, env_archcpu 2019-06-12 11:46:35 -04:00
svm.h target-i386: Add NPT support 2018-07-03 19:52:56 -04:00
TODO
topology.h i386: Update new x86_apicid parsing rules with die_offset support 2019-08-08 18:22:03 -04:00
translate.c target/i386: Implement CPUID_EXT_RDRAND 2019-05-23 15:12:50 -04:00
unicorn.c x86: setup FS & GS base 2019-08-08 20:26:45 -04:00
unicorn.h