| Tom Stellard | 1dc9020 | 2018-05-10 20:53:06 +0000 | [diff] [blame] | 1 | //===-- AMDGPUGIsel.td - AMDGPU GlobalISel Patterns---------*- tablegen -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // This files contains patterns that should only be used by GlobalISel. For |
| 10 | // example patterns for V_* instructions that have S_* equivalents. |
| 11 | // SelectionDAG does not support selecting V_* instructions. |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | include "AMDGPU.td" |
| 15 | |
| 16 | def sd_vsrc0 : ComplexPattern<i32, 1, "">; |
| 17 | def gi_vsrc0 : |
| 18 | GIComplexOperandMatcher<s32, "selectVSRC0">, |
| 19 | GIComplexPatternEquiv<sd_vsrc0>; |
| 20 | |
| Tom Stellard | dcc95e9 | 2018-05-11 05:44:16 +0000 | [diff] [blame^] | 21 | def gi_vop3mods0 : |
| 22 | GIComplexOperandMatcher<s32, "selectVOP3Mods0">, |
| 23 | GIComplexPatternEquiv<VOP3Mods0>; |
| 24 | |
| Tom Stellard | 1dc9020 | 2018-05-10 20:53:06 +0000 | [diff] [blame] | 25 | class GISelSop2Pat < |
| 26 | SDPatternOperator node, |
| 27 | Instruction inst, |
| 28 | ValueType dst_vt, |
| 29 | ValueType src0_vt = dst_vt, ValueType src1_vt = src0_vt> : GCNPat < |
| 30 | |
| 31 | (dst_vt (node (src0_vt SReg_32:$src0), (src1_vt SReg_32:$src1))), |
| 32 | (inst src0_vt:$src0, src1_vt:$src1) |
| 33 | >; |
| 34 | |
| 35 | class GISelVop2Pat < |
| 36 | SDPatternOperator node, |
| 37 | Instruction inst, |
| 38 | ValueType dst_vt, |
| 39 | ValueType src0_vt = dst_vt, ValueType src1_vt = src0_vt> : GCNPat < |
| 40 | |
| 41 | (dst_vt (node (src0_vt (sd_vsrc0 src0_vt:$src0)), (src1_vt VGPR_32:$src1))), |
| 42 | (inst src0_vt:$src0, src1_vt:$src1) |
| 43 | >; |
| 44 | |
| 45 | def : GISelSop2Pat <or, S_OR_B32, i32>; |
| 46 | def : GISelVop2Pat <or, V_OR_B32_e32, i32>; |