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,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
richard.henderson@linaro.org, f4bug@amsat.org,
"Alex Bennée" <alex.bennee@linaro.org>,
cota@braap.org, aurelien@aurel32.net
Subject: [PATCH v1 10/15] target/sh4: Drop use of gdb_get_float32() and ldfl_p()
Date: Thu, 11 Feb 2021 12:27:45 +0000 [thread overview]
Message-ID: <20210211122750.22645-11-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_float32()
function to write a float32 value to the GDB protocol buffer; we can
just use gdb_get_reg32().
Similarly, for reading a value out of the GDB buffer into a float32
we can use ldl_p() and need not use ldfl_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210208113428.7181-2-peter.maydell@linaro.org>
---
target/sh4/gdbstub.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/sh4/gdbstub.c b/target/sh4/gdbstub.c
index 34ad3ca050..3488f68e32 100644
--- a/target/sh4/gdbstub.c
+++ b/target/sh4/gdbstub.c
@@ -58,9 +58,9 @@ int superh_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
return gdb_get_regl(mem_buf, env->fpscr);
case 25 ... 40:
if (env->fpscr & FPSCR_FR) {
- return gdb_get_float32(mem_buf, env->fregs[n - 9]);
+ return gdb_get_reg32(mem_buf, env->fregs[n - 9]);
}
- return gdb_get_float32(mem_buf, env->fregs[n - 25]);
+ return gdb_get_reg32(mem_buf, env->fregs[n - 25]);
case 41:
return gdb_get_regl(mem_buf, env->ssr);
case 42:
@@ -119,9 +119,9 @@ int superh_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
break;
case 25 ... 40:
if (env->fpscr & FPSCR_FR) {
- env->fregs[n - 9] = ldfl_p(mem_buf);
+ env->fregs[n - 9] = ldl_p(mem_buf);
} else {
- env->fregs[n - 25] = ldfl_p(mem_buf);
+ env->fregs[n - 25] = ldl_p(mem_buf);
}
break;
case 41:
--
2.20.1
next prev parent reply other threads:[~2021-02-11 12:39 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 ` Alex Bennée [this message]
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 ` [PATCH v1 12/15] target/ppc: " Alex Bennée
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-11-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=cota@braap.org \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=ysato@users.sourceforge.jp \
/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).