(forwarding this question)

This code
        j = --i + i--;

Is transformed into this (pseudo)WHIRL:

STID(i) - ADD - LDID(i)                         ; this is the side
              \ INTCONST(-1)                    ; effect of the --i expression

STID(preg_I4) - LDID(i)                         ; storage of the previous
                                                ; i value

STID(i) - ADD - LDID(i)                         ; this is the side
              \ INTCONST(-1)                    ; effect of the i-- expression

STID(j) - ADD - LDID(preg_I4)                   ; the actual
              \ LDID(i)                         ; j = .... expression

what is the advantage of this WHIRL instead of

STID(i) - ADD - LDID(i)                         ; this is the side
              \ INTCONST(-1)                    ; effect of the --i expression

STID(j) - ADD - LDID(i)                         ; the actual
              \ LDID(i)                         ; j = .... expression

STID(i) - ADD - LDID(i)                         ; this is the side
              \ INTCONST(-1)                    ; effect of the --i expression


the first version just uses one more WHIRL node and one more variable.
why is it used? is it because it's easier to rewrite C -> WHIRL in that way?


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to