Changed naming convention from 'PPC32' to 'PPC' for all VEX code common to both PPC32 and PPC64.
And tidied up a fair bit while i was at it.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1504 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/guest-ppc32/ghelpers.c b/priv/guest-ppc32/ghelpers.c
index a32bdc1..3e3653b 100644
--- a/priv/guest-ppc32/ghelpers.c
+++ b/priv/guest-ppc32/ghelpers.c
@@ -76,7 +76,7 @@
/* DIRTY HELPER (non-referentially-transparent) */
/* Horrible hack. On non-ppc32 platforms, return 1. */
/* Reads a complete, consistent 64-bit TB value. */
-ULong ppc32g_dirtyhelper_MFTB ( void )
+ULong ppcg_dirtyhelper_MFTB ( void )
{
# if defined(__powerpc__)
ULong res;
@@ -128,6 +128,35 @@
(*pU128_dst)[3] = (*pU128_src)[3];
}
+/* CALLED FROM GENERATED CODE */
+/* DIRTY HELPER (reads guest state, writes guest mem) */
+void ppc64g_dirtyhelper_LVS ( VexGuestPPC64State* gst,
+ UInt vD_off, UInt sh, UInt shift_right )
+{
+ static
+ UChar ref[32] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F };
+ U128* pU128_src;
+ U128* pU128_dst;
+
+ vassert( vD_off <= sizeof(VexGuestPPC64State)-8 );
+ vassert( sh <= 15 );
+ vassert( shift_right <= 1 );
+ if (shift_right)
+ sh = 16-sh;
+ /* else shift left */
+
+ pU128_src = (U128*)&ref[sh];
+ pU128_dst = (U128*)( ((UChar*)gst) + vD_off );
+
+ (*pU128_dst)[0] = (*pU128_src)[0];
+ (*pU128_dst)[1] = (*pU128_src)[1];
+ (*pU128_dst)[2] = (*pU128_src)[2];
+ (*pU128_dst)[3] = (*pU128_src)[3];
+}
+
/* Helper-function specialiser. */
@@ -411,7 +440,7 @@
vex_state->guest_CR7_321 = 0;
vex_state->guest_CR7_0 = 0;
- vex_state->guest_FPROUND = (UInt)PPC32rm_NEAREST;
+ vex_state->guest_FPROUND = (UInt)PPCrm_NEAREST;
vex_state->guest_VRSAVE = 0;
@@ -559,7 +588,7 @@
vex_state->guest_CR7_321 = 0;
vex_state->guest_CR7_0 = 0;
- vex_state->guest_FPROUND = (UInt)PPC32rm_NEAREST;
+ vex_state->guest_FPROUND = (UInt)PPCrm_NEAREST;
vex_state->guest_VRSAVE = 0;