[LLVMdev] Proposal: intp type

me22 me22.ca at gmail.com
Thu Nov 12 12:11:35 PST 2009


2009/11/12 Talin <viridia at gmail.com>:
>
> Converting to pointer types: inttoptr and ptrtoint should be no-ops,
> effectively.
> Converting to other integer types: The issue here is that with other integer
> conversions in LLVM, you are required to know whether or not you are
> converting to a larger or smaller size - whether to use an ext or a trunc
> instruction. When converting to pointers, however, the choice of trunc or
> ext is automatic. Ideally, conversion to iptr would work the same way as
> conversion to a pointer type. There's also the issue of signed vs. unsigned
> extension.
>

What about just allowing iptr to be considered a pointer?

  %x = ptrtoint iptr %X to i8           ; yields truncation on 32-bit
architecture
  %y = ptrtoint iptr %Y to i64          ; yields zero extension on
32-bit architecture




More information about the llvm-dev mailing list