[LLVMdev] Proposal: intp type

Kenneth Uildriks kennethuil at gmail.com
Tue Nov 10 08:24:36 PST 2009


On Tue, Nov 10, 2009 at 8:10 AM, me22 <me22.ca at gmail.com> wrote:
> 2009/11/9 Kenneth Uildriks <kennethuil 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?

I suppose that would work, but I wouldn't like to see two cast
instructions for every conversion.

Perhaps every conversion to/from intp could be represented as a zext,
whether or not it actually performs an extension.  Is there anything
in LLVM that depends on a zext actually increasing the size of the
integer?




More information about the llvm-dev mailing list