diff options
| author | 2021-02-05 23:11:23 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:21 -0400 | |
| commit | 16cb00c521cae6e93ec49d10e15b575b7bc4857e (patch) | |
| tree | 3b283895510af56fced7e62031c6beda999c0a1c /src/shader_recompiler/frontend/ir/opcodes.inc | |
| parent | shader: Make typed IR (diff) | |
| download | yuzu-16cb00c521cae6e93ec49d10e15b575b7bc4857e.tar.gz yuzu-16cb00c521cae6e93ec49d10e15b575b7bc4857e.tar.xz yuzu-16cb00c521cae6e93ec49d10e15b575b7bc4857e.zip | |
shader: Add pools and rename files
Diffstat (limited to 'src/shader_recompiler/frontend/ir/opcodes.inc')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 237 |
1 files changed, 237 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc new file mode 100644 index 000000000..6eb105d92 --- /dev/null +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -0,0 +1,237 @@ | |||
| 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, ... | ||
| 6 | OPCODE(Void, Void, ) | ||
| 7 | OPCODE(Identity, Opaque, Opaque, ) | ||
| 8 | OPCODE(Phi, Opaque, /*todo*/ ) | ||
| 9 | |||
| 10 | // Control flow | ||
| 11 | OPCODE(Branch, Void, Label, ) | ||
| 12 | OPCODE(BranchConditional, Void, U1, Label, Label, ) | ||
| 13 | OPCODE(Exit, Void, ) | ||
| 14 | OPCODE(Return, Void, ) | ||
| 15 | OPCODE(Unreachable, Void, ) | ||
| 16 | |||
| 17 | // Context getters/setters | ||
| 18 | OPCODE(GetRegister, U32, Reg, ) | ||
| 19 | OPCODE(SetRegister, Void, Reg, U32, ) | ||
| 20 | OPCODE(GetPred, U1, Pred, ) | ||
| 21 | OPCODE(SetPred, Void, Pred, U1, ) | ||
| 22 | OPCODE(GetCbuf, U32, U32, U32, ) | ||
| 23 | OPCODE(GetAttribute, U32, Attribute, ) | ||
| 24 | OPCODE(SetAttribute, U32, Attribute, ) | ||
| 25 | OPCODE(GetAttributeIndexed, U32, U32, ) | ||
| 26 | OPCODE(SetAttributeIndexed, U32, U32, ) | ||
| 27 | OPCODE(GetZFlag, U1, Void, ) | ||
| 28 | OPCODE(GetSFlag, U1, Void, ) | ||
| 29 | OPCODE(GetCFlag, U1, Void, ) | ||
| 30 | OPCODE(GetOFlag, U1, Void, ) | ||
| 31 | OPCODE(SetZFlag, Void, U1, ) | ||
| 32 | OPCODE(SetSFlag, Void, U1, ) | ||
| 33 | OPCODE(SetCFlag, Void, U1, ) | ||
| 34 | OPCODE(SetOFlag, Void, U1, ) | ||
| 35 | OPCODE(WorkgroupIdX, U32, ) | ||
| 36 | OPCODE(WorkgroupIdY, U32, ) | ||
| 37 | OPCODE(WorkgroupIdZ, U32, ) | ||
| 38 | OPCODE(LocalInvocationIdX, U32, ) | ||
| 39 | OPCODE(LocalInvocationIdY, U32, ) | ||
| 40 | OPCODE(LocalInvocationIdZ, U32, ) | ||
| 41 | |||
| 42 | // Undefined | ||
| 43 | OPCODE(Undef1, U1, ) | ||
| 44 | OPCODE(Undef8, U8, ) | ||
| 45 | OPCODE(Undef16, U16, ) | ||
| 46 | OPCODE(Undef32, U32, ) | ||
| 47 | OPCODE(Undef64, U64, ) | ||
| 48 | |||
| 49 | // Memory operations | ||
| 50 | OPCODE(LoadGlobalU8, U32, U64, ) | ||
| 51 | OPCODE(LoadGlobalS8, U32, U64, ) | ||
| 52 | OPCODE(LoadGlobalU16, U32, U64, ) | ||
| 53 | OPCODE(LoadGlobalS16, U32, U64, ) | ||
| 54 | OPCODE(LoadGlobal32, U32, U64, ) | ||
| 55 | OPCODE(LoadGlobal64, U32x2, U64, ) | ||
| 56 | OPCODE(LoadGlobal128, U32x4, U64, ) | ||
| 57 | OPCODE(WriteGlobalU8, Void, U64, U32, ) | ||
| 58 | OPCODE(WriteGlobalS8, Void, U64, U32, ) | ||
| 59 | OPCODE(WriteGlobalU16, Void, U64, U32, ) | ||
| 60 | OPCODE(WriteGlobalS16, Void, U64, U32, ) | ||
| 61 | OPCODE(WriteGlobal32, Void, U64, U32, ) | ||
| 62 | OPCODE(WriteGlobal64, Void, U64, U32x2, ) | ||
| 63 | OPCODE(WriteGlobal128, Void, U64, U32x4, ) | ||
| 64 | |||
| 65 | // Storage buffer operations | ||
| 66 | OPCODE(LoadStorageU8, U32, U32, U32, ) | ||
| 67 | OPCODE(LoadStorageS8, U32, U32, U32, ) | ||
| 68 | OPCODE(LoadStorageU16, U32, U32, U32, ) | ||
| 69 | OPCODE(LoadStorageS16, U32, U32, U32, ) | ||
| 70 | OPCODE(LoadStorage32, U32, U32, U32, ) | ||
| 71 | OPCODE(LoadStorage64, U32x2, U32, U32, ) | ||
| 72 | OPCODE(LoadStorage128, U32x4, U32, U32, ) | ||
| 73 | OPCODE(WriteStorageU8, Void, U32, U32, U32, ) | ||
| 74 | OPCODE(WriteStorageS8, Void, U32, U32, U32, ) | ||
| 75 | OPCODE(WriteStorageU16, Void, U32, U32, U32, ) | ||
| 76 | OPCODE(WriteStorageS16, Void, U32, U32, U32, ) | ||
| 77 | OPCODE(WriteStorage32, Void, U32, U32, U32, ) | ||
| 78 | OPCODE(WriteStorage64, Void, U32, U32, U32x2, ) | ||
| 79 | OPCODE(WriteStorage128, Void, U32, U32, U32x4, ) | ||
| 80 | |||
| 81 | // Vector utility | ||
| 82 | OPCODE(CompositeConstructU32x2, U32x2, U32, U32, ) | ||
| 83 | OPCODE(CompositeConstructU32x3, U32x3, U32, U32, U32, ) | ||
| 84 | OPCODE(CompositeConstructU32x4, U32x4, U32, U32, U32, U32, ) | ||
| 85 | OPCODE(CompositeExtractU32x2, U32, U32x2, U32, ) | ||
| 86 | OPCODE(CompositeExtractU32x3, U32, U32x3, U32, ) | ||
| 87 | OPCODE(CompositeExtractU32x4, U32, U32x4, U32, ) | ||
| 88 | OPCODE(CompositeConstructF16x2, F16x2, F16, F16, ) | ||
| 89 | OPCODE(CompositeConstructF16x3, F16x3, F16, F16, F16, ) | ||
| 90 | OPCODE(CompositeConstructF16x4, F16x4, F16, F16, F16, F16, ) | ||
| 91 | OPCODE(CompositeExtractF16x2, F16, F16x2, U32, ) | ||
| 92 | OPCODE(CompositeExtractF16x3, F16, F16x3, U32, ) | ||
| 93 | OPCODE(CompositeExtractF16x4, F16, F16x4, U32, ) | ||
| 94 | OPCODE(CompositeConstructF32x2, F32x2, F32, F32, ) | ||
| 95 | OPCODE(CompositeConstructF32x3, F32x3, F32, F32, F32, ) | ||
| 96 | OPCODE(CompositeConstructF32x4, F32x4, F32, F32, F32, F32, ) | ||
| 97 | OPCODE(CompositeExtractF32x2, F32, F32x2, U32, ) | ||
| 98 | OPCODE(CompositeExtractF32x3, F32, F32x3, U32, ) | ||
| 99 | OPCODE(CompositeExtractF32x4, F32, F32x4, U32, ) | ||
| 100 | OPCODE(CompositeConstructF64x2, F64x2, F64, F64, ) | ||
| 101 | OPCODE(CompositeConstructF64x3, F64x3, F64, F64, F64, ) | ||
| 102 | OPCODE(CompositeConstructF64x4, F64x4, F64, F64, F64, F64, ) | ||
| 103 | OPCODE(CompositeExtractF64x2, F64, F64x2, U32, ) | ||
| 104 | OPCODE(CompositeExtractF64x3, F64, F64x3, U32, ) | ||
| 105 | OPCODE(CompositeExtractF64x4, F64, F64x4, U32, ) | ||
| 106 | |||
| 107 | // Select operations | ||
| 108 | OPCODE(Select8, U8, U1, U8, U8, ) | ||
| 109 | OPCODE(Select16, U16, U1, U16, U16, ) | ||
| 110 | OPCODE(Select32, U32, U1, U32, U32, ) | ||
| 111 | OPCODE(Select64, U64, U1, U64, U64, ) | ||
| 112 | |||
| 113 | // Bitwise conversions | ||
| 114 | OPCODE(BitCastU16F16, U16, F16, ) | ||
| 115 | OPCODE(BitCastU32F32, U32, F32, ) | ||
| 116 | OPCODE(BitCastU64F64, U64, F64, ) | ||
| 117 | OPCODE(BitCastF16U16, F16, U16, ) | ||
| 118 | OPCODE(BitCastF32U32, F32, U32, ) | ||
| 119 | OPCODE(BitCastF64U64, F64, U64, ) | ||
| 120 | OPCODE(PackUint2x32, U64, U32x2, ) | ||
| 121 | OPCODE(UnpackUint2x32, U32x2, U64, ) | ||
| 122 | OPCODE(PackFloat2x16, U32, F16x2, ) | ||
| 123 | OPCODE(UnpackFloat2x16, F16x2, U32, ) | ||
| 124 | OPCODE(PackDouble2x32, U64, U32x2, ) | ||
| 125 | OPCODE(UnpackDouble2x32, U32x2, U64, ) | ||
| 126 | |||
| 127 | // Pseudo-operation, handled specially at final emit | ||
| 128 | OPCODE(GetZeroFromOp, U1, Opaque, ) | ||
| 129 | OPCODE(GetSignFromOp, U1, Opaque, ) | ||
| 130 | OPCODE(GetCarryFromOp, U1, Opaque, ) | ||
| 131 | OPCODE(GetOverflowFromOp, U1, Opaque, ) | ||
| 132 | |||
| 133 | // Floating-point operations | ||
| 134 | OPCODE(FPAbs16, F16, F16, ) | ||
| 135 | OPCODE(FPAbs32, F32, F32, ) | ||
| 136 | OPCODE(FPAbs64, F64, F64, ) | ||
| 137 | OPCODE(FPAdd16, F16, F16, F16, ) | ||
| 138 | OPCODE(FPAdd32, F32, F32, F32, ) | ||
| 139 | OPCODE(FPAdd64, F64, F64, F64, ) | ||
| 140 | OPCODE(FPFma16, F16, F16, F16, F16, ) | ||
| 141 | OPCODE(FPFma32, F32, F32, F32, F32, ) | ||
| 142 | OPCODE(FPFma64, F64, F64, F64, F64, ) | ||
| 143 | OPCODE(FPMax32, F32, F32, F32, ) | ||
| 144 | OPCODE(FPMax64, F64, F64, F64, ) | ||
| 145 | OPCODE(FPMin32, F32, F32, F32, ) | ||
| 146 | OPCODE(FPMin64, F64, F64, F64, ) | ||
| 147 | OPCODE(FPMul16, F16, F16, F16, ) | ||
| 148 | OPCODE(FPMul32, F32, F32, F32, ) | ||
| 149 | OPCODE(FPMul64, F64, F64, F64, ) | ||
| 150 | OPCODE(FPNeg16, F16, F16, ) | ||
| 151 | OPCODE(FPNeg32, F32, F32, ) | ||
| 152 | OPCODE(FPNeg64, F64, F64, ) | ||
| 153 | OPCODE(FPRecip32, F32, F32, ) | ||
| 154 | OPCODE(FPRecip64, F64, F64, ) | ||
| 155 | OPCODE(FPRecipSqrt32, F32, F32, ) | ||
| 156 | OPCODE(FPRecipSqrt64, F64, F64, ) | ||
| 157 | OPCODE(FPSqrt, F32, F32, ) | ||
| 158 | OPCODE(FPSin, F32, F32, ) | ||
| 159 | OPCODE(FPSinNotReduced, F32, F32, ) | ||
| 160 | OPCODE(FPExp2, F32, F32, ) | ||
| 161 | OPCODE(FPExp2NotReduced, F32, F32, ) | ||
| 162 | OPCODE(FPCos, F32, F32, ) | ||
| 163 | OPCODE(FPCosNotReduced, F32, F32, ) | ||
| 164 | OPCODE(FPLog2, F32, F32, ) | ||
| 165 | OPCODE(FPSaturate16, F16, F16, ) | ||
| 166 | OPCODE(FPSaturate32, F32, F32, ) | ||
| 167 | OPCODE(FPSaturate64, F64, F64, ) | ||
| 168 | OPCODE(FPRoundEven16, F16, F16, ) | ||
| 169 | OPCODE(FPRoundEven32, F32, F32, ) | ||
| 170 | OPCODE(FPRoundEven64, F64, F64, ) | ||
| 171 | OPCODE(FPFloor16, F16, F16, ) | ||
| 172 | OPCODE(FPFloor32, F32, F32, ) | ||
| 173 | OPCODE(FPFloor64, F64, F64, ) | ||
| 174 | OPCODE(FPCeil16, F16, F16, ) | ||
| 175 | OPCODE(FPCeil32, F32, F32, ) | ||
| 176 | OPCODE(FPCeil64, F64, F64, ) | ||
| 177 | OPCODE(FPTrunc16, F16, F16, ) | ||
| 178 | OPCODE(FPTrunc32, F32, F32, ) | ||
| 179 | OPCODE(FPTrunc64, F64, F64, ) | ||
| 180 | |||
| 181 | // Integer operations | ||
| 182 | OPCODE(IAdd32, U32, U32, U32, ) | ||
| 183 | OPCODE(IAdd64, U64, U64, U64, ) | ||
| 184 | OPCODE(ISub32, U32, U32, U32, ) | ||
| 185 | OPCODE(ISub64, U64, U64, U64, ) | ||
| 186 | OPCODE(IMul32, U32, U32, U32, ) | ||
| 187 | OPCODE(INeg32, U32, U32, ) | ||
| 188 | OPCODE(IAbs32, U32, U32, ) | ||
| 189 | OPCODE(ShiftLeftLogical32, U32, U32, U32, ) | ||
| 190 | OPCODE(ShiftRightLogical32, U32, U32, U32, ) | ||
| 191 | OPCODE(ShiftRightArithmetic32, U32, U32, U32, ) | ||
| 192 | OPCODE(BitwiseAnd32, U32, U32, U32, ) | ||
| 193 | OPCODE(BitwiseOr32, U32, U32, U32, ) | ||
| 194 | OPCODE(BitwiseXor32, U32, U32, U32, ) | ||
| 195 | OPCODE(BitFieldInsert, U32, U32, U32, U32, U32, ) | ||
| 196 | OPCODE(BitFieldSExtract, U32, U32, U32, U32, ) | ||
| 197 | OPCODE(BitFieldUExtract, U32, U32, U32, U32, ) | ||
| 198 | |||
| 199 | OPCODE(SLessThan, U1, U32, U32, ) | ||
| 200 | OPCODE(ULessThan, U1, U32, U32, ) | ||
| 201 | OPCODE(IEqual, U1, U32, U32, ) | ||
| 202 | OPCODE(SLessThanEqual, U1, U32, U32, ) | ||
| 203 | OPCODE(ULessThanEqual, U1, U32, U32, ) | ||
| 204 | OPCODE(SGreaterThan, U1, U32, U32, ) | ||
| 205 | OPCODE(UGreaterThan, U1, U32, U32, ) | ||
| 206 | OPCODE(INotEqual, U1, U32, U32, ) | ||
| 207 | OPCODE(SGreaterThanEqual, U1, U32, U32, ) | ||
| 208 | OPCODE(UGreaterThanEqual, U1, U32, U32, ) | ||
| 209 | |||
| 210 | // Logical operations | ||
| 211 | OPCODE(LogicalOr, U1, U1, U1, ) | ||
| 212 | OPCODE(LogicalAnd, U1, U1, U1, ) | ||
| 213 | OPCODE(LogicalXor, U1, U1, U1, ) | ||
| 214 | OPCODE(LogicalNot, U1, U1, ) | ||
| 215 | |||
| 216 | // Conversion operations | ||
| 217 | OPCODE(ConvertS16F16, U32, F16, ) | ||
| 218 | OPCODE(ConvertS16F32, U32, F32, ) | ||
| 219 | OPCODE(ConvertS16F64, U32, F64, ) | ||
| 220 | OPCODE(ConvertS32F16, U32, F16, ) | ||
| 221 | OPCODE(ConvertS32F32, U32, F32, ) | ||
| 222 | OPCODE(ConvertS32F64, U32, F64, ) | ||
| 223 | OPCODE(ConvertS64F16, U64, F16, ) | ||
| 224 | OPCODE(ConvertS64F32, U64, F32, ) | ||
| 225 | OPCODE(ConvertS64F64, U64, F64, ) | ||
| 226 | OPCODE(ConvertU16F16, U32, F16, ) | ||
| 227 | OPCODE(ConvertU16F32, U32, F32, ) | ||
| 228 | OPCODE(ConvertU16F64, U32, F64, ) | ||
| 229 | OPCODE(ConvertU32F16, U32, F16, ) | ||
| 230 | OPCODE(ConvertU32F32, U32, F32, ) | ||
| 231 | OPCODE(ConvertU32F64, U32, F64, ) | ||
| 232 | OPCODE(ConvertU64F16, U64, F16, ) | ||
| 233 | OPCODE(ConvertU64F32, U64, F32, ) | ||
| 234 | OPCODE(ConvertU64F64, U64, F64, ) | ||
| 235 | |||
| 236 | OPCODE(ConvertU64U32, U64, U32, ) | ||
| 237 | OPCODE(ConvertU32U64, U32, U64, ) | ||