]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added LibVEX_GuestPPC32_put_cr7(), LibVEX_GuestPPC32_put_cr()
authorCerion Armour-Brown <cerion@valgrind.org>
Fri, 8 Jul 2005 13:34:47 +0000 (13:34 +0000)
committerCerion Armour-Brown <cerion@valgrind.org>
Fri, 8 Jul 2005 13:34:47 +0000 (13:34 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1269

VEX/priv/guest-ppc32/ghelpers.c
VEX/pub/libvex_guest_ppc32.h

index 6d434e6b9e8bf3a60d4087908c6ca7bb17a444a5..259271d0bfd73244d321ff180e409554da8cc9c8 100644 (file)
@@ -191,13 +191,21 @@ IRExpr* guest_ppc32_spechelper ( HChar* function_name,
 /*----------------------------------------------*/
 
 /* VISIBLE TO LIBVEX CLIENT */
-#if 0
-void LibVEX_GuestPPC32_put_cr7 ( UInt flags_native,
+void LibVEX_GuestPPC32_put_cr7 ( UInt cr7_native,
                                  /*OUT*/VexGuestPPC32State* vex_state )
 {
-   vassert(0); // FIXME
+  vex_state->guest_CC_OP   = 1;   /* => use immediate value DEP1 */
+  vex_state->guest_CC_DEP1 = (cr7_native & 0xF0000000);
+  vex_state->guest_CC_DEP2 = 0;   /* =unused */
+}
+
+/* VISIBLE TO LIBVEX CLIENT */
+void LibVEX_GuestPPC32_put_cr ( UInt cr_native,
+                                /*OUT*/VexGuestPPC32State* vex_state )
+{
+  LibVEX_GuestPPC32_put_cr7( cr_native, vex_state );
+  vex_state->guest_CR0to6 = (cr_native & 0x0FFFFFFF);
 }
-#endif
 
 /* VISIBLE TO LIBVEX CLIENT */
 UInt LibVEX_GuestPPC32_get_cr7 ( /*IN*/VexGuestPPC32State* vex_state )
index b1e6890a1c049910c86c4b5a478276aa43973be6..37f25989707f7f1cf8064e72f997b19cb2e5d050 100644 (file)
@@ -195,6 +195,17 @@ typedef
 extern
 void LibVEX_GuestPPC32_initialise ( /*OUT*/VexGuestPPC32State* vex_state );
 
+/* Write the given native %cr7 value to the supplied
+   VexGuestPPC32State structure */
+extern
+void LibVEX_GuestPPC32_put_cr7 ( UInt cr7_native,
+                                 /*OUT*/VexGuestPPC32State* vex_state );
+
+/* Ditto, but for entire %cr */
+extern
+void LibVEX_GuestPPC32_put_cr ( UInt cr_native,
+                                /*OUT*/VexGuestPPC32State* vex_state );
+
 /* Extract from the supplied VexGuestPPC32State structure the
    corresponding native %cr7 value. */
 extern