|
[Valgrind-developers] vex: r2434: Move helper functions to
guest_s390_helpers.c for consistency with
From: <sv...@va...> - 2012-07-15 02:26:19
|
florian 2012-07-15 03:25:55 +0100 (Sun, 15 Jul 2012)
New Revision: 2434
Log:
Move helper functions to guest_s390_helpers.c for consistency with
other frontends.
Modified files:
trunk/priv/guest_s390_defs.h
trunk/priv/guest_s390_helpers.c
trunk/priv/guest_s390_toIR.c
Modified: trunk/priv/guest_s390_toIR.c (+0 -37)
===================================================================
--- trunk/priv/guest_s390_toIR.c 2012-07-14 15:31:17 +01:00 (rev 2433)
+++ trunk/priv/guest_s390_toIR.c 2012-07-15 03:25:55 +01:00 (rev 2434)
@@ -10670,24 +10670,6 @@
}
-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 @@
}
-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)
{
Modified: trunk/priv/guest_s390_defs.h (+4 -1)
===================================================================
--- trunk/priv/guest_s390_defs.h 2012-07-14 15:31:17 +01:00 (rev 2433)
+++ trunk/priv/guest_s390_defs.h 2012-07-15 03:25:55 +01:00 (rev 2434)
@@ -72,7 +72,7 @@
#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_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,
Modified: trunk/priv/guest_s390_helpers.c (+48 -0)
===================================================================
--- trunk/priv/guest_s390_helpers.c 2012-07-14 15:31:17 +01:00 (rev 2433)
+++ trunk/priv/guest_s390_helpers.c 2012-07-15 03:25:55 +01:00 (rev 2434)
@@ -339,7 +339,55 @@
}
#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. ---*/
/*------------------------------------------------------------*/
|