summaryrefslogtreecommitdiff
path: root/fpu
AgeCommit message (Collapse)AuthorFilesLines
2011-05-03Merge commit 'a1d8db07fb46e1da410ca7b4ce24a997707d4a53' into upstream-mergeMarcelo Tosatti5-16/+176
* commit 'a1d8db07fb46e1da410ca7b4ce24a997707d4a53': (72 commits) target-i386: fix constants wrt softfloat target-i386: fix helper_fprem() and helper_fprem1() wrt softfloat target-i386: fix logarithmic and trigonometric helpers wrt softfloat target-i386: add CPU86_LDouble <-> double conversion functions target-i386: replace approx_rsqrt and approx_rcp by softfloat ops target-i386: fix helper_fsqrt() wrt softfloat target-i386: fix helper_fdiv() wrt softfloat target-i386: fix helper_fxtract() wrt softfloat target-i386: fix helper_fbld_ST0() wrt softfloat target-i386: fix helper_fscale() wrt softfloat softfloat-native: add float*_is_any_nan() functions softfloat-native: fix float*_scalbn() functions softfloat: fix float*_scalnb() corner cases softfloat: add floatx80_compare*() functions softfloat-native: add a few constant values softfloat: add pi constants softfloat: add floatx80 constants softfloat: fix floatx80_is_infinity() softfloat: fix floatx80 handling of NaN vmstate: port mac_dbdma ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-05-03Merge commit '3110e2925489c571901e945e315942ce84fe696f' into upstream-mergeMarcelo Tosatti4-85/+304
* commit '3110e2925489c571901e945e315942ce84fe696f': (41 commits) s390x: Enable s390x-softmmu target s390x: Prepare cpu.h for emulation move helpers.h to helper.h libcacard: fix opposite usage of isspace target-mips: clear softfpu exception state for comparison instructions target-mips: fix c.ps.* instructions target-mips: don't hardcode softfloat exception bits target-mips: simplify FP comparisons target-ppc: fix SPE comparison functions softfloat: improve description of comparison functions softfloat: move float*_eq and float*_eq_quiet softfloat: rename float*_eq_signaling() into float*_eq() softfloat: rename float*_eq() into float*_eq_quiet() target-i386: fix CMPUNORDPS/D and CMPORDPS/D instructions target-mips: use new float*_unordered*() functions target-alpha: use new float64_unordered_quiet() function softfloat-native: add float*_unordered_quiet() functions softfloat: add float*_unordered_{,quiet}() functions target-i386: add floatx_{add,mul,sub} and use them target-i386: use float unions from cpu-all.h ... Conflicts: cpu-exec.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-04-25softfloat-native: add float*_is_any_nan() functionsAurelien Jarno2-0/+29
Add float*_is_any_nan() functions to match the softfloat API. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat-native: fix float*_scalbn() functionsAurelien Jarno1-3/+3
float*_scalbn() should be able to take a status parameter. Fix that. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat: fix float*_scalnb() corner casesAurelien Jarno1-5/+42
float*_scalnb() were not taking into account all cases. This patch fixes some corner cases: - NaN values in input were not properly propagated and the invalid flag not correctly raised. Use propagateFloat*NaN() for that. - NaN or infinite values in input of floatx80_scalnb() were not correctly detected due to a typo. - The sum of exponent and n could overflow, leading to strange results. Additionally having int16 defined to int make that happening for a very small range of values. Fix that by saturating n to the maximum exponent range, and using an explicit wider type if needed. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat: add floatx80_compare*() functionsAurelien Jarno2-0/+48
Add floatx80_compare() and floatx80_compare_quiet() functions to match the softfloat-native ones. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat-native: add a few constant valuesAurelien Jarno1-0/+27
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat: add pi constantsAurelien Jarno1-0/+3
Add a pi constant for float32, float64, floatx80. It will be used by target-i386 and later by the trigonometric functions. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat: add floatx80 constantsAurelien Jarno1-0/+7
Add floatx80 constants similarly to float32 or float64. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat: fix floatx80_is_infinity()Aurelien Jarno1-1/+1
With floatx80, the explicit bit is set for infinity. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25softfloat: fix floatx80 handling of NaNAurelien Jarno1-7/+16
The floatx80 format uses an explicit bit that should be taken into account when converting to and from commonNaN format. When converting to commonNaN, the explicit bit should be removed if it is a 1, and a default NaN should be used if it is 0. When converting from commonNan, the explicit bit should be added. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-17softfloat: improve description of comparison functionsAurelien Jarno1-37/+48
Make clear for all comparison functions which ones trigger an exception for all NaNs, and which one only for sNaNs. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-17softfloat: move float*_eq and float*_eq_quietAurelien Jarno2-59/+58
I am not a big fan of code moving, but having the signaling version in the middle of quiet versions and vice versa doesn't make the code easy to read. This patch is a simple code move, basically swapping locations of float*_eq and float*_eq_quiet. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-17softfloat: rename float*_eq_signaling() into float*_eq()Aurelien Jarno3-11/+11
float*_eq_signaling functions have a different semantics than other comparison functions. Fix that by renaming float*_quiet_signaling() into float*_eq(). Note that it is purely mechanical, and the behaviour should be unchanged. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-17softfloat: rename float*_eq() into float*_eq_quiet()Aurelien Jarno3-11/+11
float*_eq functions have a different semantics than other comparison functions. Fix that by first renaming float*_quiet() into float*_eq_quiet(). Note that it is purely mechanical, and the behaviour should be unchanged. That said it clearly highlight problems due to this different semantics, they are fixed later in this patch series. Cc: Alexander Graf <agraf@suse.de> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-17softfloat-native: add float*_unordered_quiet() functionsAurelien Jarno1-3/+12
Add float*_unordered_quiet() functions to march the softfloat versions. As FPU status is not tracked with softfloat-native, they don't differ from the signaling version. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-17softfloat: add float*_unordered_{,quiet}() functionsAurelien Jarno2-0/+175
Add float*_unordered() functions to softfloat, matching the softfloat-native ones. Also add float*_unordered_quiet() functions to match the others comparison functions. This allow target-i386/ops_sse.h to be compiled with softfloat. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-17softfloat: use GCC builtins to count the leading zerosAurelien Jarno1-2/+27
Softfloat has its own implementation to count the leading zeros. However a lot of architectures have either a dedicated instruction or an optimized to do that. When using GCC >= 3.4, this patch uses GCC builtins instead of the handcoded implementation. Note that I amware that QEMU_GNUC_PREREQ is defined in osdep.h and that clz32() and clz64() are defined in host-utils.h, but I think it is better to keep the softfloat implementation self contained. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-15Merge commit '4d9ad7f793605abd9806fc932b3e04e028894565' into upstream-mergeMarcelo Tosatti2-6/+10
* commit '4d9ad7f793605abd9806fc932b3e04e028894565': (48 commits) target-arm: Don't overflow when calculating value for signed VABAL Revert SeaBIOS change due to overzealous commit -a lm32: fix build breakage due to uninitialized variable 'r' vpc.c: Use get_option_parameter() does the search atapi: GESN: implement 'media' subcommand atapi: GESN: Standardise event response handling for future additions atapi: GESN: Use structs for commonly-used field types atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change atapi: Report correct errors on guest eject request atapi: Drives can be locked without media present qed: Add support for zero clusters docs: Describe zero data clusters in QED specification target-arm: Detect tininess before rounding for FP operations softfloat: Add setter function for tininess detection mode target-arm: Handle UNDEF cases for VDUP (scalar) target-arm: Treat UNPREDICTABLE VTBL, VTBX case as UNDEF target-arm: Handle UNDEF cases for Neon 2 register misc forms target-arm: Simplify checking of size field in Neon 2reg-misc forms target-arm: Handle UNDEF cases for VEXT ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-04-15Merge commit '23910d3f669d46073b403876e30a7314599633af' into upstream-mergeMarcelo Tosatti2-0/+53
* commit '23910d3f669d46073b403876e30a7314599633af': (109 commits) acpi, acpi_piix: factor out GPE logic arm: basic support for ARMv4/ARMv4T emulation Fix conversions from pointer to tcg_target_long vnc: tight: Fix crash after 2GB of output smbus_eeprom: consolidate smbus eeprom creation oc pc_piix, mips_mapta, mips_fulong lan9118: Ignore write to MAC_VLAN1 register acpi, acpi_piix, vt82c686: factor out PM1_CNT logic acpi, acpi_piix, vt82c686: factor out PM1a EVT logic acpi, acpi_piix, vt82c686: factor out PM_TMR logic hw/pflash_cfi02: Fix lazy reset of ROMD mode configure: avoid basename usage message mpc85xx_pci_map_irq: change "unknow" to "unknown" event: trivial coding style fixes multiboot: Quote filename in error message ppce500_mpc8544ds: Fix compile with --enable-debug and --disable-kvm Use existing helper function to implement popcntd instruction Delay creation of pseries device tree until reset pseries: Abolish envs array spapr_vscsi: Set uninitialized variable Don't call cpu_synchronize_state() from machine init. ... Conflicts: hw/acpi_piix4.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-04-14Merge commit 'b784421ce4cc860315f4ec31bbc3d67e91984074' into upstream-mergeMarcelo Tosatti5-466/+472
* commit 'b784421ce4cc860315f4ec31bbc3d67e91984074': Fix migration uint8 arrys handled softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t softfloat: Resolve type mismatches between declaration and implementation softfloat: Prepend QEMU-style header with derivation notice e1000: Fix multi-descriptor packet checksum offload rbd: don't link with -lcrypto hw/arm_sysctl.c: Add the Versatile Express system registers remove qemu_get_clock add a generic scaling mechanism for timers Add qcow2 documentation hw/xen_disk: aio_inflight not released in handling ioreq when nr_segments==0 Improve error handling in do_snapshot_blkdev() Fix ATA SMART and CHECK POWER MODE Don't allow multiwrites against a block device without underlying medium tools: Use real async.c instead of stubs Add error message for loading snapshot without VM state block/qcow: Don't ignore immediate read/write and other failures block/vdi: Don't ignore immediate read/write failures Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-04-12softfloat: Add setter function for tininess detection modePeter Maydell1-0/+4
Add a setter function for the underflow tininess detection mode, in line with the similar functions for other parts of the float status structure. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-12unicore32: necessary modifications for other files to support unicore32Guan Xuetao2-6/+6
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-03softfloat: Add float*_min() and float*_max() functionsPeter Maydell2-0/+53
Add min and max operations to softfloat. This allows us to implement propagation of NaNs and handling of negative zero correctly (unlike the approach of having target helper routines return one of the operands based on the result of a comparison op). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_tAndreas Färber5-432/+417
They are defined with the same semantics as the POSIX types, so prefer those for consistency. Suggested by Peter Maydell. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21softfloat: Resolve type mismatches between declaration and implementationAndreas Färber1-34/+34
The original SoftFloat 2.0b library avoided the use of custom integer types in its public headers. This requires the definitions of int{8,16,32,64} to match the assumptions in the declarations. This breaks on BeOS R5 and Haiku/x86, where int32 is defined in {be,os}/support/SupportDefs.h in terms of a long rather than an int. Spotted by Michael Lotz. Since QEMU already breaks this distinction by defining those types just above, do use them for consistency and to allow #ifndef'ing them out as done for [u]int16 on AIX. Cc: Michael Lotz <mmlr@mlotz.ch> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21softfloat: Prepend QEMU-style header with derivation noticeAndreas Färber4-0/+21
The SoftFloat license requires "prominent notice that the work is derivative". Having added features like improved 16-bit support for arm already, add such a notice to the sources. softfloat-native.[ch] are not under the SoftFloat license and thus are not changed. Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-14Merge commit '9257d46d55f1fe4e8209be9a6870e339ac3266fe' into upstream-mergeMarcelo Tosatti2-68/+84
* commit '9257d46d55f1fe4e8209be9a6870e339ac3266fe': (132 commits) add win32 qemu-thread implementation Refactor thread retrieval and check use win32 timer queues implement win32 dynticks timer unlock iothread during WaitForMultipleObjects hw/fmopl: Fix buffer access out-of-bounds errors moving eeprom initialization pc: fix wrong CMOS values for floppy drives microblaze: Add PVR for writeback cache, endians microblaze: Fix PetaLogix company name vmstate: move timers to use test instead of version vmstate: be able to store/save a pci device from a pointer vmstate: Add a way to send a partial array vmstate: add VMSTATE_STRUCT_VARRAY_UINT32 vmstate: add VMSTATE_INT64_ARRAY vmstate: add VMSTATE_STRUCT_VARRAY_INT32 vmstate: add UINT32 VARRAYS vmstate: Fix varrays with uint8 indexes vmstate: add VMSTATE_UINT32_EQUAL vnc: Fix stack corruption and other bitmap related bugs ... Conflicts: Makefile.objs
2011-02-24softfloat: add _set_sign(), _infinity and _half for 32 and 64 bits floats.Christophe Lyon1-0/+15
These constants and utility function are needed to implement some helpers. Defining constants avoids the need to re-compute them at runtime. Signed-off-by: Christophe Lyon <christophe.lyon@st.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-24softfloat: move all default NaN definitions to softfloat.h.Christophe Lyon2-68/+69
These special values are needed to implement some helper functions, which return/use these values in some cases. Signed-off-by: Christophe Lyon <christophe.lyon@st.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-16Merge commit 'b4a3d965dee06d52281496bb5fd0a5cb5534b545' into upstream-mergeMarcelo Tosatti3-55/+230
* commit 'b4a3d965dee06d52281496bb5fd0a5cb5534b545': (34 commits) Stop current VCPU on synchronous reset requests Prevent abortion on multiple VCPU kicks vmmouse: fix queue_size field initialization hpet: make optional sysbus: add creation function that may fail x86: make vmmouse optional isa: add creation function that may fail vmmouse: convert to qdev vmport: convert to qdev x86,MIPS: make vmware_vga optional pci: add creation functions that may fail qdev: add creation function that may fail vmware_vga: refactor device creation mst_fpga: Drop one more pxa.h inclusion. pxa2xx: convert i2c master to use qdev/vmsd max7310: finish qdev'ication tosa: we aren't connected to VBus, pass this info to Linux kernel mainstone: pass one irq to the mst_fpga instead of the whole PIC Drop unnecessary inclusions of pxa.h header Add scoop post_load callback that sets IRQs to loaded levels ... Conflicts: vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-02-10softfloat: Fix compilation failures with USE_SOFTFLOAT_STRUCT_TYPESPeter Maydell2-15/+21
Make softfloat compile with USE_SOFTFLOAT_STRUCT_TYPES defined, by adding and using new macros const_float16(), const_float32() and const_float64() so you can use array initializers in an array of float16/float32/float64 whether the types are bare or wrapped in the structs. [aurelien@aurel32.net: do the same for float16] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-10softfloat: Correctly handle NaNs in float16_to_float32()Peter Maydell2-3/+18
Correctly handle NaNs in float16_to_float32(), by defining and using a float16ToCommonNaN() function, as we do with the other formats. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-10softfloat: Fix single-to-half precision float conversionsPeter Maydell2-11/+38
Fix various bugs in the single-to-half-precision conversion code: * input NaNs not correctly converted in IEEE mode (fixed by defining and using a commonNaNToFloat16()) * wrong values returned when converting NaN/Inf into non-IEEE half precision value * wrong values returned for conversion of values which are on the boundary between denormal and zero for the half precision format * zeroes not correctly identified * excessively large results in non-IEEE mode should generate InvalidOp, not Overflow Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-10softfloat: Honour default_nan_mode for float-to-float conversionsChristophe Lyon2-16/+37
Honour the default_nan_mode flag when doing conversions between different floating point formats, as well as when returning a NaN from a two-operand floating point function. This corrects the behaviour of float<->double conversions on both ARM and SH4. Signed-off-by: Christophe Lyon <christophe.lyon@st.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-10softfloat: Add float16 type and float16 NaN handling functionsPeter Maydell3-10/+116
Add a float16 type to softfloat, rather than using bits16 directly. Also add the missing functions float16_is_quiet_nan(), float16_is_signaling_nan() and float16_maybe_silence_nan(), which are needed for the float16 conversion routines. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-21Merge commit 'b947c12c0bb217fe09968e652873e0d22b269d68' into upstream-mergeMarcelo Tosatti2-27/+36
* commit 'b947c12c0bb217fe09968e652873e0d22b269d68': (130 commits) sm501: fix screen redraw checkpatch: adjust to QEMUisms Add checkpatch.pl from Linux kernel Add scripts directory gt64xxx: set isa_mem_base during registration hw/pl190.c: Fix writing of default vector address target-ppc: fix wrong NaN tests target-ppc: fix sNaN propagation pci: use qemu_malloc() in pcibus_get_dev_path() msix: simplify write config msi: simplify write config a bit. pci: deassert intx on reset. pxa2xx_lcd: restore updating of display pxa2xx: fix vmstate_pxa2xx_i2c scoop: fix access to registers from second instance mainstone: fix name of the allocated memory for roms add bepo (french dvorak) keyboard layout stc91c111: Implement save/restore pl080: Implement save/restore pl110: Implement save/restore ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21Merge commit '377529c009e3fce480d9c233bb3238b14a950816' into upstream-mergeMarcelo Tosatti2-3/+134
* commit '377529c009e3fce480d9c233bb3238b14a950816': (64 commits) move feature variables to the top default make and install to environment variables default compilation tools to environment variables microblaze: Improve unconditional direct branching cris: Set btaken when storing direct jumps slirp: Use strcasecmp() to check tftp mode, tsize ppc405_uc: fix a buffer overflow lan9118: fix a buffer overflow vpc: fix a file descriptor leak qemu-io: fix a memory leak vvfat: fix a file descriptor leak loader: fix a file descriptor leak vnc-auth-sasl: fix a memory leak audio: split sample conversion and volume mixing disas: remove opcode printing on ARM hosts arm-dis: Include opcode hex when doing disassembly tcg arm/mips/ia64: add a comment about retranslation and caches linux-user: Add configure check for linux/fiemap.h and IOC_FS_FIEMAP ARM: Fix decoding of VQSHL/VQSHLU immediate forms ARM: add neon helpers for VQSHLU ... Conflicts: configure Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-20softfloat: fix floatx80_is_{quiet,signaling}_nan()Aurelien Jarno1-4/+8
floatx80_is_{quiet,signaling}_nan() functions are incorrectly detecting the type of NaN, depending on SNAN_BIT_IS_ONE, one of the two is returning the correct value, and the other true for any kind of NaN. This patch fixes that by applying the same kind of comparison as for other float formats, but taking into account the explicit bit. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-14softfloat: Add float32_is_zero_or_denormal() functionPeter Maydell1-0/+5
Add a utility function to softfloat to test whether a float32 is zero or denormal. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-14softfloat: fix default-NaN modeAurelien Jarno1-18/+18
When the default-NaN mode is enabled, it should return the default NaN value, but it should anyway raise the invalid operation flag if one of the operand is an sNaN. I have checked that this behavior matches the ARM and SH4 manuals, as well as real SH4 hardware. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-14softfloat: SH4 has the sNaN bit setAurelien Jarno1-5/+5
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-07softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()Peter Maydell1-0/+11
Implement versions of float*_is_any_nan() for the floatx80 and float128 types. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-01-06Merge commit 'e024e881bb1a8b5085026589360d26ed97acdd64' into upstream-mergeMarcelo Tosatti5-125/+449
* commit 'e024e881bb1a8b5085026589360d26ed97acdd64': (133 commits) target-ppc: Implement correct NaN propagation rules target-mips: Implement correct NaN propagation rules softfloat: use float{32,64,x80,128}_maybe_silence_nan() softfloat: add float{x80,128}_maybe_silence_nan() softfloat: fix float{32,64}_maybe_silence_nan() for MIPS softfloat: rename *IsNaN variables to *IsQuietNaN softfloat: remove HPPA specific code target-ppc: use float32_is_any_nan() target-ppc: fix default qNaN target-ppc: remove PRECISE_EMULATION define microblaze: Use more TB chaining cirrus_vga: fix division by 0 for color expansion rop Fix curses on big endian hosts noaudio: correctly account acquired samples target-arm: Implement correct NaN propagation rules softfloat: abstract out target-specific NaN propagation rules softfloat: Rename float*_is_nan() functions to float*_is_quiet_nan() TCG: Improve tb_phys_hash_func() target-arm: fix UMAAL instruction Fix translation of unary PPC/SPE instructions (efdneg etc.). ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-06softfloat: Implement flushing input denormals to zeroPeter Maydell2-3/+123
Add support to softfloat for flushing input denormal float32 and float64 to zero. softfloat's existing 'flush_to_zero' flag only flushes denormals to zero on output. Some CPUs need input denormals to be flushed before processing as well. Implement this, using a new status flag to enable it and a new exception status bit to indicate when it has happened. Existing CPUs should be unaffected as there is no behaviour change unless the mode is enabled. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-06target-ppc: Implement correct NaN propagation rulesAurelien Jarno1-2/+17
Implement the correct NaN propagation rules for PowerPC targets by providing an appropriate pickNaN function. Also fix the #ifdef tests for default NaN definition, the correct name is TARGET_PPC instead of TARGET_POWERPC. Reviewed-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-06target-mips: Implement correct NaN propagation rulesAurelien Jarno1-0/+27
Implement the correct NaN propagation rules for MIPS targets by providing an appropriate pickNaN function. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-06softfloat: use float{32,64,x80,128}_maybe_silence_nan()Aurelien Jarno1-43/+16
Use float{32,64,x80,128}_maybe_silence_nan() instead of toggling the sNaN bit manually. This allow per target implementation of sNaN to qNaN conversion. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2011-01-06softfloat: add float{x80,128}_maybe_silence_nan()Aurelien Jarno2-0/+48
Add float{x80,128}_maybe_silence_nan() functions, they will be need by propagateFloat{x80,128}NaN(). Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-06softfloat: fix float{32,64}_maybe_silence_nan() for MIPSAurelien Jarno1-6/+14
On targets that define sNaN with the sNaN bit as one, simply clearing this bit may correspond to an infinite value. Convert it to a default NaN if SNAN_BIT_IS_ONE, as it corresponds to the MIPS implementation, the only emulated CPU with SNAN_BIT_IS_ONE. When other CPU of this type are added, this might be updated to include more cases. Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>