From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSuiE-0006wc-6d for qemu-devel@nongnu.org; Wed, 26 Mar 2014 16:46:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSui8-0006Cx-37 for qemu-devel@nongnu.org; Wed, 26 Mar 2014 16:46:14 -0400 From: Tom Musta Date: Wed, 26 Mar 2014 15:45:45 -0500 Message-Id: <1395866754-18673-1-git-send-email-tommusta@gmail.com> Subject: [Qemu-devel] [PATCH 0/9] target-ppc: VSX Bug Fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Tom Musta , qemu-ppc@nongnu.org This patch series addresses bugs in the recently added VSX instructions. Two general defects are fixed: (1) The VSX Convert to Integer instructions truncate the source floating point number to an integer value and hence should use a round-to-zero rounding algorithm. The existing implementation erroneously uses the rounding mode as set by the FPSCR. This patch was previously published separately (see discussion at http://lists.nongnu.org/archive/html/qemu-devel/2014-03/msg04526.html). (2) There is a pervasive problem with the VSX helpers on Little Endian hosts. The bug can be seen when using a mixture of VSRs in the upper and lower regions of VSR (i.e. a mixture of VSR 0-31, which overlay the Floating Point register array, and VSR 32-64 which overlay the Altivec AVR array). This patch series introduces VSR field accessors that are consistent with the Power ISA notation irrespective of host endianness. The VSX instruction macros are updated to use these accessors. For example, the Power ISA has pictures like this, describing a VSR: 0 32 64 96 127 +----------+----------+----------+----------+ | .word[0] | .word[1] | .word[2] | .word[3] | +----------+----------+----------+----------+ The updated code will now refer to .word[0] as v->VsrW(0), .word[1] as v->VsrW(1), and so on. This change makes the code correct and also more consistent with the ISA document. Tom Musta (9): softfloat: Introduce float32_to_uint64_round_to_zero target-ppc: Bug: VSX Convert to Integer Should Truncate target-ppc: Define Endian-Correct Accessors for VSR Field Acess target-ppc: Correct LE Host Inversion of Lower VSRs target-ppc: Correct Simple VSR LE Host Inversions target-ppc: Correct VSX Scalar Compares target-ppc: Correct VSX FP to FP Conversions target-ppc: Correct VSX FP to Integer Conversion target-ppc: Correct VSX Integer to FP Conversion fpu/softfloat.c | 54 +++++ include/fpu/softfloat.h | 1 + target-ppc/fpu_helper.c | 494 +++++++++++++++++++++++------------------------ 3 files changed, 298 insertions(+), 251 deletions(-)