From: Jim Wilson <jim.wilson@linaro.org>
To: gdb-patches@sourceware.org
Cc: Nick Clifton <nickc@redhat.com>
Subject: [PATCH] fix for aarch64 sim FP stur bug
Date: Thu, 01 Dec 2016 07:36:00 -0000 [thread overview]
Message-ID: <CABXYE2XMYdgCgjdQqaRb0LJi_otd55Bk7wgWQSyTCKZgu5Z3mA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
While debugging a gcc C testsuite failure on the aarch64 simulator, I
noticed that the support for FP stur instructions is broken. They
accidentally have the two register operands swapped. The problem can
be seen by comparing them with the equivalent FP str instructions.
I tested the fix by running the gcc C testsuite. I get 3122
unexpected failures without the patch and 2856 unexpected failures
with the patch.
Jim
[-- Attachment #2: aarch64-sim-fstur.patch --]
[-- Type: text/x-patch, Size: 1557 bytes --]
2016-11-30 Jim Wilson <jim.wilson@linaro.org>
* sim/aarch64/simulator.c (fsturs): Switch use of rn and st variables.
(fsturd, fsturq): Likewise
diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c
index e5ada18..4fa5dc1 100644
--- a/sim/aarch64/simulator.c
+++ b/sim/aarch64/simulator.c
@@ -7497,8 +7497,8 @@ fsturs (sim_cpu *cpu, int32_t offset)
unsigned int st = INSTR (4, 0);
TRACE_DECODE (cpu, "emulated at line %d", __LINE__);
- aarch64_set_mem_u32 (cpu, aarch64_get_reg_u64 (cpu, st, 1) + offset,
- aarch64_get_vec_u32 (cpu, rn, 0));
+ aarch64_set_mem_u32 (cpu, aarch64_get_reg_u64 (cpu, rn, 1) + offset,
+ aarch64_get_vec_u32 (cpu, st, 0));
}
/* Store 64 bit unscaled signed 9 bit. */
@@ -7509,8 +7509,8 @@ fsturd (sim_cpu *cpu, int32_t offset)
unsigned int st = INSTR (4, 0);
TRACE_DECODE (cpu, "emulated at line %d", __LINE__);
- aarch64_set_mem_u64 (cpu, aarch64_get_reg_u64 (cpu, st, 1) + offset,
- aarch64_get_vec_u64 (cpu, rn, 0));
+ aarch64_set_mem_u64 (cpu, aarch64_get_reg_u64 (cpu, rn, 1) + offset,
+ aarch64_get_vec_u64 (cpu, st, 0));
}
/* Store 128 bit unscaled signed 9 bit. */
@@ -7522,9 +7522,9 @@ fsturq (sim_cpu *cpu, int32_t offset)
FRegister a;
TRACE_DECODE (cpu, "emulated at line %d", __LINE__);
- aarch64_get_FP_long_double (cpu, rn, & a);
+ aarch64_get_FP_long_double (cpu, st, & a);
aarch64_set_mem_long_double (cpu,
- aarch64_get_reg_u64 (cpu, st, 1)
+ aarch64_get_reg_u64 (cpu, rn, 1)
+ offset, a);
}
next reply other threads:[~2016-12-01 7:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 7:36 Jim Wilson [this message]
2016-12-01 9:13 ` Nick Clifton
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=CABXYE2XMYdgCgjdQqaRb0LJi_otd55Bk7wgWQSyTCKZgu5Z3mA@mail.gmail.com \
--to=jim.wilson@linaro.org \
--cc=gdb-patches@sourceware.org \
--cc=nickc@redhat.com \
/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