Skip to content

Commit

Permalink
[NVPTX][Fix] Ensure the return value of 'activemask' is unsigned
Browse files Browse the repository at this point in the history
Summary:
The previous patch missed the `U` prefix, which caused the mask to be
considered signed. This meant that conversions would incorrectly treat a
full mask as a negative number and break things.
  • Loading branch information
jhuber6 committed Jan 29, 2024
1 parent 0461448 commit 0a2b5b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/include/clang/Basic/BuiltinsNVPTX.def
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ BUILTIN(__nvvm_read_ptx_sreg_pm3, "i", "n")

BUILTIN(__nvvm_prmt, "UiUiUiUi", "")
BUILTIN(__nvvm_exit, "v", "r")
TARGET_BUILTIN(__nvvm_nanosleep, "vi", "n", AND(SM_70, PTX63))
TARGET_BUILTIN(__nvvm_nanosleep, "vUi", "n", AND(SM_70, PTX63))

// Min Max

Expand Down Expand Up @@ -638,7 +638,7 @@ TARGET_BUILTIN(__nvvm_vote_uni_sync, "bUib", "", PTX60)
TARGET_BUILTIN(__nvvm_vote_ballot_sync, "UiUib", "", PTX60)

// Mask
TARGET_BUILTIN(__nvvm_activemask, "i", "n", PTX62)
TARGET_BUILTIN(__nvvm_activemask, "Ui", "n", PTX62)

// Match
TARGET_BUILTIN(__nvvm_match_any_sync_i32, "UiUiUi", "", AND(SM_70,PTX60))
Expand Down

0 comments on commit 0a2b5b0

Please sign in to comment.