From nobody Tue Feb 10 22:17:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) client-ip=209.85.221.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1618786281; cv=none; d=zohomail.com; s=zohoarc; b=bqUx/2oK2US22d02l9DDmJE2en/UO4gghCnAMpPv9pC7587Q8CBOBENdmk0S38XloELFnTIiB7Lih1poyA/7TyO0A7JefUzGNb4H2xOv0EA9wT8TA+GG2nA59/tJ5HjJGcnjVcYgOIfkXD/XQJhwCrvfwu8j8Z0wiORyh4oaWC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618786281; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JdLEvydvbX477BhH/ZmKV47FrIUBwZZqHvybwivTF10=; b=MgVXnIZ0nAZSjUNO0BrwM+u6XXCdeWXoRSTz2rt+3nN5QL7Pg3l5X6s94/x4dzF/efWs4yV7xEKLbUu6ntaasbyPXgLyeHdur8aFpvSpSSDnv/6X5d4IOD3q7OtqVnedxq5zq37s46QerQRdDUnWrJ4QW//XsW+PV1apAFUCtWI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.zohomail.com with SMTPS id 1618786281326218.18293946031235; Sun, 18 Apr 2021 15:51:21 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id m9so19282688wrx.3 for ; Sun, 18 Apr 2021 15:51:20 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id q10sm17322390wmc.31.2021.04.18.15.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 15:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JdLEvydvbX477BhH/ZmKV47FrIUBwZZqHvybwivTF10=; b=iJyETAjg7rFPWYhSshdHjxskFOSBgaHXqN6AGZ5xh6YL4h+2fpjQ+czNUjAJx4Kxc6 RxMoBDuoxaD/Qgbn5cdnudZDOIS19/6f7qMzPstXacvgDn8Icr3sby/OxyDrT90lRgUZ ahimevfwqw32sySf05QnwRbqRWxn6WiM+ykd4vbrbdEWSPOQn10Nk1YK/7wM/GPPmAXj AUgrWZKO408nEiagWeNOBr6i8MHLEU6IpIZ9X2yhQIsvM6phjYdntOE3Jdy4roAVr60v 3DZdtuRn44VnhpzWxZORVYWTNhV4SP77GEk/gKSBGhTwjvFghXQeVSpQiFN1HpGF0ZO3 CPRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JdLEvydvbX477BhH/ZmKV47FrIUBwZZqHvybwivTF10=; b=M+tXI1UhTroJzS1dg3e0xOt6zQyjyURoymy+SHpiWvDRXFEV9ppCvmmaagbtCg8zNr akpsYt53YGgdJP5OTLs5lFo/OZ9yqGwardeo2KXnXRxQVCXjjhtWwlRQpddw3GE3go8U J8LSGtuQ01oyXTanVgyXgA3TB0Dp+6bWJu9mP69aCFnzDqt+8gWgoipErThHSHNoYK8/ P+2AgPz2q/RNC/+1WDGaKIgXX6fYdcybV0z//a3pViPn7SEfm2Ex8OcisQWY2VgBTILa nF2/iyvmApZQekMriassiMy9P7LwVIf+8YXjA3mu1i80KLKzxeyYipUMOhUAFViowQti f6MQ== X-Gm-Message-State: AOAM533XE29Lc64JoOJyryrFT5FBI3fvG4LI1BWGLzki24vbqV2QGNm5 BvSdb+3W5QfTisUoLelZbl0= X-Google-Smtp-Source: ABdhPJxEZHDe9gBlfvjpwWO9JdaHzT3mcQBpzxXsJDMNZ4rjASRBt8V5otHHRFMp7cFuOD5BvXscRA== X-Received: by 2002:a05:6000:1084:: with SMTP id y4mr11069734wrw.364.1618786279626; Sun, 18 Apr 2021 15:51:19 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aurelien Jarno , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH v2 04/29] target/mips: Make CPU/FPU regnames[] arrays global Date: Mon, 19 Apr 2021 00:50:33 +0200 Message-Id: <20210418225058.1257014-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210418225058.1257014-1-f4bug@amsat.org> References: <20210418225058.1257014-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The CPU/FPU regnames[] arrays is used in mips_tcg_init() and mips_cpu_dump_state(), which while being in translate.c is not specific to TCG. To be able to move mips_cpu_dump_state() to cpu.c, which is compiled for all accelerator, we need to make the regnames[] arrays global to target/mips/ by declaring them in "internal.h". Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/internal.h | 3 +++ target/mips/cpu.c | 7 +++++++ target/mips/fpu.c | 7 +++++++ target/mips/translate.c | 14 -------------- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 99264b8bf6a..a8644f754a6 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -71,6 +71,9 @@ struct mips_def_t { int32_t SAARP; }; =20 +extern const char * const regnames[32]; +extern const char * const fregnames[32]; + extern const struct mips_def_t mips_defs[]; extern const int mips_defs_number; =20 diff --git a/target/mips/cpu.c b/target/mips/cpu.c index dce1e166bde..f354d18aec4 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -35,6 +35,13 @@ #include "qapi/qapi-commands-machine-target.h" #include "fpu_helper.h" =20 +const char * const regnames[32] =3D { + "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", +}; + #if !defined(CONFIG_USER_ONLY) =20 /* Called for updates to CP0_Status. */ diff --git a/target/mips/fpu.c b/target/mips/fpu.c index 39a2f7fd22e..1447dba3fa3 100644 --- a/target/mips/fpu.c +++ b/target/mips/fpu.c @@ -16,3 +16,10 @@ const FloatRoundMode ieee_rm[4] =3D { float_round_up, float_round_down }; + +const char * const fregnames[32] =3D { + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", +}; diff --git a/target/mips/translate.c b/target/mips/translate.c index 71fa5ec1973..f99d4d4016d 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -1267,13 +1267,6 @@ TCGv_i64 fpu_f64[32]; #define DISAS_STOP DISAS_TARGET_0 #define DISAS_EXIT DISAS_TARGET_1 =20 -static const char * const regnames[] =3D { - "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3", - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", -}; - static const char * const regnames_HI[] =3D { "HI0", "HI1", "HI2", "HI3", }; @@ -1282,13 +1275,6 @@ static const char * const regnames_LO[] =3D { "LO0", "LO1", "LO2", "LO3", }; =20 -static const char * const fregnames[] =3D { - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", - "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", - "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", - "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", -}; - /* General purpose registers moves. */ void gen_load_gpr(TCGv t, int reg) { --=20 2.26.3