From: Florian Krohm Date: Sun, 9 Dec 2012 17:26:32 +0000 (+0000) Subject: Move definition of facility bits to libvex_s390x_common.h so we X-Git-Tag: svn/VALGRIND_3_9_0^2~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68226b5182b7028b730e3e697f1188f58d0fa77b;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/VEX/priv/guest_s390_helpers.c b/VEX/priv/guest_s390_helpers.c index 1b56e1826a..891ee88c1e 100644 --- a/VEX/priv/guest_s390_helpers.c +++ b/VEX/priv/guest_s390_helpers.c @@ -333,30 +333,6 @@ s390x_dirtyhelper_STFLE(VexGuestS390XState *guest_state, ULong *addr) 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/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index dde258934d..ef790955f6 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -3939,7 +3939,7 @@ s390_emit_SDTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) 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 @@ s390_insn_cond_move_emit(UChar *buf, const s390_insn *insn) 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/VEX/priv/host_s390_defs.h b/VEX/priv/host_s390_defs.h index c3aacde07e..2a24d5c5a3 100644 --- a/VEX/priv/host_s390_defs.h +++ b/VEX/priv/host_s390_defs.h @@ -694,8 +694,8 @@ extern UInt s390_host_hwcaps; (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/VEX/priv/main_main.c b/VEX/priv/main_main.c index f4086627a1..b295bea889 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -1302,7 +1302,7 @@ static const HChar* show_hwcaps_s390x ( UInt hwcaps ) 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/VEX/pub/libvex.h b/VEX/pub/libvex.h index 8e096cd67d..672a98a7d6 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -133,7 +133,7 @@ typedef #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 @@ typedef 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/VEX/pub/libvex_s390x_common.h b/VEX/pub/libvex_s390x_common.h index 332cca5ff6..0a8f44297d 100644 --- a/VEX/pub/libvex_s390x_common.h +++ b/VEX/pub/libvex_s390x_common.h @@ -74,6 +74,36 @@ #define S390_INNERLOOP_FRAME_SIZE ((8+2+2)*8 + 160) +/*--------------------------------------------------------------*/ +/*--- 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 ---*/ /*--------------------------------------------------------------*/