[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [V2 PATCH 3/9] target-ppc: Define Endian-Correct Accessors
From: |
Tom Musta |
Subject: |
[Qemu-devel] [V2 PATCH 3/9] target-ppc: Define Endian-Correct Accessors for VSR Field Acess |
Date: |
Mon, 31 Mar 2014 16:03:57 -0500 |
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>
---
target-ppc/fpu_helper.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
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.7.1
- [Qemu-devel] [V2 PATCH 0/9] target-ppc: VSX Bug Fixes, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 1/9] softfloat: Introduce float32_to_uint64_round_to_zero, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 2/9] target-ppc: Bug: VSX Convert to Integer Should Truncate, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 3/9] target-ppc: Define Endian-Correct Accessors for VSR Field Acess,
Tom Musta <=
- [Qemu-devel] [V2 PATCH 4/9] target-ppc: Correct LE Host Inversion of Lower VSRs, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 5/9] target-ppc: Correct Simple VSR LE Host Inversions, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 6/9] target-ppc: Correct VSX Scalar Compares, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 8/9] target-ppc: Correct VSX FP to Integer Conversion, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 9/9] target-ppc: Correct VSX Integer to FP Conversion, Tom Musta, 2014/03/31
- [Qemu-devel] [V2 PATCH 7/9] target-ppc: Correct VSX FP to FP Conversions, Tom Musta, 2014/03/31