[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-dev
Subject:    Re: [Mesa-dev] Fixup: Use C++ style constant member functions
From:       Michal Krol <michal () vmware ! com>
Date:       2011-09-20 7:17:37
Message-ID: 1339892830.584267.1316503057657.JavaMail.root () zimbra-prod-mbox-4 ! vmware ! com
[Download RAW message or body]

----- Original Message -----
> On Sun, 11 Sep 2011 13:05:38 +0200, Tolga Dalman
> <tolga.dalman@googlemail.com> wrote:
> > Hi Kenneth,
> > 
> > On Fri,  9 Sep 2011 14:41:45 -0700
> > Kenneth Graunke <kenneth@whitecape.org> wrote:
> > 
> > > -   if (reg->type == BRW_REGISTER_TYPE_F) {
> > > -      return reg->imm.f == 0.0;
> > > +   if (type == BRW_REGISTER_TYPE_F) {
> > > +      return imm.f == 0.0;
> > [...]
> > > -   if (reg->type == BRW_REGISTER_TYPE_F) {
> > > -      return reg->imm.f == 1.0;
> > > +   if (type == BRW_REGISTER_TYPE_F) {
> > > +      return imm.f == 1.0;
> > 
> > Shouldn't this rather be something like
> > fabs(imm.f - 1.0) < std::numeric_limits<float>::eps() ?
> > 
> > Nevertheless, I like your patch.
> 
> I don't think so: (some variable equal to 1.0) * (1.0 + epsilon)
> should
> return (1.0 + epsilon), while your change would optimize that to
> return
> the variable's value of 1.0, right?  I wouldn't want to do that
> without
> some clear reason to.
> 

And this is still the case since the optimisation applies for deltas that are *less* \
than epsilon, not *less-or-equal* as you imply.

-- 
michal
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic