Re: [PATCH v2 03/15] unify simplify_lsr_or() & simplify_and_or_mask()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 20, 2018 at 11:46:18PM +0100, Ramsay Jones wrote:
> 
> OK, so just to be sure: the mask parameter to the function
> is the 'equivalent mask' or 'outer mask' or the 'mask associated
> with the outer operation', or M in the formulas.

Yes, all those refer to the same thing (but I probably only use
'outer mask' when the outer op is AND).

> The M' mask is
> given by the 'omask' variable in the code, right?

Yes.
Originally, the 'o' was for 'the OR mask' but now it's
better to see it as the 'old' mask (for the inner operation).
'nmask' is for 'new' mask.

> I suspect that I'm confusing myself because I am trying to see
> this as a graph coverage problem, where the 'outer' operation
> is a node 'higher-up' the 'tree'. ;-)

Well, it's how I tend to see things too, the outer op is at the
root of the tree and the inner ops at the leaves. But, of course,
when displayed, the IR is naturally displayed with the inner ops
first and the outer one at the bottom (while we usually display
trees upside-down: the root at the top and the leaves at the bottom).

In the names of the tests I also now use the outer op first.

> So, the notation/formulas are confusing to me (partly because
> the M mask used is some function of OP and C: M = F(OP,C) and
> that is not stated anywhere). However, you understand them, so
> I will just have to squint a little harder! :-P

To be honest, a big part of the confusion is because I started
with an whole set of simplification just for AND as root op.
I also had another set for LSR. Both had some obvious similarities
but nothing really common. I did some work to make them look more
similar and they were almost unified. The I had some simplifications
with TRUNC and I realized it was a special case of AND and then I
realized that by rewriting things slightly differently, LSR was also a
special case of the 'AND' once you associated with it the corresponding
effective mask. Once this done the whole was then unified and adding
SHL to it was trivial. But in a lot of places the comments were still
left or copy-pasted as refering only to the original AND case.

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux