OLD | NEW |
1 //===-- AMDGPUInstructions.td - Common instruction defs ---*- tablegen -*-===// | 1 //===-- AMDGPUInstructions.td - Common instruction defs ---*- tablegen -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file contains instruction defs that are common to all hw codegen | 10 // This file contains instruction defs that are common to all hw codegen |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } | 277 } |
278 | 278 |
279 // SHA-256 Ma patterns | 279 // SHA-256 Ma patterns |
280 | 280 |
281 // ((x & z) | (y & (x | z))) -> BFI_INT (XOR x, y), z, y | 281 // ((x & z) | (y & (x | z))) -> BFI_INT (XOR x, y), z, y |
282 class SHA256MaPattern <Instruction BFI_INT, Instruction XOR> : Pat < | 282 class SHA256MaPattern <Instruction BFI_INT, Instruction XOR> : Pat < |
283 (or (and i32:$x, i32:$z), (and i32:$y, (or i32:$x, i32:$z))), | 283 (or (and i32:$x, i32:$z), (and i32:$y, (or i32:$x, i32:$z))), |
284 (BFI_INT (XOR i32:$x, i32:$y), i32:$z, i32:$y) | 284 (BFI_INT (XOR i32:$x, i32:$y), i32:$z, i32:$y) |
285 >; | 285 >; |
286 | 286 |
287 // Bitfield extract patterns | |
288 | |
289 def legalshift32 : ImmLeaf <i32, [{return Imm >=0 && Imm < 32;}]>; | |
290 def bfemask : PatLeaf <(imm), [{return isMask_32(N->getZExtValue());}], | |
291 SDNodeXForm<imm, [{ return CurDAG->getTargetConstant
(CountTrailingOnes_32(N->getZExtValue()), MVT::i32);}]>>; | |
292 | |
293 class BFEPattern <Instruction BFE> : Pat < | |
294 (and (srl i32:$x, legalshift32:$y), bfemask:$z), | |
295 (BFE $x, $y, $z) | |
296 >; | |
297 | |
298 include "R600Instructions.td" | 287 include "R600Instructions.td" |
299 | 288 |
300 include "SIInstrInfo.td" | 289 include "SIInstrInfo.td" |
301 | 290 |
OLD | NEW |