This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][13/19] Target FP: Perform Ada fixed-point scaling in target format
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: brobecker at adacore dot com (Joel Brobecker)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 9 Oct 2017 18:58:30 +0200 (CEST)
- Subject: Re: [RFC][13/19] Target FP: Perform Ada fixed-point scaling in target format
- Authentication-results: sourceware.org; auth=none
Joel Brobecker wrote:
> On Tue, Sep 05, 2017 at 08:21:35PM +0200, Ulrich Weigand wrote:
> > * ada-lang.c (cast_to_fixed): Reimplement in target arithmetic.
> > (cast_to_fixed): Likewise.
> ^^^^^^^^^^^^^
> cast_from_fixed :)
Fixed.
> > (ada_scaling_type): New function.
> > (ada_delta): Return value instead of DOUBLEST. Perform target
> > arithmetic instead of host arithmetic.
> > (scaling_factor): Rename to ...
> > (ada_scaling_factor) ... this. Return value instead of DOUBLEST.
> > Perform target arithmetic instead of host arithmetic.
>
> Maybe mention that we are making this function non-static too?
Fixed.
> We have a fixed point tests in the testsuite (gdb.ada/fixed_points.exp),
> so having it run and pass after your change should be a very good sanity
> check on its own.
I did run the test suite including Ada tests on x86_64-linux, and this
test case does still pass.
> This is a C++ question, really. Does it make any difference if you
> declare the std::string first, and then only set its contents in
> a second statement? I can't remember the details, but it has to do
> with initialization vs assignment. I _really_ hope that the string
> class is sufficiently well designed that the two are really equivalent
> in practice?
Huh. Indeed I see worse code when doing the assignment as a separate
statement, at least with GCC 4.8. I'll make sure to use initialization
instead wherever possible. Thanks for pointing this out!
Thanks for the review!
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com