summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/opcode.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/frontend/ir/opcode.inc')
-rw-r--r--src/shader_recompiler/frontend/ir/opcode.inc142
1 files changed, 142 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/opcode.inc b/src/shader_recompiler/frontend/ir/opcode.inc
new file mode 100644
index 000000000..371064bf3
--- /dev/null
+++ b/src/shader_recompiler/frontend/ir/opcode.inc
@@ -0,0 +1,142 @@
1// Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5// opcode name, return type, arg1 type, arg2 type, arg3 type, arg4 type, ...
6OPCODE(Void, Void, )
7OPCODE(Identity, Opaque, Opaque, )
8
9// Control flow
10OPCODE(Branch, Void, Label, )
11OPCODE(BranchConditional, Void, U1, Label, Label, )
12OPCODE(Exit, Void, )
13OPCODE(Return, Void, )
14OPCODE(Unreachable, Void, )
15
16// Context getters/setters
17OPCODE(GetRegister, U32, Reg, )
18OPCODE(SetRegister, Void, Reg, U32, )
19OPCODE(GetPred, U1, Pred, )
20OPCODE(SetPred, Void, Pred, U1, )
21OPCODE(GetCbuf, U32, U32, U32, )
22OPCODE(GetAttribute, U32, Attribute, )
23OPCODE(SetAttribute, U32, Attribute, )
24OPCODE(GetAttributeIndexed, U32, U32, )
25OPCODE(SetAttributeIndexed, U32, U32, )
26OPCODE(GetZSCORaw, U32, )
27OPCODE(SetZSCORaw, Void, U32, )
28OPCODE(SetZSCO, Void, ZSCO, )
29OPCODE(GetZFlag, U1, Void, )
30OPCODE(GetSFlag, U1, Void, )
31OPCODE(GetCFlag, U1, Void, )
32OPCODE(GetOFlag, U1, Void, )
33OPCODE(SetZFlag, Void, U1, )
34OPCODE(SetSFlag, Void, U1, )
35OPCODE(SetCFlag, Void, U1, )
36OPCODE(SetOFlag, Void, U1, )
37
38// Memory operations
39OPCODE(WriteGlobalU8, Void, U64, U32, )
40OPCODE(WriteGlobalS8, Void, U64, U32, )
41OPCODE(WriteGlobalU16, Void, U64, U32, )
42OPCODE(WriteGlobalS16, Void, U64, U32, )
43OPCODE(WriteGlobal32, Void, U64, U32, )
44OPCODE(WriteGlobal64, Void, U64, Opaque, )
45OPCODE(WriteGlobal128, Void, U64, Opaque, )
46
47// Vector utility
48OPCODE(CompositeConstruct2, Opaque, Opaque, Opaque, )
49OPCODE(CompositeConstruct3, Opaque, Opaque, Opaque, Opaque, )
50OPCODE(CompositeConstruct4, Opaque, Opaque, Opaque, Opaque, Opaque, )
51OPCODE(CompositeExtract, Opaque, Opaque, U32, )
52
53// Bitwise conversions
54OPCODE(PackUint2x32, U64, Opaque, )
55OPCODE(UnpackUint2x32, Opaque, U64, )
56OPCODE(PackFloat2x16, U32, Opaque, )
57OPCODE(UnpackFloat2x16, Opaque, U32, )
58OPCODE(PackDouble2x32, U64, Opaque, )
59OPCODE(UnpackDouble2x32, Opaque, U64, )
60
61// Pseudo-operation, handled specially at final emit
62OPCODE(GetZeroFromOp, U1, Opaque, )
63OPCODE(GetSignFromOp, U1, Opaque, )
64OPCODE(GetCarryFromOp, U1, Opaque, )
65OPCODE(GetOverflowFromOp, U1, Opaque, )
66OPCODE(GetZSCOFromOp, ZSCO, Opaque, )
67
68// Floating-point operations
69OPCODE(FPAbs16, U16, U16 )
70OPCODE(FPAbs32, U32, U32 )
71OPCODE(FPAbs64, U64, U64 )
72OPCODE(FPAdd16, U16, U16, U16 )
73OPCODE(FPAdd32, U32, U32, U32 )
74OPCODE(FPAdd64, U64, U64, U64 )
75OPCODE(FPFma16, U16, U16, U16 )
76OPCODE(FPFma32, U32, U32, U32 )
77OPCODE(FPFma64, U64, U64, U64 )
78OPCODE(FPMax32, U32, U32, U32 )
79OPCODE(FPMax64, U64, U64, U64 )
80OPCODE(FPMin32, U32, U32, U32 )
81OPCODE(FPMin64, U64, U64, U64 )
82OPCODE(FPMul16, U16, U16, U16 )
83OPCODE(FPMul32, U32, U32, U32 )
84OPCODE(FPMul64, U64, U64, U64 )
85OPCODE(FPNeg16, U16, U16 )
86OPCODE(FPNeg32, U32, U32 )
87OPCODE(FPNeg64, U64, U64 )
88OPCODE(FPRecip32, U32, U32 )
89OPCODE(FPRecip64, U64, U64 )
90OPCODE(FPRecipSqrt32, U32, U32 )
91OPCODE(FPRecipSqrt64, U64, U64 )
92OPCODE(FPSqrt, U32, U32 )
93OPCODE(FPSin, U32, U32 )
94OPCODE(FPSinNotReduced, U32, U32 )
95OPCODE(FPExp2, U32, U32 )
96OPCODE(FPExp2NotReduced, U32, U32 )
97OPCODE(FPCos, U32, U32 )
98OPCODE(FPCosNotReduced, U32, U32 )
99OPCODE(FPLog2, U32, U32 )
100OPCODE(FPSaturate16, U16, U16 )
101OPCODE(FPSaturate32, U32, U32 )
102OPCODE(FPSaturate64, U64, U64 )
103OPCODE(FPRoundEven16, U16, U16 )
104OPCODE(FPRoundEven32, U32, U32 )
105OPCODE(FPRoundEven64, U64, U64 )
106OPCODE(FPFloor16, U16, U16 )
107OPCODE(FPFloor32, U32, U32 )
108OPCODE(FPFloor64, U64, U64 )
109OPCODE(FPCeil16, U16, U16 )
110OPCODE(FPCeil32, U32, U32 )
111OPCODE(FPCeil64, U64, U64 )
112OPCODE(FPTrunc16, U16, U16 )
113OPCODE(FPTrunc32, U32, U32 )
114OPCODE(FPTrunc64, U64, U64 )
115
116// Logical operations
117OPCODE(LogicalOr, U1, U1, U1, )
118OPCODE(LogicalAnd, U1, U1, U1, )
119OPCODE(LogicalNot, U1, U1, )
120
121// Conversion operations
122OPCODE(ConvertS16F16, U32, U16, )
123OPCODE(ConvertS16F32, U32, U32, )
124OPCODE(ConvertS16F64, U32, U64, )
125OPCODE(ConvertS32F16, U32, U16, )
126OPCODE(ConvertS32F32, U32, U32, )
127OPCODE(ConvertS32F64, U32, U64, )
128OPCODE(ConvertS64F16, U64, U16, )
129OPCODE(ConvertS64F32, U64, U32, )
130OPCODE(ConvertS64F64, U64, U64, )
131OPCODE(ConvertU16F16, U32, U16, )
132OPCODE(ConvertU16F32, U32, U32, )
133OPCODE(ConvertU16F64, U32, U64, )
134OPCODE(ConvertU32F16, U32, U16, )
135OPCODE(ConvertU32F32, U32, U32, )
136OPCODE(ConvertU32F64, U32, U64, )
137OPCODE(ConvertU64F16, U64, U16, )
138OPCODE(ConvertU64F32, U64, U32, )
139OPCODE(ConvertU64F64, U64, U64, )
140
141OPCODE(ConvertU64U32, U64, U32, )
142OPCODE(ConvertU32U64, U32, U64, )