blob: 74b73de6d65641890e7ceb56f85bb1f60bd36722 [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
21class GISelSop2Pat <
22 SDPatternOperator node,
23 Instruction inst,
24 ValueType dst_vt,
25 ValueType src0_vt = dst_vt, ValueType src1_vt = src0_vt> : GCNPat <
26
27 (dst_vt (node (src0_vt SReg_32:$src0), (src1_vt SReg_32:$src1))),
28 (inst src0_vt:$src0, src1_vt:$src1)
29>;
30
31class GISelVop2Pat <
32 SDPatternOperator node,
33 Instruction inst,
34 ValueType dst_vt,
35 ValueType src0_vt = dst_vt, ValueType src1_vt = src0_vt> : GCNPat <
36
37 (dst_vt (node (src0_vt (sd_vsrc0 src0_vt:$src0)), (src1_vt VGPR_32:$src1))),
38 (inst src0_vt:$src0, src1_vt:$src1)
39>;
40
41def : GISelSop2Pat <or, S_OR_B32, i32>;
42def : GISelVop2Pat <or, V_OR_B32_e32, i32>;