From nobody Sun Feb 8 08:43:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502961869659906.2303753967459; Thu, 17 Aug 2017 02:24:29 -0700 (PDT) Received: from localhost ([::1]:40717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diH2S-0008GF-Cp for importer@patchew.org; Thu, 17 Aug 2017 05:24:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diH0b-0006Nd-Fl for qemu-devel@nongnu.org; Thu, 17 Aug 2017 05:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diH0a-0000Ax-8C for qemu-devel@nongnu.org; Thu, 17 Aug 2017 05:22:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39462) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diH0Z-0000AD-Up for qemu-devel@nongnu.org; Thu, 17 Aug 2017 05:22:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBB2E2E95AF; Thu, 17 Aug 2017 09:22:30 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-43.ams2.redhat.com [10.36.117.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B75F5C7C1; Thu, 17 Aug 2017 09:22:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EBB2E2E95AF Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=david@redhat.com From: David Hildenbrand To: qemu-devel@nongnu.org Date: Thu, 17 Aug 2017 11:22:16 +0200 Message-Id: <20170817092225.4264-2-david@redhat.com> In-Reply-To: <20170817092225.4264-1-david@redhat.com> References: <20170817092225.4264-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 17 Aug 2017 09:22:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 for-2.11 01/10] target/s390x: move cc_name() to cc_helper.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, cohuck@redhat.com, borntraeger@de.ibm.com, Aurelien Jarno , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" While at it, move the translations into the function. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- target/s390x/cc_helper.c | 48 ++++++++++++++++++++++++++++++++++++++++++++= ++++ target/s390x/cpu.h | 48 +-------------------------------------------= ---- 2 files changed, 49 insertions(+), 47 deletions(-) diff --git a/target/s390x/cc_helper.c b/target/s390x/cc_helper.c index 1cf8551..a4562e5 100644 --- a/target/s390x/cc_helper.c +++ b/target/s390x/cc_helper.c @@ -31,6 +31,54 @@ #define HELPER_LOG(x...) #endif =20 +const char *cc_name(int cc_op) +{ + static const char *cc_names[] =3D { + [CC_OP_CONST0] =3D "CC_OP_CONST0", + [CC_OP_CONST1] =3D "CC_OP_CONST1", + [CC_OP_CONST2] =3D "CC_OP_CONST2", + [CC_OP_CONST3] =3D "CC_OP_CONST3", + [CC_OP_DYNAMIC] =3D "CC_OP_DYNAMIC", + [CC_OP_STATIC] =3D "CC_OP_STATIC", + [CC_OP_NZ] =3D "CC_OP_NZ", + [CC_OP_LTGT_32] =3D "CC_OP_LTGT_32", + [CC_OP_LTGT_64] =3D "CC_OP_LTGT_64", + [CC_OP_LTUGTU_32] =3D "CC_OP_LTUGTU_32", + [CC_OP_LTUGTU_64] =3D "CC_OP_LTUGTU_64", + [CC_OP_LTGT0_32] =3D "CC_OP_LTGT0_32", + [CC_OP_LTGT0_64] =3D "CC_OP_LTGT0_64", + [CC_OP_ADD_64] =3D "CC_OP_ADD_64", + [CC_OP_ADDU_64] =3D "CC_OP_ADDU_64", + [CC_OP_ADDC_64] =3D "CC_OP_ADDC_64", + [CC_OP_SUB_64] =3D "CC_OP_SUB_64", + [CC_OP_SUBU_64] =3D "CC_OP_SUBU_64", + [CC_OP_SUBB_64] =3D "CC_OP_SUBB_64", + [CC_OP_ABS_64] =3D "CC_OP_ABS_64", + [CC_OP_NABS_64] =3D "CC_OP_NABS_64", + [CC_OP_ADD_32] =3D "CC_OP_ADD_32", + [CC_OP_ADDU_32] =3D "CC_OP_ADDU_32", + [CC_OP_ADDC_32] =3D "CC_OP_ADDC_32", + [CC_OP_SUB_32] =3D "CC_OP_SUB_32", + [CC_OP_SUBU_32] =3D "CC_OP_SUBU_32", + [CC_OP_SUBB_32] =3D "CC_OP_SUBB_32", + [CC_OP_ABS_32] =3D "CC_OP_ABS_32", + [CC_OP_NABS_32] =3D "CC_OP_NABS_32", + [CC_OP_COMP_32] =3D "CC_OP_COMP_32", + [CC_OP_COMP_64] =3D "CC_OP_COMP_64", + [CC_OP_TM_32] =3D "CC_OP_TM_32", + [CC_OP_TM_64] =3D "CC_OP_TM_64", + [CC_OP_NZ_F32] =3D "CC_OP_NZ_F32", + [CC_OP_NZ_F64] =3D "CC_OP_NZ_F64", + [CC_OP_NZ_F128] =3D "CC_OP_NZ_F128", + [CC_OP_ICM] =3D "CC_OP_ICM", + [CC_OP_SLA_32] =3D "CC_OP_SLA_32", + [CC_OP_SLA_64] =3D "CC_OP_SLA_64", + [CC_OP_FLOGR] =3D "CC_OP_FLOGR", + }; + + return cc_names[cc_op]; +} + static uint32_t cc_calc_ltgt_32(int32_t src, int32_t dst) { if (src =3D=3D dst) { diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 29fdd5d..3e798ef 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -744,53 +744,7 @@ enum cc_op { CC_OP_MAX }; =20 -static const char *cc_names[] =3D { - [CC_OP_CONST0] =3D "CC_OP_CONST0", - [CC_OP_CONST1] =3D "CC_OP_CONST1", - [CC_OP_CONST2] =3D "CC_OP_CONST2", - [CC_OP_CONST3] =3D "CC_OP_CONST3", - [CC_OP_DYNAMIC] =3D "CC_OP_DYNAMIC", - [CC_OP_STATIC] =3D "CC_OP_STATIC", - [CC_OP_NZ] =3D "CC_OP_NZ", - [CC_OP_LTGT_32] =3D "CC_OP_LTGT_32", - [CC_OP_LTGT_64] =3D "CC_OP_LTGT_64", - [CC_OP_LTUGTU_32] =3D "CC_OP_LTUGTU_32", - [CC_OP_LTUGTU_64] =3D "CC_OP_LTUGTU_64", - [CC_OP_LTGT0_32] =3D "CC_OP_LTGT0_32", - [CC_OP_LTGT0_64] =3D "CC_OP_LTGT0_64", - [CC_OP_ADD_64] =3D "CC_OP_ADD_64", - [CC_OP_ADDU_64] =3D "CC_OP_ADDU_64", - [CC_OP_ADDC_64] =3D "CC_OP_ADDC_64", - [CC_OP_SUB_64] =3D "CC_OP_SUB_64", - [CC_OP_SUBU_64] =3D "CC_OP_SUBU_64", - [CC_OP_SUBB_64] =3D "CC_OP_SUBB_64", - [CC_OP_ABS_64] =3D "CC_OP_ABS_64", - [CC_OP_NABS_64] =3D "CC_OP_NABS_64", - [CC_OP_ADD_32] =3D "CC_OP_ADD_32", - [CC_OP_ADDU_32] =3D "CC_OP_ADDU_32", - [CC_OP_ADDC_32] =3D "CC_OP_ADDC_32", - [CC_OP_SUB_32] =3D "CC_OP_SUB_32", - [CC_OP_SUBU_32] =3D "CC_OP_SUBU_32", - [CC_OP_SUBB_32] =3D "CC_OP_SUBB_32", - [CC_OP_ABS_32] =3D "CC_OP_ABS_32", - [CC_OP_NABS_32] =3D "CC_OP_NABS_32", - [CC_OP_COMP_32] =3D "CC_OP_COMP_32", - [CC_OP_COMP_64] =3D "CC_OP_COMP_64", - [CC_OP_TM_32] =3D "CC_OP_TM_32", - [CC_OP_TM_64] =3D "CC_OP_TM_64", - [CC_OP_NZ_F32] =3D "CC_OP_NZ_F32", - [CC_OP_NZ_F64] =3D "CC_OP_NZ_F64", - [CC_OP_NZ_F128] =3D "CC_OP_NZ_F128", - [CC_OP_ICM] =3D "CC_OP_ICM", - [CC_OP_SLA_32] =3D "CC_OP_SLA_32", - [CC_OP_SLA_64] =3D "CC_OP_SLA_64", - [CC_OP_FLOGR] =3D "CC_OP_FLOGR", -}; - -static inline const char *cc_name(int cc_op) -{ - return cc_names[cc_op]; -} +const char *cc_name(int cc_op); =20 static inline void setcc(S390CPU *cpu, uint64_t cc) { --=20 2.9.4