diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2013-04-19 02:11:06 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2013-04-19 02:11:06 +0000 |
| commit | 9d10c4ce86d3b9f64f96c34c4f96202cc4497ed9 (patch) | |
| tree | 18f745b8b66685ebebdf4475c43b313b96ee4ccd /llvm/test/CodeGen | |
| parent | ea977bc0e37395f0a2b6c00b8d33c4d90ac126e2 (diff) | |
| download | bcm5719-llvm-9d10c4ce86d3b9f64f96c34c4f96202cc4497ed9.tar.gz bcm5719-llvm-9d10c4ce86d3b9f64f96c34c4f96202cc4497ed9.zip | |
R600: Add pattern for the BFI_INT instruction
llvm-svn: 179830
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/R600/bfi_int.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/R600/bfi_int.ll b/llvm/test/CodeGen/R600/bfi_int.ll new file mode 100644 index 00000000000..c9015a6e78a --- /dev/null +++ b/llvm/test/CodeGen/R600/bfi_int.ll @@ -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 +} |

