diff options
| author | 2021-02-05 19:19:36 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:21 -0400 | |
| commit | be94ee88d227d0d3dbeabe9ade98bacd910c7a7e (patch) | |
| tree | 68a2043d48b8d1ecb7df23d03c1f92f277c70f9a /src/shader_recompiler/frontend/ir/opcode.inc | |
| parent | shader: Remove illegal character in SSA pass (diff) | |
| download | yuzu-be94ee88d227d0d3dbeabe9ade98bacd910c7a7e.tar.gz yuzu-be94ee88d227d0d3dbeabe9ade98bacd910c7a7e.tar.xz yuzu-be94ee88d227d0d3dbeabe9ade98bacd910c7a7e.zip | |
shader: Make typed IR
Diffstat (limited to 'src/shader_recompiler/frontend/ir/opcode.inc')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcode.inc | 200 |
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, | |||
| 52 | OPCODE(LoadGlobalU16, U32, U64, ) | 52 | OPCODE(LoadGlobalU16, U32, U64, ) |
| 53 | OPCODE(LoadGlobalS16, U32, U64, ) | 53 | OPCODE(LoadGlobalS16, U32, U64, ) |
| 54 | OPCODE(LoadGlobal32, U32, U64, ) | 54 | OPCODE(LoadGlobal32, U32, U64, ) |
| 55 | OPCODE(LoadGlobal64, Opaque, U64, ) | 55 | OPCODE(LoadGlobal64, U32x2, U64, ) |
| 56 | OPCODE(LoadGlobal128, Opaque, U64, ) | 56 | OPCODE(LoadGlobal128, U32x4, U64, ) |
| 57 | OPCODE(WriteGlobalU8, Void, U64, U32, ) | 57 | OPCODE(WriteGlobalU8, Void, U64, U32, ) |
| 58 | OPCODE(WriteGlobalS8, Void, U64, U32, ) | 58 | OPCODE(WriteGlobalS8, Void, U64, U32, ) |
| 59 | OPCODE(WriteGlobalU16, Void, U64, U32, ) | 59 | OPCODE(WriteGlobalU16, Void, U64, U32, ) |
| 60 | OPCODE(WriteGlobalS16, Void, U64, U32, ) | 60 | OPCODE(WriteGlobalS16, Void, U64, U32, ) |
| 61 | OPCODE(WriteGlobal32, Void, U64, U32, ) | 61 | OPCODE(WriteGlobal32, Void, U64, U32, ) |
| 62 | OPCODE(WriteGlobal64, Void, U64, Opaque, ) | 62 | OPCODE(WriteGlobal64, Void, U64, U32x2, ) |
| 63 | OPCODE(WriteGlobal128, Void, U64, Opaque, ) | 63 | OPCODE(WriteGlobal128, Void, U64, U32x4, ) |
| 64 | 64 | ||
| 65 | // Storage buffer operations | 65 | // Storage buffer operations |
| 66 | OPCODE(LoadStorageU8, U32, U32, U32, ) | 66 | OPCODE(LoadStorageU8, U32, U32, U32, ) |
| @@ -68,21 +68,41 @@ OPCODE(LoadStorageS8, U32, U32, | |||
| 68 | OPCODE(LoadStorageU16, U32, U32, U32, ) | 68 | OPCODE(LoadStorageU16, U32, U32, U32, ) |
| 69 | OPCODE(LoadStorageS16, U32, U32, U32, ) | 69 | OPCODE(LoadStorageS16, U32, U32, U32, ) |
| 70 | OPCODE(LoadStorage32, U32, U32, U32, ) | 70 | OPCODE(LoadStorage32, U32, U32, U32, ) |
| 71 | OPCODE(LoadStorage64, Opaque, U32, U32, ) | 71 | OPCODE(LoadStorage64, U32x2, U32, U32, ) |
| 72 | OPCODE(LoadStorage128, Opaque, U32, U32, ) | 72 | OPCODE(LoadStorage128, U32x4, U32, U32, ) |
| 73 | OPCODE(WriteStorageU8, Void, U32, U32, U32, ) | 73 | OPCODE(WriteStorageU8, Void, U32, U32, U32, ) |
| 74 | OPCODE(WriteStorageS8, Void, U32, U32, U32, ) | 74 | OPCODE(WriteStorageS8, Void, U32, U32, U32, ) |
| 75 | OPCODE(WriteStorageU16, Void, U32, U32, U32, ) | 75 | OPCODE(WriteStorageU16, Void, U32, U32, U32, ) |
| 76 | OPCODE(WriteStorageS16, Void, U32, U32, U32, ) | 76 | OPCODE(WriteStorageS16, Void, U32, U32, U32, ) |
| 77 | OPCODE(WriteStorage32, Void, U32, U32, U32, ) | 77 | OPCODE(WriteStorage32, Void, U32, U32, U32, ) |
| 78 | OPCODE(WriteStorage64, Void, U32, U32, Opaque, ) | 78 | OPCODE(WriteStorage64, Void, U32, U32, U32x2, ) |
| 79 | OPCODE(WriteStorage128, Void, U32, U32, Opaque, ) | 79 | OPCODE(WriteStorage128, Void, U32, U32, U32x4, ) |
| 80 | 80 | ||
| 81 | // Vector utility | 81 | // Vector utility |
| 82 | OPCODE(CompositeConstruct2, Opaque, Opaque, Opaque, ) | 82 | OPCODE(CompositeConstructU32x2, U32x2, U32, U32, ) |
| 83 | OPCODE(CompositeConstruct3, Opaque, Opaque, Opaque, Opaque, ) | 83 | OPCODE(CompositeConstructU32x3, U32x3, U32, U32, U32, ) |
| 84 | OPCODE(CompositeConstruct4, Opaque, Opaque, Opaque, Opaque, Opaque, ) | 84 | OPCODE(CompositeConstructU32x4, U32x4, U32, U32, U32, U32, ) |
| 85 | OPCODE(CompositeExtract, Opaque, Opaque, 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, ) | ||
| 86 | 106 | ||
| 87 | // Select operations | 107 | // Select operations |
| 88 | OPCODE(Select8, U8, U1, U8, U8, ) | 108 | OPCODE(Select8, U8, U1, U8, U8, ) |
| @@ -91,12 +111,18 @@ OPCODE(Select32, U32, U1, | |||
| 91 | OPCODE(Select64, U64, U1, U64, U64, ) | 111 | OPCODE(Select64, U64, U1, U64, U64, ) |
| 92 | 112 | ||
| 93 | // Bitwise conversions | 113 | // Bitwise conversions |
| 94 | OPCODE(PackUint2x32, U64, Opaque, ) | 114 | OPCODE(BitCastU16F16, U16, F16, ) |
| 95 | OPCODE(UnpackUint2x32, Opaque, U64, ) | 115 | OPCODE(BitCastU32F32, U32, F32, ) |
| 96 | OPCODE(PackFloat2x16, U32, Opaque, ) | 116 | OPCODE(BitCastU64F64, U64, F64, ) |
| 97 | OPCODE(UnpackFloat2x16, Opaque, U32, ) | 117 | OPCODE(BitCastF16U16, F16, U16, ) |
| 98 | OPCODE(PackDouble2x32, U64, Opaque, ) | 118 | OPCODE(BitCastF32U32, F32, U32, ) |
| 99 | OPCODE(UnpackDouble2x32, Opaque, U64, ) | 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, ) | ||
| 100 | 126 | ||
| 101 | // Pseudo-operation, handled specially at final emit | 127 | // Pseudo-operation, handled specially at final emit |
| 102 | OPCODE(GetZeroFromOp, U1, Opaque, ) | 128 | OPCODE(GetZeroFromOp, U1, Opaque, ) |
| @@ -105,52 +131,52 @@ OPCODE(GetCarryFromOp, U1, Opaq | |||
| 105 | OPCODE(GetOverflowFromOp, U1, Opaque, ) | 131 | OPCODE(GetOverflowFromOp, U1, Opaque, ) |
| 106 | 132 | ||
| 107 | // Floating-point operations | 133 | // Floating-point operations |
| 108 | OPCODE(FPAbs16, U16, U16, ) | 134 | OPCODE(FPAbs16, F16, F16, ) |
| 109 | OPCODE(FPAbs32, U32, U32, ) | 135 | OPCODE(FPAbs32, F32, F32, ) |
| 110 | OPCODE(FPAbs64, U64, U64, ) | 136 | OPCODE(FPAbs64, F64, F64, ) |
| 111 | OPCODE(FPAdd16, U16, U16, U16, ) | 137 | OPCODE(FPAdd16, F16, F16, F16, ) |
| 112 | OPCODE(FPAdd32, U32, U32, U32, ) | 138 | OPCODE(FPAdd32, F32, F32, F32, ) |
| 113 | OPCODE(FPAdd64, U64, U64, U64, ) | 139 | OPCODE(FPAdd64, F64, F64, F64, ) |
| 114 | OPCODE(FPFma16, U16, U16, U16, U16, ) | 140 | OPCODE(FPFma16, F16, F16, F16, F16, ) |
| 115 | OPCODE(FPFma32, U32, U32, U32, U32, ) | 141 | OPCODE(FPFma32, F32, F32, F32, F32, ) |
| 116 | OPCODE(FPFma64, U64, U64, U64, U64, ) | 142 | OPCODE(FPFma64, F64, F64, F64, F64, ) |
| 117 | OPCODE(FPMax32, U32, U32, U32, ) | 143 | OPCODE(FPMax32, F32, F32, F32, ) |
| 118 | OPCODE(FPMax64, U64, U64, U64, ) | 144 | OPCODE(FPMax64, F64, F64, F64, ) |
| 119 | OPCODE(FPMin32, U32, U32, U32, ) | 145 | OPCODE(FPMin32, F32, F32, F32, ) |
| 120 | OPCODE(FPMin64, U64, U64, U64, ) | 146 | OPCODE(FPMin64, F64, F64, F64, ) |
| 121 | OPCODE(FPMul16, U16, U16, U16, ) | 147 | OPCODE(FPMul16, F16, F16, F16, ) |
| 122 | OPCODE(FPMul32, U32, U32, U32, ) | 148 | OPCODE(FPMul32, F32, F32, F32, ) |
| 123 | OPCODE(FPMul64, U64, U64, U64, ) | 149 | OPCODE(FPMul64, F64, F64, F64, ) |
| 124 | OPCODE(FPNeg16, U16, U16, ) | 150 | OPCODE(FPNeg16, F16, F16, ) |
| 125 | OPCODE(FPNeg32, U32, U32, ) | 151 | OPCODE(FPNeg32, F32, F32, ) |
| 126 | OPCODE(FPNeg64, U64, U64, ) | 152 | OPCODE(FPNeg64, F64, F64, ) |
| 127 | OPCODE(FPRecip32, U32, U32, ) | 153 | OPCODE(FPRecip32, F32, F32, ) |
| 128 | OPCODE(FPRecip64, U64, U64, ) | 154 | OPCODE(FPRecip64, F64, F64, ) |
| 129 | OPCODE(FPRecipSqrt32, U32, U32, ) | 155 | OPCODE(FPRecipSqrt32, F32, F32, ) |
| 130 | OPCODE(FPRecipSqrt64, U64, U64, ) | 156 | OPCODE(FPRecipSqrt64, F64, F64, ) |
| 131 | OPCODE(FPSqrt, U32, U32, ) | 157 | OPCODE(FPSqrt, F32, F32, ) |
| 132 | OPCODE(FPSin, U32, U32, ) | 158 | OPCODE(FPSin, F32, F32, ) |
| 133 | OPCODE(FPSinNotReduced, U32, U32, ) | 159 | OPCODE(FPSinNotReduced, F32, F32, ) |
| 134 | OPCODE(FPExp2, U32, U32, ) | 160 | OPCODE(FPExp2, F32, F32, ) |
| 135 | OPCODE(FPExp2NotReduced, U32, U32, ) | 161 | OPCODE(FPExp2NotReduced, F32, F32, ) |
| 136 | OPCODE(FPCos, U32, U32, ) | 162 | OPCODE(FPCos, F32, F32, ) |
| 137 | OPCODE(FPCosNotReduced, U32, U32, ) | 163 | OPCODE(FPCosNotReduced, F32, F32, ) |
| 138 | OPCODE(FPLog2, U32, U32, ) | 164 | OPCODE(FPLog2, F32, F32, ) |
| 139 | OPCODE(FPSaturate16, U16, U16, ) | 165 | OPCODE(FPSaturate16, F16, F16, ) |
| 140 | OPCODE(FPSaturate32, U32, U32, ) | 166 | OPCODE(FPSaturate32, F32, F32, ) |
| 141 | OPCODE(FPSaturate64, U64, U64, ) | 167 | OPCODE(FPSaturate64, F64, F64, ) |
| 142 | OPCODE(FPRoundEven16, U16, U16, ) | 168 | OPCODE(FPRoundEven16, F16, F16, ) |
| 143 | OPCODE(FPRoundEven32, U32, U32, ) | 169 | OPCODE(FPRoundEven32, F32, F32, ) |
| 144 | OPCODE(FPRoundEven64, U64, U64, ) | 170 | OPCODE(FPRoundEven64, F64, F64, ) |
| 145 | OPCODE(FPFloor16, U16, U16, ) | 171 | OPCODE(FPFloor16, F16, F16, ) |
| 146 | OPCODE(FPFloor32, U32, U32, ) | 172 | OPCODE(FPFloor32, F32, F32, ) |
| 147 | OPCODE(FPFloor64, U64, U64, ) | 173 | OPCODE(FPFloor64, F64, F64, ) |
| 148 | OPCODE(FPCeil16, U16, U16, ) | 174 | OPCODE(FPCeil16, F16, F16, ) |
| 149 | OPCODE(FPCeil32, U32, U32, ) | 175 | OPCODE(FPCeil32, F32, F32, ) |
| 150 | OPCODE(FPCeil64, U64, U64, ) | 176 | OPCODE(FPCeil64, F64, F64, ) |
| 151 | OPCODE(FPTrunc16, U16, U16, ) | 177 | OPCODE(FPTrunc16, F16, F16, ) |
| 152 | OPCODE(FPTrunc32, U32, U32, ) | 178 | OPCODE(FPTrunc32, F32, F32, ) |
| 153 | OPCODE(FPTrunc64, U64, U64, ) | 179 | OPCODE(FPTrunc64, F64, F64, ) |
| 154 | 180 | ||
| 155 | // Integer operations | 181 | // Integer operations |
| 156 | OPCODE(IAdd32, U32, U32, U32, ) | 182 | OPCODE(IAdd32, U32, U32, U32, ) |
| @@ -188,24 +214,24 @@ OPCODE(LogicalXor, U1, U1, | |||
| 188 | OPCODE(LogicalNot, U1, U1, ) | 214 | OPCODE(LogicalNot, U1, U1, ) |
| 189 | 215 | ||
| 190 | // Conversion operations | 216 | // Conversion operations |
| 191 | OPCODE(ConvertS16F16, U32, U16, ) | 217 | OPCODE(ConvertS16F16, U32, F16, ) |
| 192 | OPCODE(ConvertS16F32, U32, U32, ) | 218 | OPCODE(ConvertS16F32, U32, F32, ) |
| 193 | OPCODE(ConvertS16F64, U32, U64, ) | 219 | OPCODE(ConvertS16F64, U32, F64, ) |
| 194 | OPCODE(ConvertS32F16, U32, U16, ) | 220 | OPCODE(ConvertS32F16, U32, F16, ) |
| 195 | OPCODE(ConvertS32F32, U32, U32, ) | 221 | OPCODE(ConvertS32F32, U32, F32, ) |
| 196 | OPCODE(ConvertS32F64, U32, U64, ) | 222 | OPCODE(ConvertS32F64, U32, F64, ) |
| 197 | OPCODE(ConvertS64F16, U64, U16, ) | 223 | OPCODE(ConvertS64F16, U64, F16, ) |
| 198 | OPCODE(ConvertS64F32, U64, U32, ) | 224 | OPCODE(ConvertS64F32, U64, F32, ) |
| 199 | OPCODE(ConvertS64F64, U64, U64, ) | 225 | OPCODE(ConvertS64F64, U64, F64, ) |
| 200 | OPCODE(ConvertU16F16, U32, U16, ) | 226 | OPCODE(ConvertU16F16, U32, F16, ) |
| 201 | OPCODE(ConvertU16F32, U32, U32, ) | 227 | OPCODE(ConvertU16F32, U32, F32, ) |
| 202 | OPCODE(ConvertU16F64, U32, U64, ) | 228 | OPCODE(ConvertU16F64, U32, F64, ) |
| 203 | OPCODE(ConvertU32F16, U32, U16, ) | 229 | OPCODE(ConvertU32F16, U32, F16, ) |
| 204 | OPCODE(ConvertU32F32, U32, U32, ) | 230 | OPCODE(ConvertU32F32, U32, F32, ) |
| 205 | OPCODE(ConvertU32F64, U32, U64, ) | 231 | OPCODE(ConvertU32F64, U32, F64, ) |
| 206 | OPCODE(ConvertU64F16, U64, U16, ) | 232 | OPCODE(ConvertU64F16, U64, F16, ) |
| 207 | OPCODE(ConvertU64F32, U64, U32, ) | 233 | OPCODE(ConvertU64F32, U64, F32, ) |
| 208 | OPCODE(ConvertU64F64, U64, U64, ) | 234 | OPCODE(ConvertU64F64, U64, F64, ) |
| 209 | 235 | ||
| 210 | OPCODE(ConvertU64U32, U64, U32, ) | 236 | OPCODE(ConvertU64U32, U64, U32, ) |
| 211 | OPCODE(ConvertU32U64, U32, U64, ) | 237 | OPCODE(ConvertU32U64, U32, U64, ) |