-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathInstructionsExt.td
97 lines (82 loc) · 5.36 KB
/
InstructionsExt.td
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//===-- InstructionsOCL.td - SPIRV Core Instructions -------*- tablegen -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// File contains prototypes for extensions instructions
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
// Float prototypes
//===----------------------------------------------------------------------===//
// float_t(float_t)
class ExtInstFPUnary<bits<32> op> : SPIRVInstruction<6,12,2,[oper_FloatVecScalType,oper_FloatVecScalVar,
oper_InstructionSet,oper_ImmInt32, // the opcode
oper_FloatVecScalVar]>
{ let Op2 = op; };
// float_t(float_t,float_t)
class ExtInstFPBinary<bits<32> op> : SPIRVInstruction<7,12,2,[oper_FloatVecScalType,oper_FloatVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_FloatVecScalVar,oper_FloatVecScalVar]>
{ let Op2 = op; };
// float_t(float_t,float_t,float_t)
class ExtInstFPTrinary<bits<32> op> : SPIRVInstruction<8,12,2,[oper_FloatVecScalType,oper_FloatVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_FloatVecScalVar,oper_FloatVecScalVar,
oper_FloatVecScalVar]>
{ let Op2 = op; };
// FIXME: Should be oper_FloatVecScalVarPointer / oper_Int32VecScalVarPointer
// See fract / frexp in InstructionOCL.td
// float_t(float_t,any*)
class ExtInstFP2ArgReturn<bits<32> op> : SPIRVInstruction<7,12,2,[oper_FloatVecScalType,oper_FloatVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_FloatVecScalVar,oper_AnyPointerVar]>
{ let Op2 = op; };
// i32_t(float_t)
class ExtInstFPtoI32<bits<32> op> : SPIRVInstruction<6,12,2,[oper_Int32VecScalType,oper_Int32VecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_FloatVecScalVar]>
{ let Op2 = op; };
// float_t(float_t,i32_t)
class ExtInstFPArgFPInt32<bits<32> op> : SPIRVInstruction<7,12,2,[oper_FloatVecScalType,oper_FloatVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_FloatVecScalVar,oper_Int32VecScalVar]>
{ let Op2 = op; };
// float_t(i32_t)
class ExtInstI32toFP<bits<32> op> : SPIRVInstruction<6,12,2,[oper_FloatVecScalType,oper_FloatVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_Int32VecScalVar]>
{ let Op2 = op; };
// float_t(float_t,float_t,any*)
class ExtInstFP2BinaryArgReturn<bits<32> op> : SPIRVInstruction<8,12,2,
[oper_FloatVecScalType,oper_FloatVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_FloatVecScalVar,oper_AnyPointerVar]>
{ let Op2 = op; };
//===----------------------------------------------------------------------===//
// Integer prototypes
//===----------------------------------------------------------------------===//
//int_t(int_t)
class ExtInstIntUnary<bits<32> op> : SPIRVInstruction<6,12,2, [oper_IntVecScalType,oper_IntVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_IntVecScalVar]>
{ let Op2 = op; };
//int_t(int_t,int_t)
class ExtInstIntBinary<bits<32> op> : SPIRVInstruction<7,12,2, [oper_IntVecScalType,oper_IntVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_IntVecScalVar,oper_IntVecScalVar]>
{ let Op2 = op; };
//int_t(int_t,int_t,int_t)
class ExtInstIntTrinary<bits<32> op> : SPIRVInstruction<8,12,2, [oper_IntVecScalType,oper_IntVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_IntVecScalVar,oper_IntVecScalVar,
oper_IntVecScalVar]>
{ let Op2 = op; };
//any_t(any_t,any_t,any_t)
class ExtInstAnyTrinary<bits<32> op> : SPIRVInstruction<8,12,2, [oper_AnyVecScalType,oper_AnyVecScalVar,
oper_InstructionSet,oper_ImmInt32,
oper_AnyVecScalVar,oper_AnyVecScalVar,
oper_AnyVecScalVar]>
{ let Op2 = op; };