This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [SH] Correct fabs and fneg insns in simulator
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Sun, 30 Nov 2014 17:35:06 +0100
- Subject: Re: [SH] Correct fabs and fneg insns in simulator
- Authentication-results: sourceware.org; auth=none
- References: <1413243560 dot 31394 dot 48 dot camel at yam-132-YW-E178-FTW> <20141128155122 dot GL5042 at adacore dot com>
Hi,
On Fri, 2014-11-28 at 19:51 +0400, Joel Brobecker wrote:
> Hello Oleg,,
>
> > It seems that the implementation of the SH fabs and fneg insns in the
> > simulator is not correct. They use the FP_UNARY macro which checks the
> > FPSCR.PR setting and raises an exception if PR = 1 (double precision)
> > and the register number is not even (i.e. a valid DF reg number).
> > For normal unary FP insns this is fine. However, fneg and fabs perform
> > the same (integer) operations regardless of the FPSCR.PR setting.
> >
> > This issue initially popped up here
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63260
> >
> > I've checked some of the failing tests mentioned in GCC PR 63260 above
> > with the patch applied and the failures go away.
> >
> > Could somebody please apply it if it's OK?
> >
> > I'm not subscribed to gdb-patches, please CC me when replying.
> >
> > Cheers,
> > Oleg
> >
> > sim/ChangeLog:
> >
> > 2014-10-14 Oleg Endo <olegendo@gcc.gnu.org>
> >
> > * sh/gencode.c (fabs, fneg): Implement as integer operation
> > instead of using the FP_UNARY macro.
>
> Thank you for the patch. We don't have an SH maintainer for GDB,
> and in the absence of any feedback from other interested people,
> we will just trust you on this. So I pushed this patch under the
> "tiny patch" rule.
Thanks.
> If you ever think of contributing other patches to GDB, we'll probably
> have to start thinking about getting your copyright assignment to
> cover GDB as well.
Yes, that might be a good idea. Could you please send me the necessary
papers (or initiate the procedure)?
Cheers,
Oleg