[llvm-commits] [PATCH][Target/PTX] Add address_size directive to PTX backend

Justin Holewinski justin.holewinski at gmail.com
Sun Jun 19 12:49:35 PDT 2011


On Jun 19, 2011, at 8:12 AM, 陳韋任 wrote:

>>>> Perhaps my understanding of the .address_size directive is incomplete, but as far as I know it is just used as a flag for ptxas to make sure all PTX modules in a program assume the same pointer size.  That said, what is the purpose of allowing LLVM to generate 32-bit PTX code but assume 64-bit addresses, and vice versa?  Why not tie the directive directly to the existing 32/64-bit flag instead of allowing user intervention?
>>> 
>>> I'll wait for Che-Liang and Dan's comment.
>> Yep, Justin's right, it makes more sense to use the 64bit flag to indicate the address size. 
> 
>  What you want is removing FeatureAddrSize32/64 from PTX.td to avoid
> user intervention, right? PTXAddrSize is assigned accroding to the
> 32/64-bit flag,
> 
> // PTXSubtarget ctor in PTXSubtarget.cpp
> PTXAddrSize = is64Bit? PTX_AddrSize_64 : PTX_AddrSize_32;

Correct.

> 
>  My question is where is64Bit will be set? Thanks!

The is64Bit flag will be set depending on which PTX target is specified.

-march=ptx32 -> is64Bit = false
-march=ptx64 -> is64Bit = true

The only place this flag is currently used right now is to select between .u32 and .u64 for pointer types.

> 
> Regards,
> chenwj
> 
> -- 
> Wei-Ren Chen (陳韋任)
> Computer Systems Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667

Thanks,

Justin Holewinski

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110619/e308a906/attachment.html>


More information about the llvm-commits mailing list