]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Move helper functions to guest_s390_helpers.c for consistency with
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 15 Jul 2012 02:25:55 +0000 (02:25 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 15 Jul 2012 02:25:55 +0000 (02:25 +0000)
other frontends.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2434

VEX/priv/guest_s390_defs.h
VEX/priv/guest_s390_helpers.c
VEX/priv/guest_s390_toIR.c

index 01a35bc32ad6d66240ab0648fc654fa6bf712312..e319f315c402ca642f710d12a9411242465f23b3 100644 (file)
@@ -72,7 +72,7 @@ extern VexGuestLayout s390xGuest_layout;
 #define S390X_GUEST_OFFSET(x)  offsetof(VexGuestS390XState, x)
 
 /*------------------------------------------------------------*/
-/*--- Dirty Helper functions.                              ---*/
+/*--- Helper functions.                                    ---*/
 /*------------------------------------------------------------*/
 void s390x_dirtyhelper_00(VexGuestS390XState *guest_state);
 void s390x_dirtyhelper_EX(ULong torun);
@@ -81,6 +81,9 @@ ULong s390x_dirtyhelper_STCKF(ULong *addr);
 ULong s390x_dirtyhelper_STCKE(ULong *addr);
 ULong s390x_dirtyhelper_STFLE(VexGuestS390XState *guest_state, HWord addr);
 
+UInt  s390_do_cvb(ULong decimal);
+ULong s390_do_cvd(ULong binary);
+
 /* The various ways to compute the condition code. */
 enum {
    S390_CC_OP_BITWISE = 0,
index 55dfeecbedddf063404d17fde34670a25daae41e..c898f2725c2b31193e2a73eff2fc048f6a378886 100644 (file)
@@ -339,6 +339,54 @@ s390x_dirtyhelper_STFLE(VexGuestS390XState *guest_state, HWord addr)
 }
 #endif /* VGA_s390x */
 
+
+/*------------------------------------------------------------*/
+/*--- Clean helper for "convert to binary".                ---*/
+/*------------------------------------------------------------*/
+#if defined(VGA_s390x)
+UInt
+s390_do_cvb(ULong decimal)
+{
+   UInt binary;
+
+   __asm__ volatile (
+        "cvb %[result],%[input]\n\t"
+          : [result] "=d"(binary)
+          : [input] "m"(decimal)
+   );
+
+   return binary;
+}
+
+#else
+UInt s390_do_cvb(ULong decimal) { return 0; }
+#endif
+
+
+/*------------------------------------------------------------*/
+/*--- Clean helper for "convert to decimal".                ---*/
+/*------------------------------------------------------------*/
+#if defined(VGA_s390x)
+ULong
+s390_do_cvd(ULong binary_in)
+{
+   UInt binary = binary_in & 0xffffffffULL;
+   ULong decimal;
+
+   __asm__ volatile (
+        "cvd %[input],%[result]\n\t"
+          : [result] "=m"(decimal)
+          : [input] "d"(binary)
+   );
+
+   return decimal;
+}
+
+#else
+ULong s390_do_cvd(ULong binary) { return 0; }
+#endif
+
+
 /*------------------------------------------------------------*/
 /*--- Helper for condition code.                           ---*/
 /*------------------------------------------------------------*/
index 50d948d9fbfddf632080b424621459e5ec112946..2f017e350f69e1aa879201afdd499bc60cae04cd 100644 (file)
@@ -10670,24 +10670,6 @@ s390_irgen_CPSDR(UChar r3, UChar r1, UChar r2)
 }
 
 
-static UInt
-s390_do_cvb(ULong decimal)
-{
-#if defined(VGA_s390x)
-   UInt binary;
-
-   __asm__ volatile (
-        "cvb %[result],%[input]\n\t"
-          : [result] "=d"(binary)
-          : [input] "m"(decimal)
-   );
-
-   return binary;
-#else
-   return 0;
-#endif
-}
-
 static IRExpr *
 s390_call_cvb(IRExpr *in)
 {
@@ -10720,25 +10702,6 @@ s390_irgen_CVBY(UChar r1, IRTemp op2addr)
 }
 
 
-static ULong
-s390_do_cvd(ULong binary_in)
-{
-#if defined(VGA_s390x)
-   UInt binary = binary_in & 0xffffffffULL;
-   ULong decimal;
-
-   __asm__ volatile (
-        "cvd %[input],%[result]\n\t"
-          : [result] "=m"(decimal)
-          : [input] "d"(binary)
-   );
-
-   return decimal;
-#else
-   return 0;
-#endif
-}
-
 static IRExpr *
 s390_call_cvd(IRExpr *in)
 {