From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: fam@euphon.net, "Peter Maydell" <peter.maydell@linaro.org>,
berrange@redhat.com, "Philippe Mathieu-Daudé" <philmd@redhat.com>,
richard.henderson@linaro.org, f4bug@amsat.org,
"Greg Kurz" <groug@kaod.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
cota@braap.org,
"open list:PowerPC TCG CPUs" <qemu-ppc@nongnu.org>,
aurelien@aurel32.net,
"David Gibson" <david@gibson.dropbear.id.au>
Subject: [PATCH v1 12/15] target/ppc: Drop use of gdb_get_float64() and ldfq_p()
Date: Thu, 11 Feb 2021 12:27:47 +0000 [thread overview]
Message-ID: <20210211122750.22645-13-alex.bennee@linaro.org> (raw)
In-Reply-To: <20210211122750.22645-1-alex.bennee@linaro.org>
From: Peter Maydell <peter.maydell@linaro.org>
We used to make a distinction between 'float64'/'float32' types and
the 'uint64_t'/'uint32_t' types, requiring special conversion
operations to go between them. We've now dropped this distinction as
unnecessary, and the 'float*' types remain primarily for
documentation purposes when used in places like the function
prototypes of TCG helper functions.
This means that there's no need for a special gdb_get_float64()
function to write a float64 value to the GDB protocol buffer; we can
just use gdb_get_reg64().
Similarly, for reading a value out of the GDB buffer into a float64
we can use ldq_p() and need not use ldfq_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210208113428.7181-4-peter.maydell@linaro.org>
---
target/ppc/gdbstub.c | 8 ++++----
target/ppc/translate_init.c.inc | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c
index 01459dd31d..c28319fb97 100644
--- a/target/ppc/gdbstub.c
+++ b/target/ppc/gdbstub.c
@@ -130,7 +130,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n)
gdb_get_regl(buf, env->gpr[n]);
} else if (n < 64) {
/* fprs */
- gdb_get_float64(buf, *cpu_fpr_ptr(env, n - 32));
+ gdb_get_reg64(buf, *cpu_fpr_ptr(env, n - 32));
} else {
switch (n) {
case 64:
@@ -184,7 +184,7 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, GByteArray *buf, int n)
gdb_get_reg64(buf, env->gpr[n]);
} else if (n < 64) {
/* fprs */
- gdb_get_float64(buf, *cpu_fpr_ptr(env, n - 32));
+ gdb_get_reg64(buf, *cpu_fpr_ptr(env, n - 32));
} else if (n < 96) {
/* Altivec */
gdb_get_reg64(buf, n - 64);
@@ -241,7 +241,7 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
env->gpr[n] = ldtul_p(mem_buf);
} else if (n < 64) {
/* fprs */
- *cpu_fpr_ptr(env, n - 32) = ldfq_p(mem_buf);
+ *cpu_fpr_ptr(env, n - 32) = ldq_p(mem_buf);
} else {
switch (n) {
case 64:
@@ -291,7 +291,7 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
env->gpr[n] = ldq_p(mem_buf);
} else if (n < 64) {
/* fprs */
- *cpu_fpr_ptr(env, n - 32) = ldfq_p(mem_buf);
+ *cpu_fpr_ptr(env, n - 32) = ldq_p(mem_buf);
} else {
switch (n) {
case 64 + 32:
diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc
index 3ec45cbc19..e7324e85cd 100644
--- a/target/ppc/translate_init.c.inc
+++ b/target/ppc/translate_init.c.inc
@@ -9923,7 +9923,7 @@ static int gdb_get_float_reg(CPUPPCState *env, GByteArray *buf, int n)
{
uint8_t *mem_buf;
if (n < 32) {
- gdb_get_float64(buf, *cpu_fpr_ptr(env, n));
+ gdb_get_reg64(buf, *cpu_fpr_ptr(env, n));
mem_buf = gdb_get_reg_ptr(buf, 8);
ppc_maybe_bswap_register(env, mem_buf, 8);
return 8;
@@ -9941,7 +9941,7 @@ static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
ppc_maybe_bswap_register(env, mem_buf, 8);
- *cpu_fpr_ptr(env, n) = ldfq_p(mem_buf);
+ *cpu_fpr_ptr(env, n) = ldq_p(mem_buf);
return 8;
}
if (n == 32) {
--
2.20.1
next prev parent reply other threads:[~2021-02-11 12:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 12:27 [PATCH v1 00/15] testing and gdbstub pre-PR (travis, shipable, gitlab, gdb float) Alex Bennée
2021-02-11 12:27 ` [PATCH v1 01/15] travis.yml: Move gprof/gcov test across to gitlab Alex Bennée
2021-02-11 12:27 ` [PATCH v1 02/15] travis.yml: Move the -fsanitize=undefined test to the gitlab-CI Alex Bennée
2021-02-11 12:27 ` [PATCH v1 03/15] travis.yml: Move the --enable-modules " Alex Bennée
2021-02-11 12:27 ` [PATCH v1 04/15] travis.yml: (Re-)move the --enable-debug jobs Alex Bennée
2021-02-11 12:27 ` [PATCH v1 05/15] travis.yml: Move the -fsanitize=thread testing to the gitlab-CI Alex Bennée
2021-02-11 12:27 ` [PATCH v1 06/15] .shippable: remove the last bits Alex Bennée
2021-02-11 12:27 ` [PATCH v1 07/15] travis-ci: Disable C++ optional objects on AArch64 container Alex Bennée
2021-02-11 12:27 ` [PATCH v1 08/15] tests/docker: remove travis container Alex Bennée
2021-02-11 12:27 ` [PATCH v1 09/15] MAINTAINERS: Add gdbstub.h to the "GDB stub" section Alex Bennée
2021-02-11 12:27 ` [PATCH v1 10/15] target/sh4: Drop use of gdb_get_float32() and ldfl_p() Alex Bennée
2021-02-11 12:27 ` [PATCH v1 11/15] target/m68k: Drop use of gdb_get_float64() and ldfq_p() Alex Bennée
2021-02-11 12:27 ` Alex Bennée [this message]
2021-02-11 12:27 ` [PATCH v1 13/15] gdbstub: Remove unused gdb_get_float32() and gdb_get_float64() Alex Bennée
2021-02-11 12:27 ` [PATCH v1 14/15] bswap.h: Remove unused float-access functions Alex Bennée
2021-02-11 12:27 ` [PATCH v1 15/15] tests/tcg: fix silent skipping of softmmu gdb tests Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210211122750.22645-13-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=cota@braap.org \
--cc=david@gibson.dropbear.id.au \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=groug@kaod.org \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).