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

Justin Holewinski justin.holewinski at gmail.com
Mon Jun 20 05:53:26 PDT 2011


On Jun 19, 2011, at 9:51 PM, 陳韋任 wrote:

> Hi, Justin
> 
>>> 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.
> 
>  Fixed.

I hate to nit-pick, but do we really need the address size field and associated enumeration?  It's always tied to the 64-bit flag, and we do not need to create any TableGen predicates from the value.

I think this patch can be as simple as:

if (ST.supportsPTX23()) {
  std::string addrSize = is64Bit() ? "64" : "32";
  OutStreamer.EmitRawText(Twine("\t.address_size " + addrSize));
}

… with the appropriate test cases.


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

Thanks,

Justin Holewinski

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


More information about the llvm-commits mailing list