This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][02/19] Target FP: Simplify floatformat_from_type


Simon Marchi wrote:

> On 2017-09-05 20:20, Ulrich Weigand wrote:
> >    size_t len = bit / TARGET_CHAR_BIT;
> > -  gdb_assert (len >= floatformat_totalsize_bytes (floatformats[0]));
> > -  gdb_assert (len >= floatformat_totalsize_bytes (floatformats[1]));
> > +  gdb_assert (len * TARGET_CHAR_BIT >= floatformat->totalsize);
> 
> That looks funny now.  Is there a reason not to do
> 
>    gdb_assert (bit >= floatformat->totalsize);
> 
> directly?

Well, that would use different rounding ...   Of course, this only
matters when floatformat->totalsize is not a multiple of TARGET_CHAR_BIT,
which doesn't happen for any of the floatformats GDB supports, so it
is probably moot.  Maybe we should instead use an assert to verify that
floatformat->totalsize is in fact a multiple of TARGET_CHAR_BIT?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]