Move definition of facility bits to libvex_s390x_common.h so we
can use them in m_machine.c. Rename LSCOND facility to LSC.
git-svn-id: svn://svn.valgrind.org/vex/trunk@2585 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/guest_s390_helpers.c b/priv/guest_s390_helpers.c
index 1b56e18..891ee88 100644
--- a/priv/guest_s390_helpers.c
+++ b/priv/guest_s390_helpers.c
@@ -333,30 +333,6 @@
for (i = 0; i < num_dw; ++i)
addr[i] = hoststfle[i];
- /* Enumerators for interesting facilities. The value of the enumerator
- is the number of the facility bit as per POP. */
- enum {
- S390_FAC_MSA = 17, // message-security-assist
- S390_FAC_LDISP = 18, // long displacement
- S390_FAC_HFPMAS = 20, // HFP multiply-and-add-subtract
- S390_FAC_EIMM = 21, // extended immediate
- S390_FAC_HFPUNX = 23, // HFP unnormalized extension
- S390_FAC_ETF2 = 24, // ETF2-enhancement
- S390_FAC_PENH = 26, // parsing-enhancement
- S390_FAC_ETF3 = 30, // ETF3-enhancement
- S390_FAC_XCPUT = 31, // extract-CPU-time
- S390_FAC_GIE = 34, // general insn extension
- S390_FAC_EXEXT = 35, // execute extension
- S390_FAC_DFP = 42, // decimal floating point
- S390_FAC_PFPO = 44, // perform floating point operation insn
- S390_FAC_HIGHW = 45, // high-word extension
- S390_FAC_DFPZC = 48, // DFP zoned-conversion
- S390_FAC_MISC = 49, // miscellaneous insn
- S390_FAC_CTREXE = 50, // constrained transactional execution
- S390_FAC_TREXE = 73, // transactional execution
- S390_FAC_MSA4 = 77 // message-security-assist 4
- };
-
/* Now adjust the VM facilities according to what the VM supports */
s390_set_facility_bit(addr, S390_FAC_LDISP, 1);
s390_set_facility_bit(addr, S390_FAC_EIMM, 1);
diff --git a/priv/host_s390_defs.c b/priv/host_s390_defs.c
index dde2589..ef79095 100644
--- a/priv/host_s390_defs.c
+++ b/priv/host_s390_defs.c
@@ -3939,7 +3939,7 @@
static UChar *
s390_emit_LOCGR(UChar *p, UChar m3, UChar r1, UChar r2)
{
- vassert(s390_host_has_lscond);
+ vassert(s390_host_has_lsc);
if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) {
s390_disasm(ENC4(MNM, GPR, GPR, UINT), "locgr", r1, r2, m3);
}
@@ -7435,7 +7435,7 @@
p = buf;
- if (s390_host_has_lscond) {
+ if (s390_host_has_lsc) {
/* LOCx is not the preferred way to implement an unconditional load. */
if (cond != S390_CC_ALWAYS) goto use_branch_insn;
diff --git a/priv/host_s390_defs.h b/priv/host_s390_defs.h
index c3aacde..2a24d5c 100644
--- a/priv/host_s390_defs.h
+++ b/priv/host_s390_defs.h
@@ -694,8 +694,8 @@
(s390_host_hwcaps & (VEX_HWCAPS_S390X_STCKF))
#define s390_host_has_fpext \
(s390_host_hwcaps & (VEX_HWCAPS_S390X_FPEXT))
-#define s390_host_has_lscond \
- (s390_host_hwcaps & (VEX_HWCAPS_S390X_LSCOND))
+#define s390_host_has_lsc \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_LSC))
#endif /* ndef __VEX_HOST_S390_DEFS_H */
diff --git a/priv/main_main.c b/priv/main_main.c
index f408662..b295bea 100644
--- a/priv/main_main.c
+++ b/priv/main_main.c
@@ -1302,7 +1302,7 @@
p = p + vex_sprintf(p, "-%s", facilities[8]);
if (hwcaps & VEX_HWCAPS_S390X_FPEXT)
p = p + vex_sprintf(p, "-%s", facilities[9]);
- if (hwcaps & VEX_HWCAPS_S390X_LSCOND)
+ if (hwcaps & VEX_HWCAPS_S390X_LSC)
p = p + vex_sprintf(p, "-%s", facilities[10]);
/* If there are no facilities, add "zarch" */
diff --git a/pub/libvex.h b/pub/libvex.h
index 8e096cd..672a98a 100644
--- a/pub/libvex.h
+++ b/pub/libvex.h
@@ -133,7 +133,7 @@
#define VEX_HWCAPS_S390X_ETF3 (1<<13) /* ETF3-enhancement facility */
#define VEX_HWCAPS_S390X_STCKF (1<<14) /* STCKF facility */
#define VEX_HWCAPS_S390X_FPEXT (1<<15) /* Floating point extension facility */
-#define VEX_HWCAPS_S390X_LSCOND (1<<16) /* Conditional load/store facility */
+#define VEX_HWCAPS_S390X_LSC (1<<16) /* Conditional load/store facility */
/* Special value representing all available s390x hwcaps */
#define VEX_HWCAPS_S390X_ALL (VEX_HWCAPS_S390X_LDISP | \
@@ -144,7 +144,7 @@
VEX_HWCAPS_S390X_STFLE | \
VEX_HWCAPS_S390X_STCKF | \
VEX_HWCAPS_S390X_FPEXT | \
- VEX_HWCAPS_S390X_LSCOND| \
+ VEX_HWCAPS_S390X_LSC | \
VEX_HWCAPS_S390X_ETF3 | \
VEX_HWCAPS_S390X_ETF2)
diff --git a/pub/libvex_s390x_common.h b/pub/libvex_s390x_common.h
index 332cca5..0a8f442 100644
--- a/pub/libvex_s390x_common.h
+++ b/pub/libvex_s390x_common.h
@@ -75,6 +75,36 @@
/*--------------------------------------------------------------*/
+/*--- Facility bits ---*/
+/*--------------------------------------------------------------*/
+
+/* The value of the macro is the number of the facility bit as per POP. */
+#define S390_FAC_MSA 17 // message-security-assist
+#define S390_FAC_LDISP 18 // long displacement
+#define S390_FAC_HFPMAS 20 // HFP multiply-and-add-subtract
+#define S390_FAC_EIMM 21 // extended immediate
+#define S390_FAC_HFPUNX 23 // HFP unnormalized extension
+#define S390_FAC_ETF2 24 // ETF2-enhancement
+#define S390_FAC_STCKF 25 // store clock fast insn
+#define S390_FAC_PENH 26 // parsing-enhancement
+#define S390_FAC_ETF3 30 // ETF3-enhancement
+#define S390_FAC_XCPUT 31 // extract-CPU-time
+#define S390_FAC_GIE 34 // general insn extension
+#define S390_FAC_EXEXT 35 // execute extension
+#define S390_FAC_FPEXT 37 // floating-point extension
+#define S390_FAC_FPSE 41 // floating-point support enhancement
+#define S390_FAC_DFP 42 // decimal floating point
+#define S390_FAC_PFPO 44 // perform floating point operation insn
+#define S390_FAC_HIGHW 45 // high-word extension
+#define S390_FAC_LSC 45 // load/store on condition
+#define S390_FAC_DFPZC 48 // DFP zoned-conversion
+#define S390_FAC_MISC 49 // miscellaneous insn
+#define S390_FAC_CTREXE 50 // constrained transactional execution
+#define S390_FAC_TREXE 73 // transactional execution
+#define S390_FAC_MSA4 77 // message-security-assist 4
+
+
+/*--------------------------------------------------------------*/
/*--- Miscellaneous ---*/
/*--------------------------------------------------------------*/