[PATCH] D124698: [NVPTX] Add add.cc/addc.cc/sub.cc/subc.cc for i64

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 15:03:08 PDT 2022


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM. 
Nice. We could use a bit more tests, though.



================
Comment at: llvm/test/CodeGen/NVPTX/add-sub-128bit.ll:3
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 -mattr=+ptx43 | FileCheck %s --check-prefixes=CHECK,PTX43
+; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
+
----------------
We should add ptxas test for ptx43+ here, too.


================
Comment at: llvm/test/CodeGen/NVPTX/add-sub-128bit.ll:7
+
+; CHECK-LABEL: test_add
+define i128 @test_add(i128 %a, i128 %b) {
----------------
CHECK -> COMMON
DEFAULT -> NOCARRY
PTX34 -> CARRY



================
Comment at: llvm/test/CodeGen/NVPTX/add-sub-128bit.ll:8
+; CHECK-LABEL: test_add
+define i128 @test_add(i128 %a, i128 %b) {
+; DEFAULT:        add.s64
----------------
Can you think of a way to test 32-bit sub/add-with-carry that the patch makes legal? 
We can't use the same approach as we do here with i128 as we'd just end up with a regular 64-bit add/sub.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124698/new/

https://reviews.llvm.org/D124698



More information about the llvm-commits mailing list