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.
R600: Add pattern for the BFI_INT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179830 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
ae2a892
commit 48b809e
Showing
4 changed files
with
58 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,34 @@ | ||
; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=R600-CHECK %s | ||
; RUN: llc < %s -march=r600 -mcpu=SI | FileCheck --check-prefix=SI-CHECK %s | ||
|
||
; BFI_INT Definition pattern from ISA docs | ||
; (y & x) | (z & ~x) | ||
; | ||
; R600-CHECK: @bfi_def | ||
; R600-CHECK: BFI_INT | ||
; SI-CHECK: @bfi_def | ||
; SI-CHECK: V_BFI_B32 | ||
define void @bfi_def(i32 addrspace(1)* %out, i32 %x, i32 %y, i32 %z) { | ||
entry: | ||
%0 = xor i32 %x, -1 | ||
%1 = and i32 %z, %0 | ||
%2 = and i32 %y, %x | ||
%3 = or i32 %1, %2 | ||
store i32 %3, i32 addrspace(1)* %out | ||
ret void | ||
} | ||
|
||
; SHA-256 Ch function | ||
; z ^ (x & (y ^ z)) | ||
; R600-CHECK: @bfi_sha256_ch | ||
; R600-CHECK: BFI_INT | ||
; SI-CHECK: @bfi_sha256_ch | ||
; SI-CHECK: V_BFI_B32 | ||
define void @bfi_sha256_ch(i32 addrspace(1)* %out, i32 %x, i32 %y, i32 %z) { | ||
entry: | ||
%0 = xor i32 %y, %z | ||
%1 = and i32 %x, %0 | ||
%2 = xor i32 %z, %1 | ||
store i32 %2, i32 addrspace(1)* %out | ||
ret void | ||
} |