diff --git a/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td b/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td --- a/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td +++ b/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td @@ -156,6 +156,7 @@ def hasPTX72 : Predicate<"Subtarget->getPTXVersion() >= 72">; def hasSM30 : Predicate<"Subtarget->getSmVersion() >= 30">; +def hasSM32 : Predicate<"Subtarget->getSmVersion() >= 32">; def hasSM53 : Predicate<"Subtarget->getSmVersion() >= 53">; def hasSM70 : Predicate<"Subtarget->getSmVersion() >= 70">; def hasSM72 : Predicate<"Subtarget->getSmVersion() >= 72">; diff --git a/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td b/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td --- a/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td +++ b/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td @@ -1658,13 +1658,13 @@ defm INT_PTX_ATOM_LOAD_MAX_GEN_32_USE_G : F_ATOMIC_2; defm INT_PTX_ATOM_LOAD_MAX_G_64 : F_ATOMIC_2; + ".max", atomic_load_max_64_g, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_MAX_S_64 : F_ATOMIC_2; + ".max", atomic_load_max_64_s, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_MAX_GEN_64 : F_ATOMIC_2; + atomic_load_max_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_MAX_GEN_64_USE_G : F_ATOMIC_2; + ".s64", ".max", atomic_load_max_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMAX_G_32 : F_ATOMIC_2; defm INT_PTX_ATOM_LOAD_UMAX_S_32 : F_ATOMIC_2; defm INT_PTX_ATOM_LOAD_UMAX_G_64 : F_ATOMIC_2; + ".max", atomic_load_umax_64_g, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMAX_S_64 : F_ATOMIC_2; + ".max", atomic_load_umax_64_s, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMAX_GEN_64 : F_ATOMIC_2; + atomic_load_umax_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMAX_GEN_64_USE_G : F_ATOMIC_2; + ".u64", ".max", atomic_load_umax_64_gen, i64imm, imm, [hasSM32]>; // atom_min @@ -1718,13 +1718,13 @@ defm INT_PTX_ATOM_LOAD_MIN_GEN_32_USE_G : F_ATOMIC_2; defm INT_PTX_ATOM_LOAD_MIN_G_64 : F_ATOMIC_2; + ".min", atomic_load_min_64_g, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_MIN_S_64 : F_ATOMIC_2; + ".min", atomic_load_min_64_s, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_MIN_GEN_64 : F_ATOMIC_2; + atomic_load_min_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_MIN_GEN_64_USE_G : F_ATOMIC_2; + ".s64", ".min", atomic_load_min_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMIN_G_32 : F_ATOMIC_2; defm INT_PTX_ATOM_LOAD_UMIN_S_32 : F_ATOMIC_2; defm INT_PTX_ATOM_LOAD_UMIN_G_64 : F_ATOMIC_2; + ".min", atomic_load_umin_64_g, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMIN_S_64 : F_ATOMIC_2; + ".min", atomic_load_umin_64_s, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMIN_GEN_64 : F_ATOMIC_2; + atomic_load_umin_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_LOAD_UMIN_GEN_64_USE_G : F_ATOMIC_2; + ".u64", ".min", atomic_load_umin_64_gen, i64imm, imm, [hasSM32]>; // atom_inc atom_dec @@ -1798,13 +1798,13 @@ defm INT_PTX_ATOM_AND_GEN_32_USE_G : F_ATOMIC_2; defm INT_PTX_ATOM_AND_G_64 : F_ATOMIC_2; + atomic_load_and_64_g, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_AND_S_64 : F_ATOMIC_2; + atomic_load_and_64_s, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_AND_GEN_64 : F_ATOMIC_2; + atomic_load_and_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_AND_GEN_64_USE_G : F_ATOMIC_2; + ".and", atomic_load_and_64_gen, i64imm, imm, [hasSM32]>; // atom_or @@ -1830,13 +1830,13 @@ defm INT_PTX_ATOM_OR_S_32 : F_ATOMIC_2; defm INT_PTX_ATOM_OR_G_64 : F_ATOMIC_2; + atomic_load_or_64_g, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_OR_GEN_64 : F_ATOMIC_2; + atomic_load_or_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_OR_GEN_64_USE_G : F_ATOMIC_2; + ".or", atomic_load_or_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_OR_S_64 : F_ATOMIC_2; + atomic_load_or_64_s, i64imm, imm, [hasSM32]>; // atom_xor @@ -1862,13 +1862,13 @@ defm INT_PTX_ATOM_XOR_GEN_32_USE_G : F_ATOMIC_2; defm INT_PTX_ATOM_XOR_G_64 : F_ATOMIC_2; + atomic_load_xor_64_g, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_XOR_S_64 : F_ATOMIC_2; + atomic_load_xor_64_s, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_XOR_GEN_64 : F_ATOMIC_2; + atomic_load_xor_64_gen, i64imm, imm, [hasSM32]>; defm INT_PTX_ATOM_XOR_GEN_64_USE_G : F_ATOMIC_2; + ".xor", atomic_load_xor_64_gen, i64imm, imm, [hasSM32]>; // atom_cas diff --git a/llvm/test/CodeGen/NVPTX/atomics.ll b/llvm/test/CodeGen/NVPTX/atomics.ll --- a/llvm/test/CodeGen/NVPTX/atomics.ll +++ b/llvm/test/CodeGen/NVPTX/atomics.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s +; RUN: llc < %s -march=nvptx -mcpu=sm_32 | FileCheck %s ; CHECK-LABEL: atom0