[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 2.0 05/15] target-ppc: Define Endian-Correct Accessors
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 2.0 05/15] target-ppc: Define Endian-Correct Accessors for VSR Field Access |
Date: |
Tue, 8 Apr 2014 11:31:44 +0200 |
From: Tom Musta <address@hidden>
This change defines accessors for VSR doubleword and word fields that
are correct from a host Endian perspective. This allows code to
use the Power ISA indexing numbers in code.
For example, the xscvdpsxws instruction has a target VSR that looks
like this:
0 32 64 127
+-----------+--------+-----------+-----------+
| undefined | SW | undefined | undefined |
+-----------+--------+-----------+-----------+
VSX helper code will use VsrW(1) to access this field.
Signed-off-by: Tom Musta <address@hidden>
Tested-by: Tom Musta <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/fpu_helper.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target-ppc/fpu_helper.c b/target-ppc/fpu_helper.c
index 691d572..d79aae9 100644
--- a/target-ppc/fpu_helper.c
+++ b/target-ppc/fpu_helper.c
@@ -1782,6 +1782,14 @@ typedef union _ppc_vsr_t {
float64 f64[2];
} ppc_vsr_t;
+#if defined(HOST_WORDS_BIGENDIAN)
+#define VsrW(i) u32[i]
+#define VsrD(i) u64[i]
+#else
+#define VsrW(i) u32[3-(i)]
+#define VsrD(i) u64[1-(i)]
+#endif
+
static void getVSR(int n, ppc_vsr_t *vsr, CPUPPCState *env)
{
if (n < 32) {
--
1.8.1.4
- [Qemu-ppc] [PULL 2.0 00/15] ppc patch queue 2014-04-08 for 2.0, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 05/15] target-ppc: Define Endian-Correct Accessors for VSR Field Access,
Alexander Graf <=
- [Qemu-ppc] [PULL 2.0 01/15] PPC: E500: Set PIR default reset value rather than SPR value, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 03/15] softfloat: Introduce float32_to_uint64_round_to_zero, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 09/15] target-ppc: Correct VSX FP to FP Conversions, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 06/15] target-ppc: Correct LE Host Inversion of Lower VSRs, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 10/15] target-ppc: Correct VSX FP to Integer Conversion, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 07/15] target-ppc: Correct Simple VSR LE Host Inversions, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 12/15] PPC: Clean up DECR implementation, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 13/15] PPC: Only enter MSR_POW when no interrupts pending, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 08/15] target-ppc: Correct VSX Scalar Compares, Alexander Graf, 2014/04/08
- [Qemu-ppc] [PULL 2.0 11/15] target-ppc: Correct VSX Integer to FP Conversion, Alexander Graf, 2014/04/08