blob: c9dfbafab0c37cae65e219dcfa219412dffaf968 [file] [log] [blame]
Tom Stellard1dc90202018-05-10 20:53:06 +00001//===-- 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
14include "AMDGPU.td"
15
16def sd_vsrc0 : ComplexPattern<i32, 1, "">;
17def gi_vsrc0 :
18 GIComplexOperandMatcher<s32, "selectVSRC0">,
19 GIComplexPatternEquiv<sd_vsrc0>;
20
Tom Stellarddcc95e92018-05-11 05:44:16 +000021def gi_vop3mods0 :
22 GIComplexOperandMatcher<s32, "selectVOP3Mods0">,
23 GIComplexPatternEquiv<VOP3Mods0>;
24
Tom Stellard1dc90202018-05-10 20:53:06 +000025class 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
35class 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
45def : GISelSop2Pat <or, S_OR_B32, i32>;
46def : GISelVop2Pat <or, V_OR_B32_e32, i32>;