From: Florian Krohm Date: Thu, 27 Nov 2025 21:21:59 +0000 (+0000) Subject: s390: Tidy and a bit of constification X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c13a414625d14a3146bfc54d795c4e09dcbf162f;p=thirdparty%2Fvalgrind.git s390: Tidy and a bit of constification --- diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 96c566823..063ede22a 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -322,7 +322,8 @@ is_virtual_gpr(HReg reg) /* Helper function for all vector operations */ static UChar -s390_getM_from_size(const UChar size) { +s390_getM_from_size(const UChar size) +{ switch(size) { case 1: return 0; @@ -342,7 +343,8 @@ s390_getM_from_size(const UChar size) { /* Helper for generating RXB field in vector instructions */ static UChar -s390_update_rxb(const UChar rxb, const UChar index, UChar* vr) { +s390_update_rxb(const UChar rxb, const UChar index, UChar* vr) +{ vassert((index >= 1) && (index <= 4)); UChar result = rxb; if(vr != NULL) { @@ -684,7 +686,8 @@ no_match: return NULL; } -s390_insn* genMove_S390(HReg from, HReg to, Bool mode64) +s390_insn * +genMove_S390(HReg from, HReg to, Bool mode64) { switch (hregClass(from)) { case HRcInt64: @@ -6822,7 +6825,7 @@ s390_insn_profinc(void) s390_insn * s390_insn_vec_amodeop(UChar size, s390_vec_amodeop_t tag, HReg dst, HReg op1, - s390_amode *op2) + s390_amode *op2) { s390_insn *insn = LibVEX_Alloc_inline(sizeof(s390_insn)); @@ -6838,8 +6841,9 @@ s390_insn_vec_amodeop(UChar size, s390_vec_amodeop_t tag, HReg dst, HReg op1, return insn; } -s390_insn *s390_insn_vec_amodeintop(UChar size, s390_vec_amodeintop_t tag, HReg dst, - s390_amode* op2, HReg op3) +s390_insn * +s390_insn_vec_amodeintop(UChar size, s390_vec_amodeintop_t tag, HReg dst, + s390_amode* op2, HReg op3) { s390_insn *insn = LibVEX_Alloc_inline(sizeof(s390_insn)); @@ -6855,8 +6859,9 @@ s390_insn *s390_insn_vec_amodeintop(UChar size, s390_vec_amodeintop_t tag, HReg return insn; } -s390_insn *s390_insn_vec_binop(UChar size, s390_vec_binop_t tag, HReg dst, - HReg op1, HReg op2) +s390_insn * +s390_insn_vec_binop(UChar size, s390_vec_binop_t tag, HReg dst, + HReg op1, HReg op2) { s390_insn *insn = LibVEX_Alloc_inline(sizeof(s390_insn)); @@ -6872,8 +6877,9 @@ s390_insn *s390_insn_vec_binop(UChar size, s390_vec_binop_t tag, HReg dst, return insn; } -s390_insn *s390_insn_vec_triop(UChar size, s390_vec_triop_t tag, HReg dst, - HReg op1, HReg op2, HReg op3) +s390_insn * +s390_insn_vec_triop(UChar size, s390_vec_triop_t tag, HReg dst, + HReg op1, HReg op2, HReg op3) { s390_insn *insn = LibVEX_Alloc_inline(sizeof(s390_insn)); @@ -6889,8 +6895,8 @@ s390_insn *s390_insn_vec_triop(UChar size, s390_vec_triop_t tag, HReg dst, return insn; } -s390_insn *s390_insn_vec_replicate(UChar size, HReg dst, HReg op1, - UChar idx) +s390_insn * +s390_insn_vec_replicate(UChar size, HReg dst, HReg op1, UChar idx) { s390_insn *insn = LibVEX_Alloc_inline(sizeof(s390_insn)); diff --git a/VEX/priv/host_s390_defs.h b/VEX/priv/host_s390_defs.h index f089eac9a..48ea79f18 100644 --- a/VEX/priv/host_s390_defs.h +++ b/VEX/priv/host_s390_defs.h @@ -890,8 +890,8 @@ Int emit_S390Instr ( Bool *, UChar *, Int, const s390_insn *, Bool, const RRegUniverse *getRRegUniverse_S390( void ); void genSpill_S390 ( HInstr **, HInstr **, HReg , Int , Bool ); void genReload_S390 ( HInstr **, HInstr **, HReg , Int , Bool ); -HInstr* directReload_S390 ( HInstr *, HReg, Short ); -extern s390_insn* genMove_S390(HReg from, HReg to, Bool mode64); +HInstr *directReload_S390 ( HInstr *, HReg, Short ); +s390_insn *genMove_S390 ( HReg from, HReg to, Bool mode64); HInstrArray *iselSB_S390 ( const IRSB *, VexArch, const VexArchInfo *, const VexAbiInfo *, Int, Int, Bool, Bool, Addr); diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c index 01a50c9b2..860ce1f9d 100644 --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c @@ -602,7 +602,7 @@ static UInt VG_(get_machine_model)(void) { static struct model_map { const HChar name[5]; - UInt id; + const UInt id; } model_map[] = { { "2064", VEX_S390X_MODEL_Z900 }, { "2066", VEX_S390X_MODEL_Z800 }, @@ -1561,9 +1561,9 @@ Bool VG_(machine_get_hwcaps)( void ) /* Detect presence of certain facilities using the STFLE insn. */ struct fac_hwcaps_map { UInt installed; - UInt facility_bit; - UInt hwcaps_bit; - const HChar name[6]; // may need adjustment for new facility names + const UInt facility_bit; + const UInt hwcaps_bit; + const HChar name[5]; // may need adjustment for new facility names } fac_hwcaps[] = { { False, 129, VEX_HWCAPS_S390X_VX, "VX" }, { False, 57, VEX_HWCAPS_S390X_MSA5, "MSA5" },