diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2013-05-03 17:21:20 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-05-03 17:21:20 +0000 |
commit | 83f0a5a5e8e132b3ce39f15ed2583ad344b88ec4 (patch) | |
tree | 724d830066a560147a6f33911b837b5e16213171 /test | |
parent | 218b20a81e28ab069dd69684f1a8208ec8e1704c (diff) |
R600: Add pattern for SHA-256 Ma function
This can be optimized using the BFI_INT instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/R600/bfi_int.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/R600/bfi_int.ll b/test/CodeGen/R600/bfi_int.ll index c9015a6e78..4244dcf3c7 100644 --- a/test/CodeGen/R600/bfi_int.ll +++ b/test/CodeGen/R600/bfi_int.ll @@ -32,3 +32,21 @@ entry: store i32 %2, i32 addrspace(1)* %out ret void } + +; SHA-256 Ma function +; ((x & z) | (y & (x | z))) +; R600-CHECK: @bfi_sha256_ma +; R600-CHECK: XOR_INT * [[DST:T[0-9]+\.[XYZW]]], {{T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} +; R600-CHECK: BFI_INT * {{T[0-9]+\.[XYZW]}}, {{[[DST]]|PV.x}}, {{T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} +; SI-CHECK: V_XOR_B32_e32 [[DST:VGPR[0-9]+]], {{VGPR[0-9]+, VGPR[0-9]+}} +; SI-CHECK: V_BFI_B32 {{VGPR[0-9]+}}, [[DST]], {{VGPR[0-9]+, VGPR[0-9]+}} + +define void @bfi_sha256_ma(i32 addrspace(1)* %out, i32 %x, i32 %y, i32 %z) { +entry: + %0 = and i32 %x, %z + %1 = or i32 %x, %z + %2 = and i32 %y, %1 + %3 = or i32 %0, %2 + store i32 %3, i32 addrspace(1)* %out + ret void +} |