mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-25 21:00:00 +00:00
PTX: Add .address_size directive if PTX version >= 2.3
Patch by Wei-Ren Chen git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133589 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f11bb7f80d
commit
a9c85f9ead
@ -163,6 +163,13 @@ void PTXAsmPrinter::EmitStartOfAsmFile(Module &M)
|
||||
OutStreamer.EmitRawText(Twine("\t.target " + ST.getTargetString() +
|
||||
(ST.supportsDouble() ? ""
|
||||
: ", map_f64_to_f32")));
|
||||
// .address_size directive is optional, but it must immediately follow
|
||||
// the .target directive if present within a module
|
||||
if (ST.supportsPTX23()) {
|
||||
std::string addrSize = ST.is64Bit() ? "64" : "32";
|
||||
OutStreamer.EmitRawText(Twine("\t.address_size " + addrSize));
|
||||
}
|
||||
|
||||
OutStreamer.AddBlankLine();
|
||||
|
||||
// declare global variables
|
||||
|
@ -5,6 +5,8 @@
|
||||
; RUN: llc < %s -march=ptx32 -mattr=sm10 | grep ".target sm_10"
|
||||
; RUN: llc < %s -march=ptx32 -mattr=sm13 | grep ".target sm_13"
|
||||
; RUN: llc < %s -march=ptx32 -mattr=sm20 | grep ".target sm_20"
|
||||
; RUN: llc < %s -march=ptx32 -mattr=ptx23 | grep ".address_size 32"
|
||||
; RUN: llc < %s -march=ptx64 -mattr=ptx23 | grep ".address_size 64"
|
||||
|
||||
define ptx_device void @t1() {
|
||||
ret void
|
||||
|
Loading…
Reference in New Issue
Block a user