Skip to content

Commit 78408e5

Browse files
committed
[NVPTX] Add support for tcgen05 instructions for sm103 target
1 parent a5b5248 commit 78408e5

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

llvm/lib/Target/NVPTX/NVPTXSubtarget.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,21 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo {
106106
// Tcgen05 instructions in Blackwell family
107107
bool hasTcgen05Instructions() const {
108108
bool HasTcgen05 = false;
109+
unsigned MinPTXVersion = 86;
109110
switch (FullSmVersion) {
110111
default:
111112
break;
112113
case 1003: // sm_100a
113114
case 1013: // sm_101a
114115
HasTcgen05 = true;
115116
break;
117+
case 1033: // sm_103a
118+
HasTcgen05 = true;
119+
MinPTXVersion = 88;
120+
break;
116121
}
117122

118-
return HasTcgen05 && PTXVersion >= 86;
123+
return HasTcgen05 && PTXVersion >= MinPTXVersion;
119124
}
120125
// f32x2 instructions in Blackwell family
121126
bool hasF32x2Instructions() const;

llvm/test/CodeGen/NVPTX/tcgen05-fence.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
22
; RUN: llc < %s -march=nvptx64 -mcpu=sm_100a -mattr=+ptx86 | FileCheck --check-prefixes=CHECK %s
3+
; RUN: llc < %s -march=nvptx64 -mcpu=sm_103a -mattr=+ptx88 | FileCheck --check-prefixes=CHECK %s
34
; RUN: %if ptxas-sm_100a && ptxas-isa-8.6 %{ llc < %s -march=nvptx64 -mcpu=sm_100a -mattr=+ptx86 | %ptxas-verify -arch=sm_100a %}
5+
; RUN: %if ptxas-sm_103a && ptxas-isa-8.8 %{ llc < %s -march=nvptx64 -mcpu=sm_103a -mattr=+ptx88 | %ptxas-verify -arch=sm_103a %}
46

57
declare void @llvm.nvvm.tcgen05.fence.before.thread.sync()
68
declare void @llvm.nvvm.tcgen05.fence.after.thread.sync()

llvm/test/CodeGen/NVPTX/tcgen05-ld.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
22
; RUN: llc < %s -o - -mcpu=sm_100a -march=nvptx64 -mattr=+ptx86 | FileCheck %s
33
; RUN: llc < %s -o - -mcpu=sm_101a -march=nvptx64 -mattr=+ptx86 | FileCheck %s
4+
; RUN: llc < %s -o - -mcpu=sm_103a -march=nvptx64 -mattr=+ptx88 | FileCheck %s
45
; RUN: %if ptxas-sm_100a && ptxas-isa-8.6 %{ llc < %s -march=nvptx64 -mattr=+ptx86 -mcpu=sm_100a | %ptxas-verify -arch=sm_100a %}
56
; RUN: %if ptxas-sm_101a && ptxas-isa-8.6 %{ llc < %s -march=nvptx64 -mattr=+ptx86 -mcpu=sm_101a | %ptxas-verify -arch=sm_101a %}
7+
; RUN: %if ptxas-sm_103a && ptxas-isa-8.8 %{ llc < %s -march=nvptx64 -mattr=+ptx88 -mcpu=sm_103a | %ptxas-verify -arch=sm_103a %}
68

79
; CHECK-LABEL: nvvm_tcgen05_ld_16x64b
810
define void @nvvm_tcgen05_ld_16x64b(ptr addrspace(6) %taddr) {

0 commit comments

Comments
 (0)