[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 31/44] target/s390x: move cc_name() to helper.c
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 31/44] target/s390x: move cc_name() to helper.c |
Date: |
Wed, 30 Aug 2017 18:52:39 +0200 |
From: David Hildenbrand <address@hidden>
While at it, move the translations into the function and properly pass
enum cc_op as parameter. We can't move it to cc_helper.c as this would
break --disable-tcg.
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/cpu.h | 48 +-----------------------------------------------
target/s390x/helper.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 47 deletions(-)
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index c40d70dd70..10208ecbbb 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -742,53 +742,7 @@ enum cc_op {
CC_OP_MAX
};
-static const char *cc_names[] = {
- [CC_OP_CONST0] = "CC_OP_CONST0",
- [CC_OP_CONST1] = "CC_OP_CONST1",
- [CC_OP_CONST2] = "CC_OP_CONST2",
- [CC_OP_CONST3] = "CC_OP_CONST3",
- [CC_OP_DYNAMIC] = "CC_OP_DYNAMIC",
- [CC_OP_STATIC] = "CC_OP_STATIC",
- [CC_OP_NZ] = "CC_OP_NZ",
- [CC_OP_LTGT_32] = "CC_OP_LTGT_32",
- [CC_OP_LTGT_64] = "CC_OP_LTGT_64",
- [CC_OP_LTUGTU_32] = "CC_OP_LTUGTU_32",
- [CC_OP_LTUGTU_64] = "CC_OP_LTUGTU_64",
- [CC_OP_LTGT0_32] = "CC_OP_LTGT0_32",
- [CC_OP_LTGT0_64] = "CC_OP_LTGT0_64",
- [CC_OP_ADD_64] = "CC_OP_ADD_64",
- [CC_OP_ADDU_64] = "CC_OP_ADDU_64",
- [CC_OP_ADDC_64] = "CC_OP_ADDC_64",
- [CC_OP_SUB_64] = "CC_OP_SUB_64",
- [CC_OP_SUBU_64] = "CC_OP_SUBU_64",
- [CC_OP_SUBB_64] = "CC_OP_SUBB_64",
- [CC_OP_ABS_64] = "CC_OP_ABS_64",
- [CC_OP_NABS_64] = "CC_OP_NABS_64",
- [CC_OP_ADD_32] = "CC_OP_ADD_32",
- [CC_OP_ADDU_32] = "CC_OP_ADDU_32",
- [CC_OP_ADDC_32] = "CC_OP_ADDC_32",
- [CC_OP_SUB_32] = "CC_OP_SUB_32",
- [CC_OP_SUBU_32] = "CC_OP_SUBU_32",
- [CC_OP_SUBB_32] = "CC_OP_SUBB_32",
- [CC_OP_ABS_32] = "CC_OP_ABS_32",
- [CC_OP_NABS_32] = "CC_OP_NABS_32",
- [CC_OP_COMP_32] = "CC_OP_COMP_32",
- [CC_OP_COMP_64] = "CC_OP_COMP_64",
- [CC_OP_TM_32] = "CC_OP_TM_32",
- [CC_OP_TM_64] = "CC_OP_TM_64",
- [CC_OP_NZ_F32] = "CC_OP_NZ_F32",
- [CC_OP_NZ_F64] = "CC_OP_NZ_F64",
- [CC_OP_NZ_F128] = "CC_OP_NZ_F128",
- [CC_OP_ICM] = "CC_OP_ICM",
- [CC_OP_SLA_32] = "CC_OP_SLA_32",
- [CC_OP_SLA_64] = "CC_OP_SLA_64",
- [CC_OP_FLOGR] = "CC_OP_FLOGR",
-};
-
-static inline const char *cc_name(int cc_op)
-{
- return cc_names[cc_op];
-}
+const char *cc_name(enum cc_op cc_op);
static inline void setcc(S390CPU *cpu, uint64_t cc)
{
diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 0c989b1610..e31d3e51df 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -352,3 +352,51 @@ void s390_cpu_dump_state(CPUState *cs, FILE *f,
fprintf_function cpu_fprintf,
cpu_fprintf(f, "\n");
}
+
+const char *cc_name(enum cc_op cc_op)
+{
+ static const char * const cc_names[] = {
+ [CC_OP_CONST0] = "CC_OP_CONST0",
+ [CC_OP_CONST1] = "CC_OP_CONST1",
+ [CC_OP_CONST2] = "CC_OP_CONST2",
+ [CC_OP_CONST3] = "CC_OP_CONST3",
+ [CC_OP_DYNAMIC] = "CC_OP_DYNAMIC",
+ [CC_OP_STATIC] = "CC_OP_STATIC",
+ [CC_OP_NZ] = "CC_OP_NZ",
+ [CC_OP_LTGT_32] = "CC_OP_LTGT_32",
+ [CC_OP_LTGT_64] = "CC_OP_LTGT_64",
+ [CC_OP_LTUGTU_32] = "CC_OP_LTUGTU_32",
+ [CC_OP_LTUGTU_64] = "CC_OP_LTUGTU_64",
+ [CC_OP_LTGT0_32] = "CC_OP_LTGT0_32",
+ [CC_OP_LTGT0_64] = "CC_OP_LTGT0_64",
+ [CC_OP_ADD_64] = "CC_OP_ADD_64",
+ [CC_OP_ADDU_64] = "CC_OP_ADDU_64",
+ [CC_OP_ADDC_64] = "CC_OP_ADDC_64",
+ [CC_OP_SUB_64] = "CC_OP_SUB_64",
+ [CC_OP_SUBU_64] = "CC_OP_SUBU_64",
+ [CC_OP_SUBB_64] = "CC_OP_SUBB_64",
+ [CC_OP_ABS_64] = "CC_OP_ABS_64",
+ [CC_OP_NABS_64] = "CC_OP_NABS_64",
+ [CC_OP_ADD_32] = "CC_OP_ADD_32",
+ [CC_OP_ADDU_32] = "CC_OP_ADDU_32",
+ [CC_OP_ADDC_32] = "CC_OP_ADDC_32",
+ [CC_OP_SUB_32] = "CC_OP_SUB_32",
+ [CC_OP_SUBU_32] = "CC_OP_SUBU_32",
+ [CC_OP_SUBB_32] = "CC_OP_SUBB_32",
+ [CC_OP_ABS_32] = "CC_OP_ABS_32",
+ [CC_OP_NABS_32] = "CC_OP_NABS_32",
+ [CC_OP_COMP_32] = "CC_OP_COMP_32",
+ [CC_OP_COMP_64] = "CC_OP_COMP_64",
+ [CC_OP_TM_32] = "CC_OP_TM_32",
+ [CC_OP_TM_64] = "CC_OP_TM_64",
+ [CC_OP_NZ_F32] = "CC_OP_NZ_F32",
+ [CC_OP_NZ_F64] = "CC_OP_NZ_F64",
+ [CC_OP_NZ_F128] = "CC_OP_NZ_F128",
+ [CC_OP_ICM] = "CC_OP_ICM",
+ [CC_OP_SLA_32] = "CC_OP_SLA_32",
+ [CC_OP_SLA_64] = "CC_OP_SLA_64",
+ [CC_OP_FLOGR] = "CC_OP_FLOGR",
+ };
+
+ return cc_names[cc_op];
+}
--
2.13.5
- [Qemu-devel] [PULL 22/44] s390x/s390-skeys: Mark the storage key devices with user_creatable = false, (continued)
- [Qemu-devel] [PULL 22/44] s390x/s390-skeys: Mark the storage key devices with user_creatable = false, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 23/44] s390x/kvm: drop KVMState parameter from s390_get_memslot_count(), Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 24/44] s390x/kvm: drop KVMState parameter from kvm_s390_set_mem_limit(), Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 25/44] target/s390x: simplify ri_allowed(), Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 26/44] target/s390x: simplify gs_allowed(), Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 27/44] target/s390x: no need to pass kvm_state to savevm_gtod handlers, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 28/44] s390x/cpumodel: factor out determination of default model name, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 29/44] s390x: drop inclusion of sysemu/kvm.h from some files, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 30/44] target/s390x: move gtod_*() declarations to s390-virtio.h, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 32/44] target/s390x: move cpu_mmu_idx_to_asc() to excp_helper.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 31/44] target/s390x: move cc_name() to helper.c,
Cornelia Huck <=
- [Qemu-devel] [PULL 33/44] target/s390x: move psw_key_valid() to mem_helper.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 34/44] target/s390x: move s390_do_cpu_reset() to diag.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 35/44] target/s390x: move get_per_in_range() to misc_helper.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 36/44] target/s390x: introduce internal.h, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 38/44] s390x: avoid calling kvm_ functions outside of target/s390x/, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 37/44] target/s390x: move a couple of functions to cpu.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 39/44] s390x/kvm: move KVM declarations and stubs to separate files, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 41/44] s390x/s390-stattrib: Mark the storage attribute as not user_creatable, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 42/44] s390-ccw: Fix alignment for CCW1, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 40/44] target/s390x: cleanup cpu.h, Cornelia Huck, 2017/08/30