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.inc200
1 files changed, 113 insertions, 87 deletions
diff --git a/src/shader_recompiler/frontend/ir/opcode.inc b/src/shader_recompiler/frontend/ir/opcode.inc
index 4596bf39f..6eb105d92 100644
--- a/src/shader_recompiler/frontend/ir/opcode.inc
+++ b/src/shader_recompiler/frontend/ir/opcode.inc
@@ -52,15 +52,15 @@ OPCODE(LoadGlobalS8, U32, U64,
52OPCODE(LoadGlobalU16, U32, U64, ) 52OPCODE(LoadGlobalU16, U32, U64, )
53OPCODE(LoadGlobalS16, U32, U64, ) 53OPCODE(LoadGlobalS16, U32, U64, )
54OPCODE(LoadGlobal32, U32, U64, ) 54OPCODE(LoadGlobal32, U32, U64, )
55OPCODE(LoadGlobal64, Opaque, U64, ) 55OPCODE(LoadGlobal64, U32x2, U64, )
56OPCODE(LoadGlobal128, Opaque, U64, ) 56OPCODE(LoadGlobal128, U32x4, U64, )
57OPCODE(WriteGlobalU8, Void, U64, U32, ) 57OPCODE(WriteGlobalU8, Void, U64, U32, )
58OPCODE(WriteGlobalS8, Void, U64, U32, ) 58OPCODE(WriteGlobalS8, Void, U64, U32, )
59OPCODE(WriteGlobalU16, Void, U64, U32, ) 59OPCODE(WriteGlobalU16, Void, U64, U32, )
60OPCODE(WriteGlobalS16, Void, U64, U32, ) 60OPCODE(WriteGlobalS16, Void, U64, U32, )
61OPCODE(WriteGlobal32, Void, U64, U32, ) 61OPCODE(WriteGlobal32, Void, U64, U32, )
62OPCODE(WriteGlobal64, Void, U64, Opaque, ) 62OPCODE(WriteGlobal64, Void, U64, U32x2, )
63OPCODE(WriteGlobal128, Void, U64, Opaque, ) 63OPCODE(WriteGlobal128, Void, U64, U32x4, )
64 64
65// Storage buffer operations 65// Storage buffer operations
66OPCODE(LoadStorageU8, U32, U32, U32, ) 66OPCODE(LoadStorageU8, U32, U32, U32, )
@@ -68,21 +68,41 @@ OPCODE(LoadStorageS8, U32, U32,
68OPCODE(LoadStorageU16, U32, U32, U32, ) 68OPCODE(LoadStorageU16, U32, U32, U32, )
69OPCODE(LoadStorageS16, U32, U32, U32, ) 69OPCODE(LoadStorageS16, U32, U32, U32, )
70OPCODE(LoadStorage32, U32, U32, U32, ) 70OPCODE(LoadStorage32, U32, U32, U32, )
71OPCODE(LoadStorage64, Opaque, U32, U32, ) 71OPCODE(LoadStorage64, U32x2, U32, U32, )
72OPCODE(LoadStorage128, Opaque, U32, U32, ) 72OPCODE(LoadStorage128, U32x4, U32, U32, )
73OPCODE(WriteStorageU8, Void, U32, U32, U32, ) 73OPCODE(WriteStorageU8, Void, U32, U32, U32, )
74OPCODE(WriteStorageS8, Void, U32, U32, U32, ) 74OPCODE(WriteStorageS8, Void, U32, U32, U32, )
75OPCODE(WriteStorageU16, Void, U32, U32, U32, ) 75OPCODE(WriteStorageU16, Void, U32, U32, U32, )
76OPCODE(WriteStorageS16, Void, U32, U32, U32, ) 76OPCODE(WriteStorageS16, Void, U32, U32, U32, )
77OPCODE(WriteStorage32, Void, U32, U32, U32, ) 77OPCODE(WriteStorage32, Void, U32, U32, U32, )
78OPCODE(WriteStorage64, Void, U32, U32, Opaque, ) 78OPCODE(WriteStorage64, Void, U32, U32, U32x2, )
79OPCODE(WriteStorage128, Void, U32, U32, Opaque, ) 79OPCODE(WriteStorage128, Void, U32, U32, U32x4, )
80 80
81// Vector utility 81// Vector utility
82OPCODE(CompositeConstruct2, Opaque, Opaque, Opaque, ) 82OPCODE(CompositeConstructU32x2, U32x2, U32, U32, )
83OPCODE(CompositeConstruct3, Opaque, Opaque, Opaque, Opaque, ) 83OPCODE(CompositeConstructU32x3, U32x3, U32, U32, U32, )
84OPCODE(CompositeConstruct4, Opaque, Opaque, Opaque, Opaque, Opaque, ) 84OPCODE(CompositeConstructU32x4, U32x4, U32, U32, U32, U32, )
85OPCODE(CompositeExtract, Opaque, Opaque, U32, ) 85OPCODE(CompositeExtractU32x2, U32, U32x2, U32, )
86OPCODE(CompositeExtractU32x3, U32, U32x3, U32, )
87OPCODE(CompositeExtractU32x4, U32, U32x4, U32, )
88OPCODE(CompositeConstructF16x2, F16x2, F16, F16, )
89OPCODE(CompositeConstructF16x3, F16x3, F16, F16, F16, )
90OPCODE(CompositeConstructF16x4, F16x4, F16, F16, F16, F16, )
91OPCODE(CompositeExtractF16x2, F16, F16x2, U32, )
92OPCODE(CompositeExtractF16x3, F16, F16x3, U32, )
93OPCODE(CompositeExtractF16x4, F16, F16x4, U32, )
94OPCODE(CompositeConstructF32x2, F32x2, F32, F32, )
95OPCODE(CompositeConstructF32x3, F32x3, F32, F32, F32, )
96OPCODE(CompositeConstructF32x4, F32x4, F32, F32, F32, F32, )
97OPCODE(CompositeExtractF32x2, F32, F32x2, U32, )
98OPCODE(CompositeExtractF32x3, F32, F32x3, U32, )
99OPCODE(CompositeExtractF32x4, F32, F32x4, U32, )
100OPCODE(CompositeConstructF64x2, F64x2, F64, F64, )
101OPCODE(CompositeConstructF64x3, F64x3, F64, F64, F64, )
102OPCODE(CompositeConstructF64x4, F64x4, F64, F64, F64, F64, )
103OPCODE(CompositeExtractF64x2, F64, F64x2, U32, )
104OPCODE(CompositeExtractF64x3, F64, F64x3, U32, )
105OPCODE(CompositeExtractF64x4, F64, F64x4, U32, )
86 106
87// Select operations 107// Select operations
88OPCODE(Select8, U8, U1, U8, U8, ) 108OPCODE(Select8, U8, U1, U8, U8, )
@@ -91,12 +111,18 @@ OPCODE(Select32, U32, U1,
91OPCODE(Select64, U64, U1, U64, U64, ) 111OPCODE(Select64, U64, U1, U64, U64, )
92 112
93// Bitwise conversions 113// Bitwise conversions
94OPCODE(PackUint2x32, U64, Opaque, ) 114OPCODE(BitCastU16F16, U16, F16, )
95OPCODE(UnpackUint2x32, Opaque, U64, ) 115OPCODE(BitCastU32F32, U32, F32, )
96OPCODE(PackFloat2x16, U32, Opaque, ) 116OPCODE(BitCastU64F64, U64, F64, )
97OPCODE(UnpackFloat2x16, Opaque, U32, ) 117OPCODE(BitCastF16U16, F16, U16, )
98OPCODE(PackDouble2x32, U64, Opaque, ) 118OPCODE(BitCastF32U32, F32, U32, )
99OPCODE(UnpackDouble2x32, Opaque, U64, ) 119OPCODE(BitCastF64U64, F64, U64, )
120OPCODE(PackUint2x32, U64, U32x2, )
121OPCODE(UnpackUint2x32, U32x2, U64, )
122OPCODE(PackFloat2x16, U32, F16x2, )
123OPCODE(UnpackFloat2x16, F16x2, U32, )
124OPCODE(PackDouble2x32, U64, U32x2, )
125OPCODE(UnpackDouble2x32, U32x2, U64, )
100 126
101// Pseudo-operation, handled specially at final emit 127// Pseudo-operation, handled specially at final emit
102OPCODE(GetZeroFromOp, U1, Opaque, ) 128OPCODE(GetZeroFromOp, U1, Opaque, )
@@ -105,52 +131,52 @@ OPCODE(GetCarryFromOp, U1, Opaq
105OPCODE(GetOverflowFromOp, U1, Opaque, ) 131OPCODE(GetOverflowFromOp, U1, Opaque, )
106 132
107// Floating-point operations 133// Floating-point operations
108OPCODE(FPAbs16, U16, U16, ) 134OPCODE(FPAbs16, F16, F16, )
109OPCODE(FPAbs32, U32, U32, ) 135OPCODE(FPAbs32, F32, F32, )
110OPCODE(FPAbs64, U64, U64, ) 136OPCODE(FPAbs64, F64, F64, )
111OPCODE(FPAdd16, U16, U16, U16, ) 137OPCODE(FPAdd16, F16, F16, F16, )
112OPCODE(FPAdd32, U32, U32, U32, ) 138OPCODE(FPAdd32, F32, F32, F32, )
113OPCODE(FPAdd64, U64, U64, U64, ) 139OPCODE(FPAdd64, F64, F64, F64, )
114OPCODE(FPFma16, U16, U16, U16, U16, ) 140OPCODE(FPFma16, F16, F16, F16, F16, )
115OPCODE(FPFma32, U32, U32, U32, U32, ) 141OPCODE(FPFma32, F32, F32, F32, F32, )
116OPCODE(FPFma64, U64, U64, U64, U64, ) 142OPCODE(FPFma64, F64, F64, F64, F64, )
117OPCODE(FPMax32, U32, U32, U32, ) 143OPCODE(FPMax32, F32, F32, F32, )
118OPCODE(FPMax64, U64, U64, U64, ) 144OPCODE(FPMax64, F64, F64, F64, )
119OPCODE(FPMin32, U32, U32, U32, ) 145OPCODE(FPMin32, F32, F32, F32, )
120OPCODE(FPMin64, U64, U64, U64, ) 146OPCODE(FPMin64, F64, F64, F64, )
121OPCODE(FPMul16, U16, U16, U16, ) 147OPCODE(FPMul16, F16, F16, F16, )
122OPCODE(FPMul32, U32, U32, U32, ) 148OPCODE(FPMul32, F32, F32, F32, )
123OPCODE(FPMul64, U64, U64, U64, ) 149OPCODE(FPMul64, F64, F64, F64, )
124OPCODE(FPNeg16, U16, U16, ) 150OPCODE(FPNeg16, F16, F16, )
125OPCODE(FPNeg32, U32, U32, ) 151OPCODE(FPNeg32, F32, F32, )
126OPCODE(FPNeg64, U64, U64, ) 152OPCODE(FPNeg64, F64, F64, )
127OPCODE(FPRecip32, U32, U32, ) 153OPCODE(FPRecip32, F32, F32, )
128OPCODE(FPRecip64, U64, U64, ) 154OPCODE(FPRecip64, F64, F64, )
129OPCODE(FPRecipSqrt32, U32, U32, ) 155OPCODE(FPRecipSqrt32, F32, F32, )
130OPCODE(FPRecipSqrt64, U64, U64, ) 156OPCODE(FPRecipSqrt64, F64, F64, )
131OPCODE(FPSqrt, U32, U32, ) 157OPCODE(FPSqrt, F32, F32, )
132OPCODE(FPSin, U32, U32, ) 158OPCODE(FPSin, F32, F32, )
133OPCODE(FPSinNotReduced, U32, U32, ) 159OPCODE(FPSinNotReduced, F32, F32, )
134OPCODE(FPExp2, U32, U32, ) 160OPCODE(FPExp2, F32, F32, )
135OPCODE(FPExp2NotReduced, U32, U32, ) 161OPCODE(FPExp2NotReduced, F32, F32, )
136OPCODE(FPCos, U32, U32, ) 162OPCODE(FPCos, F32, F32, )
137OPCODE(FPCosNotReduced, U32, U32, ) 163OPCODE(FPCosNotReduced, F32, F32, )
138OPCODE(FPLog2, U32, U32, ) 164OPCODE(FPLog2, F32, F32, )
139OPCODE(FPSaturate16, U16, U16, ) 165OPCODE(FPSaturate16, F16, F16, )
140OPCODE(FPSaturate32, U32, U32, ) 166OPCODE(FPSaturate32, F32, F32, )
141OPCODE(FPSaturate64, U64, U64, ) 167OPCODE(FPSaturate64, F64, F64, )
142OPCODE(FPRoundEven16, U16, U16, ) 168OPCODE(FPRoundEven16, F16, F16, )
143OPCODE(FPRoundEven32, U32, U32, ) 169OPCODE(FPRoundEven32, F32, F32, )
144OPCODE(FPRoundEven64, U64, U64, ) 170OPCODE(FPRoundEven64, F64, F64, )
145OPCODE(FPFloor16, U16, U16, ) 171OPCODE(FPFloor16, F16, F16, )
146OPCODE(FPFloor32, U32, U32, ) 172OPCODE(FPFloor32, F32, F32, )
147OPCODE(FPFloor64, U64, U64, ) 173OPCODE(FPFloor64, F64, F64, )
148OPCODE(FPCeil16, U16, U16, ) 174OPCODE(FPCeil16, F16, F16, )
149OPCODE(FPCeil32, U32, U32, ) 175OPCODE(FPCeil32, F32, F32, )
150OPCODE(FPCeil64, U64, U64, ) 176OPCODE(FPCeil64, F64, F64, )
151OPCODE(FPTrunc16, U16, U16, ) 177OPCODE(FPTrunc16, F16, F16, )
152OPCODE(FPTrunc32, U32, U32, ) 178OPCODE(FPTrunc32, F32, F32, )
153OPCODE(FPTrunc64, U64, U64, ) 179OPCODE(FPTrunc64, F64, F64, )
154 180
155// Integer operations 181// Integer operations
156OPCODE(IAdd32, U32, U32, U32, ) 182OPCODE(IAdd32, U32, U32, U32, )
@@ -188,24 +214,24 @@ OPCODE(LogicalXor, U1, U1,
188OPCODE(LogicalNot, U1, U1, ) 214OPCODE(LogicalNot, U1, U1, )
189 215
190// Conversion operations 216// Conversion operations
191OPCODE(ConvertS16F16, U32, U16, ) 217OPCODE(ConvertS16F16, U32, F16, )
192OPCODE(ConvertS16F32, U32, U32, ) 218OPCODE(ConvertS16F32, U32, F32, )
193OPCODE(ConvertS16F64, U32, U64, ) 219OPCODE(ConvertS16F64, U32, F64, )
194OPCODE(ConvertS32F16, U32, U16, ) 220OPCODE(ConvertS32F16, U32, F16, )
195OPCODE(ConvertS32F32, U32, U32, ) 221OPCODE(ConvertS32F32, U32, F32, )
196OPCODE(ConvertS32F64, U32, U64, ) 222OPCODE(ConvertS32F64, U32, F64, )
197OPCODE(ConvertS64F16, U64, U16, ) 223OPCODE(ConvertS64F16, U64, F16, )
198OPCODE(ConvertS64F32, U64, U32, ) 224OPCODE(ConvertS64F32, U64, F32, )
199OPCODE(ConvertS64F64, U64, U64, ) 225OPCODE(ConvertS64F64, U64, F64, )
200OPCODE(ConvertU16F16, U32, U16, ) 226OPCODE(ConvertU16F16, U32, F16, )
201OPCODE(ConvertU16F32, U32, U32, ) 227OPCODE(ConvertU16F32, U32, F32, )
202OPCODE(ConvertU16F64, U32, U64, ) 228OPCODE(ConvertU16F64, U32, F64, )
203OPCODE(ConvertU32F16, U32, U16, ) 229OPCODE(ConvertU32F16, U32, F16, )
204OPCODE(ConvertU32F32, U32, U32, ) 230OPCODE(ConvertU32F32, U32, F32, )
205OPCODE(ConvertU32F64, U32, U64, ) 231OPCODE(ConvertU32F64, U32, F64, )
206OPCODE(ConvertU64F16, U64, U16, ) 232OPCODE(ConvertU64F16, U64, F16, )
207OPCODE(ConvertU64F32, U64, U32, ) 233OPCODE(ConvertU64F32, U64, F32, )
208OPCODE(ConvertU64F64, U64, U64, ) 234OPCODE(ConvertU64F64, U64, F64, )
209 235
210OPCODE(ConvertU64U32, U64, U32, ) 236OPCODE(ConvertU64U32, U64, U32, )
211OPCODE(ConvertU32U64, U32, U64, ) 237OPCODE(ConvertU32U64, U32, U64, )