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