forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NVPTX] Add support for [SHL,SRA,SRL]_PARTS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211936 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
10da165
commit 863b0d4
Showing
4 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s | ||
|
||
; CHECK: shift_parts_left_128 | ||
define void @shift_parts_left_128(i128* %val, i128* %amtptr) { | ||
; CHECK: shl.b64 | ||
; CHECK: mov.u32 | ||
; CHECK: sub.s32 | ||
; CHECK: shr.u64 | ||
; CHECK: or.b64 | ||
; CHECK: add.s32 | ||
; CHECK: shl.b64 | ||
; CHECK: setp.gt.s32 | ||
; CHECK: selp.b64 | ||
; CHECK: shl.b64 | ||
%amt = load i128* %amtptr | ||
%a = load i128* %val | ||
%val0 = shl i128 %a, %amt | ||
store i128 %val0, i128* %val | ||
ret void | ||
} | ||
|
||
; CHECK: shift_parts_right_128 | ||
define void @shift_parts_right_128(i128* %val, i128* %amtptr) { | ||
; CHECK: shr.u64 | ||
; CHECK: sub.s32 | ||
; CHECK: shl.b64 | ||
; CHECK: or.b64 | ||
; CHECK: add.s32 | ||
; CHECK: shr.s64 | ||
; CHECK: setp.gt.s32 | ||
; CHECK: selp.b64 | ||
; CHECK: shr.s64 | ||
%amt = load i128* %amtptr | ||
%a = load i128* %val | ||
%val0 = ashr i128 %a, %amt | ||
store i128 %val0, i128* %val | ||
ret void | ||
} |