[LLVMdev] Proposal: intp type
heisenbug
ggreif at gmail.com
Wed Nov 11 10:20:26 PST 2009
On 10 Nov., 15:10, me22 <me22... at gmail.com> wrote:
> 2009/11/9 Kenneth Uildriks <kenneth... at gmail.com>:
>
>
>
> > 1. Conversions to/from other integer types: right now, integer type
> > conversions are always explicity specified as either a trunc, a sext,
> > or a zext. Since the size of intp is not known at IR generation time,
> > you can't know whether a conversion to/from intp truncates or extends.
>
> Now that there are arbitrary-sized integers, couldn't you zext to i256
> then trunc down again, and later let the folder simplify as
> appropriate?
This is not correct, because i256 occupies too much space in
structures, etc.
This question came up in the past, and I half-jokingly suggested "i0"
as the interger type that can store a null-pointer, and thus every
pointer.
i0 could be a type alias which gets resolved at the time when sizeof
(void*)
is first known. But as a nice bonus, conversions between i0 and T*
could be
omitted.
Just my 2 cents.
Gabor
>
> _______________________________________________
> LLVM Developers mailing list
> LLVM... at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list