diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir/ir_emitter.h')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 84b844898..bfd9916cc 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -27,9 +27,9 @@ public: | |||
| 27 | [[nodiscard]] U16 Imm16(u16 value) const; | 27 | [[nodiscard]] U16 Imm16(u16 value) const; |
| 28 | [[nodiscard]] U32 Imm32(u32 value) const; | 28 | [[nodiscard]] U32 Imm32(u32 value) const; |
| 29 | [[nodiscard]] U32 Imm32(s32 value) const; | 29 | [[nodiscard]] U32 Imm32(s32 value) const; |
| 30 | [[nodiscard]] U32 Imm32(f32 value) const; | 30 | [[nodiscard]] F32 Imm32(f32 value) const; |
| 31 | [[nodiscard]] U64 Imm64(u64 value) const; | 31 | [[nodiscard]] U64 Imm64(u64 value) const; |
| 32 | [[nodiscard]] U64 Imm64(f64 value) const; | 32 | [[nodiscard]] F64 Imm64(f64 value) const; |
| 33 | 33 | ||
| 34 | void Branch(IR::Block* label); | 34 | void Branch(IR::Block* label); |
| 35 | void BranchConditional(const U1& cond, IR::Block* true_label, IR::Block* false_label); | 35 | void BranchConditional(const U1& cond, IR::Block* true_label, IR::Block* false_label); |
| @@ -55,8 +55,8 @@ public: | |||
| 55 | void SetCFlag(const U1& value); | 55 | void SetCFlag(const U1& value); |
| 56 | void SetOFlag(const U1& value); | 56 | void SetOFlag(const U1& value); |
| 57 | 57 | ||
| 58 | [[nodiscard]] U32 GetAttribute(IR::Attribute attribute); | 58 | [[nodiscard]] F32 GetAttribute(IR::Attribute attribute); |
| 59 | void SetAttribute(IR::Attribute attribute, const U32& value); | 59 | void SetAttribute(IR::Attribute attribute, const F32& value); |
| 60 | 60 | ||
| 61 | [[nodiscard]] U32 WorkgroupIdX(); | 61 | [[nodiscard]] U32 WorkgroupIdX(); |
| 62 | [[nodiscard]] U32 WorkgroupIdY(); | 62 | [[nodiscard]] U32 WorkgroupIdY(); |
| @@ -87,44 +87,47 @@ public: | |||
| 87 | [[nodiscard]] U1 GetCarryFromOp(const Value& op); | 87 | [[nodiscard]] U1 GetCarryFromOp(const Value& op); |
| 88 | [[nodiscard]] U1 GetOverflowFromOp(const Value& op); | 88 | [[nodiscard]] U1 GetOverflowFromOp(const Value& op); |
| 89 | 89 | ||
| 90 | [[nodiscard]] Value CompositeConstruct(const UAny& e1, const UAny& e2); | 90 | [[nodiscard]] Value CompositeConstruct(const Value& e1, const Value& e2); |
| 91 | [[nodiscard]] Value CompositeConstruct(const UAny& e1, const UAny& e2, const UAny& e3); | 91 | [[nodiscard]] Value CompositeConstruct(const Value& e1, const Value& e2, const Value& e3); |
| 92 | [[nodiscard]] Value CompositeConstruct(const UAny& e1, const UAny& e2, const UAny& e3, | 92 | [[nodiscard]] Value CompositeConstruct(const Value& e1, const Value& e2, const Value& e3, |
| 93 | const UAny& e4); | 93 | const Value& e4); |
| 94 | [[nodiscard]] UAny CompositeExtract(const Value& vector, size_t element); | 94 | [[nodiscard]] Value CompositeExtract(const Value& vector, size_t element); |
| 95 | 95 | ||
| 96 | [[nodiscard]] UAny Select(const U1& condition, const UAny& true_value, const UAny& false_value); | 96 | [[nodiscard]] UAny Select(const U1& condition, const UAny& true_value, const UAny& false_value); |
| 97 | 97 | ||
| 98 | template <typename Dest, typename Source> | ||
| 99 | [[nodiscard]] Dest BitCast(const Source& value); | ||
| 100 | |||
| 98 | [[nodiscard]] U64 PackUint2x32(const Value& vector); | 101 | [[nodiscard]] U64 PackUint2x32(const Value& vector); |
| 99 | [[nodiscard]] Value UnpackUint2x32(const U64& value); | 102 | [[nodiscard]] Value UnpackUint2x32(const U64& value); |
| 100 | 103 | ||
| 101 | [[nodiscard]] U32 PackFloat2x16(const Value& vector); | 104 | [[nodiscard]] U32 PackFloat2x16(const Value& vector); |
| 102 | [[nodiscard]] Value UnpackFloat2x16(const U32& value); | 105 | [[nodiscard]] Value UnpackFloat2x16(const U32& value); |
| 103 | 106 | ||
| 104 | [[nodiscard]] U64 PackDouble2x32(const Value& vector); | 107 | [[nodiscard]] F64 PackDouble2x32(const Value& vector); |
| 105 | [[nodiscard]] Value UnpackDouble2x32(const U64& value); | 108 | [[nodiscard]] Value UnpackDouble2x32(const F64& value); |
| 106 | 109 | ||
| 107 | [[nodiscard]] U16U32U64 FPAdd(const U16U32U64& a, const U16U32U64& b, FpControl control = {}); | 110 | [[nodiscard]] F16F32F64 FPAdd(const F16F32F64& a, const F16F32F64& b, FpControl control = {}); |
| 108 | [[nodiscard]] U16U32U64 FPMul(const U16U32U64& a, const U16U32U64& b, FpControl control = {}); | 111 | [[nodiscard]] F16F32F64 FPMul(const F16F32F64& a, const F16F32F64& b, FpControl control = {}); |
| 109 | [[nodiscard]] U16U32U64 FPFma(const U16U32U64& a, const U16U32U64& b, const U16U32U64& c, | 112 | [[nodiscard]] F16F32F64 FPFma(const F16F32F64& a, const F16F32F64& b, const F16F32F64& c, |
| 110 | FpControl control = {}); | 113 | FpControl control = {}); |
| 111 | 114 | ||
| 112 | [[nodiscard]] U16U32U64 FPAbs(const U16U32U64& value); | 115 | [[nodiscard]] F16F32F64 FPAbs(const F16F32F64& value); |
| 113 | [[nodiscard]] U16U32U64 FPNeg(const U16U32U64& value); | 116 | [[nodiscard]] F16F32F64 FPNeg(const F16F32F64& value); |
| 114 | [[nodiscard]] U16U32U64 FPAbsNeg(const U16U32U64& value, bool abs, bool neg); | 117 | [[nodiscard]] F16F32F64 FPAbsNeg(const F16F32F64& value, bool abs, bool neg); |
| 115 | 118 | ||
| 116 | [[nodiscard]] U32 FPCosNotReduced(const U32& value); | 119 | [[nodiscard]] F32 FPCosNotReduced(const F32& value); |
| 117 | [[nodiscard]] U32 FPExp2NotReduced(const U32& value); | 120 | [[nodiscard]] F32 FPExp2NotReduced(const F32& value); |
| 118 | [[nodiscard]] U32 FPLog2(const U32& value); | 121 | [[nodiscard]] F32 FPLog2(const F32& value); |
| 119 | [[nodiscard]] U32U64 FPRecip(const U32U64& value); | 122 | [[nodiscard]] F32F64 FPRecip(const F32F64& value); |
| 120 | [[nodiscard]] U32U64 FPRecipSqrt(const U32U64& value); | 123 | [[nodiscard]] F32F64 FPRecipSqrt(const F32F64& value); |
| 121 | [[nodiscard]] U32 FPSinNotReduced(const U32& value); | 124 | [[nodiscard]] F32 FPSinNotReduced(const F32& value); |
| 122 | [[nodiscard]] U32 FPSqrt(const U32& value); | 125 | [[nodiscard]] F32 FPSqrt(const F32& value); |
| 123 | [[nodiscard]] U16U32U64 FPSaturate(const U16U32U64& value); | 126 | [[nodiscard]] F16F32F64 FPSaturate(const F16F32F64& value); |
| 124 | [[nodiscard]] U16U32U64 FPRoundEven(const U16U32U64& value); | 127 | [[nodiscard]] F16F32F64 FPRoundEven(const F16F32F64& value); |
| 125 | [[nodiscard]] U16U32U64 FPFloor(const U16U32U64& value); | 128 | [[nodiscard]] F16F32F64 FPFloor(const F16F32F64& value); |
| 126 | [[nodiscard]] U16U32U64 FPCeil(const U16U32U64& value); | 129 | [[nodiscard]] F16F32F64 FPCeil(const F16F32F64& value); |
| 127 | [[nodiscard]] U16U32U64 FPTrunc(const U16U32U64& value); | 130 | [[nodiscard]] F16F32F64 FPTrunc(const F16F32F64& value); |
| 128 | 131 | ||
| 129 | [[nodiscard]] U32U64 IAdd(const U32U64& a, const U32U64& b); | 132 | [[nodiscard]] U32U64 IAdd(const U32U64& a, const U32U64& b); |
| 130 | [[nodiscard]] U32U64 ISub(const U32U64& a, const U32U64& b); | 133 | [[nodiscard]] U32U64 ISub(const U32U64& a, const U32U64& b); |
| @@ -154,9 +157,9 @@ public: | |||
| 154 | [[nodiscard]] U1 LogicalXor(const U1& a, const U1& b); | 157 | [[nodiscard]] U1 LogicalXor(const U1& a, const U1& b); |
| 155 | [[nodiscard]] U1 LogicalNot(const U1& value); | 158 | [[nodiscard]] U1 LogicalNot(const U1& value); |
| 156 | 159 | ||
| 157 | [[nodiscard]] U32U64 ConvertFToS(size_t bitsize, const U16U32U64& value); | 160 | [[nodiscard]] U32U64 ConvertFToS(size_t bitsize, const F16F32F64& value); |
| 158 | [[nodiscard]] U32U64 ConvertFToU(size_t bitsize, const U16U32U64& value); | 161 | [[nodiscard]] U32U64 ConvertFToU(size_t bitsize, const F16F32F64& value); |
| 159 | [[nodiscard]] U32U64 ConvertFToI(size_t bitsize, bool is_signed, const U16U32U64& value); | 162 | [[nodiscard]] U32U64 ConvertFToI(size_t bitsize, bool is_signed, const F16F32F64& value); |
| 160 | 163 | ||
| 161 | [[nodiscard]] U32U64 ConvertU(size_t result_bitsize, const U32U64& value); | 164 | [[nodiscard]] U32U64 ConvertU(size_t result_bitsize, const U32U64& value); |
| 162 | 165 | ||