From: Florian Krohm Date: Thu, 20 Nov 2025 23:06:31 +0000 (+0000) Subject: s390: Code cleanup due to availability of STCKF insn. (BZ 509562) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d254814f3fb48a4da214ad516555505489be8932;p=thirdparty%2Fvalgrind.git s390: Code cleanup due to availability of STCKF insn. (BZ 509562) Remove EmFail_S390X_ecag, s390_host_has_stckf, and VEX_HWCAPS_S390X_STCKF. Update none/tests/s390x/stckf.vgtest and tests/s390x_features.c Part of fixing https://bugs.kde.org/show_bug.cgi?id=509562 --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 7915b2575..7df56428e 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -15792,20 +15792,16 @@ s390_irgen_STCK(IRTemp op2addr) static const HChar * s390_irgen_STCKF(IRTemp op2addr) { - if (! s390_host_has_stckf) { - emulation_failure(EmFail_S390X_stckf); - } else { - IRTemp cc = newTemp(Ity_I64); + IRTemp cc = newTemp(Ity_I64); - IRDirty *d = unsafeIRDirty_1_N(cc, 0, "s390x_dirtyhelper_STCKF", - &s390x_dirtyhelper_STCKF, - mkIRExprVec_1(mkexpr(op2addr))); - d->mFx = Ifx_Write; - d->mAddr = mkexpr(op2addr); - d->mSize = 8; - stmt(IRStmt_Dirty(d)); - s390_cc_set(cc); - } + IRDirty *d = unsafeIRDirty_1_N(cc, 0, "s390x_dirtyhelper_STCKF", + &s390x_dirtyhelper_STCKF, + mkIRExprVec_1(mkexpr(op2addr))); + d->mFx = Ifx_Write; + d->mAddr = mkexpr(op2addr); + d->mSize = 8; + stmt(IRStmt_Dirty(d)); + s390_cc_set(cc); return "stckf"; } diff --git a/VEX/priv/host_s390_defs.h b/VEX/priv/host_s390_defs.h index 3de079e83..fdcc199c6 100644 --- a/VEX/priv/host_s390_defs.h +++ b/VEX/priv/host_s390_defs.h @@ -934,8 +934,6 @@ extern UInt s390_host_hwcaps; (s390_host_hwcaps & (VEX_HWCAPS_S390X_STFLE)) #define s390_host_has_etf3 \ (s390_host_hwcaps & (VEX_HWCAPS_S390X_ETF3)) -#define s390_host_has_stckf \ - (s390_host_hwcaps & (VEX_HWCAPS_S390X_STCKF)) #define s390_host_has_fpext \ (s390_host_hwcaps & (VEX_HWCAPS_S390X_FPEXT)) #define s390_host_has_lsc \ diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c index 6098e3c95..8f3ab8945 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -1551,8 +1551,6 @@ const HChar* LibVEX_EmNote_string ( VexEmNote ew ) " IEEE-invalid-operation exceptions will not be suppressed."; case EmFail_S390X_stfle: return "Instruction stfle is not supported on this host"; - case EmFail_S390X_stckf: - return "Instruction stckf is not supported on this host"; case EmFail_S390X_pfpo: return "Instruction pfpo is not supported on this host"; case EmFail_S390X_DFP_insn: @@ -1933,7 +1931,6 @@ static const HChar* show_hwcaps_s390x ( UInt hwcaps ) { VEX_HWCAPS_S390X_STFLE, "stfle" }, { VEX_HWCAPS_S390X_ETF2, "etf2" }, { VEX_HWCAPS_S390X_ETF3, "etf3" }, - { VEX_HWCAPS_S390X_STCKF, "stckf" }, { VEX_HWCAPS_S390X_FPEXT, "fpext" }, { VEX_HWCAPS_S390X_LSC, "lsc" }, { VEX_HWCAPS_S390X_PFPO, "pfpo" }, diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index 0be6deb82..a1eb48f41 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -170,7 +170,6 @@ typedef #define VEX_HWCAPS_S390X_ETF2 (1<<11) /* ETF2-enhancement facility */ #define VEX_HWCAPS_S390X_STFLE (1<<12) /* STFLE facility */ #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_LSC (1<<16) /* Conditional load/store facility */ #define VEX_HWCAPS_S390X_PFPO (1<<17) /* Perform floating point ops facility */ @@ -195,7 +194,6 @@ typedef VEX_HWCAPS_S390X_DFP | \ VEX_HWCAPS_S390X_FGX | \ VEX_HWCAPS_S390X_STFLE | \ - VEX_HWCAPS_S390X_STCKF | \ VEX_HWCAPS_S390X_FPEXT | \ VEX_HWCAPS_S390X_LSC | \ VEX_HWCAPS_S390X_ETF3 | \ diff --git a/VEX/pub/libvex_emnote.h b/VEX/pub/libvex_emnote.h index 9557663fa..fa6c5bf5c 100644 --- a/VEX/pub/libvex_emnote.h +++ b/VEX/pub/libvex_emnote.h @@ -102,9 +102,6 @@ typedef /* stfle insn is not supported on this host */ EmFail_S390X_stfle, - /* stckf insn is not supported on this host */ - EmFail_S390X_stckf, - /* pfpo insn is not supported on this host */ EmFail_S390X_pfpo, diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c index 1bb6cd120..6729e57c6 100644 --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c @@ -1635,7 +1635,6 @@ Bool VG_(machine_get_hwcaps)( void ) { False, 24, VEX_HWCAPS_S390X_ETF2, "ETF2" }, { False, 7, VEX_HWCAPS_S390X_STFLE, "STFLE" }, { False, 30, VEX_HWCAPS_S390X_ETF3, "ETF3" }, - { False, 25, VEX_HWCAPS_S390X_STCKF, "STCKF" }, { False, 37, VEX_HWCAPS_S390X_FPEXT, "FPEXT" }, { False, 45, VEX_HWCAPS_S390X_LSC, "LSC" }, { False, 44, VEX_HWCAPS_S390X_PFPO, "PFPO" }, diff --git a/none/tests/s390x/stckf.vgtest b/none/tests/s390x/stckf.vgtest index c16fbff19..4d9484182 100644 --- a/none/tests/s390x/stckf.vgtest +++ b/none/tests/s390x/stckf.vgtest @@ -1,2 +1 @@ prog:stckf -prereq: ../../../tests/s390x_features s390x-stckf diff --git a/tests/s390x_features.c b/tests/s390x_features.c index e0d4de76c..625984dbb 100644 --- a/tests/s390x_features.c +++ b/tests/s390x_features.c @@ -250,8 +250,6 @@ static int go(char *feature, char *cpu) match = (facilities[0] & FAC_BIT(18)) && (facilities[0] & FAC_BIT(19)); } else if (strcmp(feature, "s390x-eimm") == 0 ) { match = facilities[0] & FAC_BIT(21); - } else if (strcmp(feature, "s390x-stckf") == 0 ) { - match = facilities[0] & FAC_BIT(25); } else if (strcmp(feature, "s390x-genins") == 0 ) { match = facilities[0] & FAC_BIT(34); } else if (strcmp(feature, "s390x-exrl") == 0 ) {