From 48b809e6e5cf4a7d1b876ac1d56a9e32df506f76 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 19 Apr 2013 02:11:06 +0000 Subject: 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 --- lib/Target/R600/AMDGPUInstructions.td | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/Target/R600/AMDGPUInstructions.td') diff --git a/lib/Target/R600/AMDGPUInstructions.td b/lib/Target/R600/AMDGPUInstructions.td index fa890c1..4b37a53 100644 --- a/lib/Target/R600/AMDGPUInstructions.td +++ b/lib/Target/R600/AMDGPUInstructions.td @@ -261,6 +261,26 @@ class DwordAddrPat : Pat < (vt rc:$addr) >; +// BFI_INT patterns + +multiclass BFIPatterns { + + // Definition from ISA doc: + // (y & x) | (z & ~x) + def : Pat < + (or (and i32:$y, i32:$x), (and i32:$z, (not i32:$x))), + (BFI_INT $x, $y, $z) + >; + + // SHA-256 Ch function + // z ^ (x & (y ^ z)) + def : Pat < + (xor i32:$z, (and i32:$x, (xor i32:$y, i32:$z))), + (BFI_INT $x, $y, $z) + >; + +} + include "R600Instructions.td" include "SIInstrInfo.td" -- cgit v1.1