Re: pointer arithmetics and casts

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

 



Al Viro wrote:-

> On Sat, May 26, 2007 at 12:44:09PM +0900, Neil Booth wrote:
>  
> > Perhaps not overloading the "+" node; reserve that for arithmetic types.
> > Have a ptr_add, (maybe) ptr_sub, and ptr_diff operations.
> 
> Making the scaling a part of operation?  It means interesting logics
> at later stages, though...

Yes.  Should be handlable in one place during the lowering phase
(linearize? - I'm not too familiar with what sparse does after
parsing).

If you do make the scaling explicit in the IR, then in-line with
my belief that the IR should make all implicit operations explicit,
the multiplication would be on two operands of the same type, with
explicit casts wherever necessary.  I think having the extra nodes
and a sane IR is much better to having a non-orthogonal IR of fewer
nodes full of special cases (look at the mess GCC has with the latter).

Neil.
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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