qemu-patch-raspberry4/target-arm
Peter Crosthwaite 33bbd75a7c arm: translate.c: Fix smlald Instruction
The smlald (and probably smlsld) instruction was doing incorrect sign
extensions of the operands amongst 64bit result calculation. The
instruction psuedo-code is:

 operand2 = if m_swap then ROR(R[m],16) else R[m];
 product1 = SInt(R[n]<15:0>) * SInt(operand2<15:0>);
 product2 = SInt(R[n]<31:16>) * SInt(operand2<31:16>);
 result = product1 + product2 + SInt(R[dHi]:R[dLo]);
 R[dHi] = result<63:32>;
 R[dLo] = result<31:0>;

The result calculation should be done in 64 bit arithmetic, and hence
product1 and product2 should be sign extended to 64b before calculation.

The current implementation was adding product1 and product2 together
then sign-extending the intermediate result leading to false negatives.

E.G. if product1 = product2 = 0x4000000, their sum = 0x80000000, which
will be incorrectly interpreted as -ve on sign extension.

We fix by doing the 64b extensions on both product1 and product2 before
any addition/subtraction happens.

We also fix where we were possibly incorrectly setting the Q saturation
flag for SMLSLD, which the ARM ARM specifically says is not set.

Reported-by: Christina Smith <christina.smith@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 2cddb6f5a15be4ab8d2160f3499d128ae93d304d.1397704570.git.peter.crosthwaite@xilinx.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-04-17 21:34:07 +01:00
..
arm-semi.c cpu: Move opaque field from CPU_COMMON to CPUState 2014-03-13 19:20:47 +01:00
cpu-qom.h target-arm: Dump 32-bit CPU state if 64 bit CPU is in AArch32 2014-04-17 21:34:06 +01:00
cpu.c target-arm: Make Cortex-A15 CBAR read-only 2014-04-17 21:34:06 +01:00
cpu.h target-arm: Implement CBAR for Cortex-A57 2014-04-17 21:34:06 +01:00
cpu64.c target-arm: Dump 32-bit CPU state if 64 bit CPU is in AArch32 2014-04-17 21:34:06 +01:00
crypto_helper.c target-arm: add support for v8 AES instructions 2013-12-17 19:42:25 +00:00
gdbstub.c cpu: Introduce CPUClass::gdb_{read,write}_register() 2013-07-27 00:04:17 +02:00
gdbstub64.c target-arm/gdbstub64.c: remove useless 'break' statement. 2014-04-17 21:34:06 +01:00
helper-a64.c target-arm: Implement AArch64 EL1 exception handling 2014-04-17 21:34:04 +01:00
helper-a64.h target-arm: A64: Implement FCVTXN 2014-03-17 16:31:53 +00:00
helper.c target-arm: Implement CBAR for Cortex-A57 2014-04-17 21:34:06 +01:00
helper.h target-arm: Implement AArch64 EL1 exception handling 2014-04-17 21:34:04 +01:00
internals.h target-arm: Move arm_log_exception() into internals.h 2014-04-17 21:34:04 +01:00
iwmmxt_helper.c misc: Use new rotate functions 2013-09-25 21:23:05 +02:00
kvm-consts.h target-arm/kvm-consts.h: Define QEMU constants for known KVM CPUs 2014-02-20 10:35:50 +00:00
kvm-stub.c target-arm: Initialize cpreg list from KVM when using KVM 2013-06-25 18:16:10 +01:00
kvm.c arm: vgic device control api support 2014-02-26 17:20:00 +00:00
kvm32.c target-arm: Implement AArch64 SPSR_EL1 2014-04-17 21:34:04 +01:00
kvm64.c target-arm: Implement AArch64 SPSR_EL1 2014-04-17 21:34:04 +01:00
kvm_arm.h arm: vgic device control api support 2014-02-26 17:20:00 +00:00
machine.c target-arm: Implement AArch64 SPSR_EL1 2014-04-17 21:34:04 +01:00
Makefile.objs target-arm: A64: add stubs for a64 specific helpers 2013-12-17 19:42:32 +00:00
neon_helper.c target-arm: A64: Add saturating accumulate ops (USQADD/SUQADD) 2014-03-18 23:10:06 +00:00
op_addsub.h Correct spelling of licensed 2011-07-23 11:26:12 -05:00
op_helper.c target-arm: Implement AArch64 EL1 exception handling 2014-04-17 21:34:04 +01:00
translate-a64.c target-arm: Implement AArch64 EL1 exception handling 2014-04-17 21:34:04 +01:00
translate.c arm: translate.c: Fix smlald Instruction 2014-04-17 21:34:07 +01:00
translate.h target-arm: Dump 32-bit CPU state if 64 bit CPU is in AArch32 2014-04-17 21:34:06 +01:00