diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir/value.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/value.cpp | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp index c021d3fa9..b962f170d 100644 --- a/src/shader_recompiler/frontend/ir/value.cpp +++ b/src/shader_recompiler/frontend/ir/value.cpp | |||
| @@ -51,107 +51,6 @@ IR::Type Value::Type() const noexcept { | |||
| 51 | return type; | 51 | return type; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | IR::Inst* Value::Inst() const { | ||
| 55 | ValidateAccess(Type::Opaque); | ||
| 56 | return inst; | ||
| 57 | } | ||
| 58 | |||
| 59 | IR::Block* Value::Label() const { | ||
| 60 | ValidateAccess(Type::Label); | ||
| 61 | return label; | ||
| 62 | } | ||
| 63 | |||
| 64 | IR::Inst* Value::InstRecursive() const { | ||
| 65 | ValidateAccess(Type::Opaque); | ||
| 66 | if (IsIdentity()) { | ||
| 67 | return inst->Arg(0).InstRecursive(); | ||
| 68 | } | ||
| 69 | return inst; | ||
| 70 | } | ||
| 71 | |||
| 72 | IR::Value Value::Resolve() const { | ||
| 73 | if (IsIdentity()) { | ||
| 74 | return inst->Arg(0).Resolve(); | ||
| 75 | } | ||
| 76 | return *this; | ||
| 77 | } | ||
| 78 | |||
| 79 | IR::Reg Value::Reg() const { | ||
| 80 | ValidateAccess(Type::Reg); | ||
| 81 | return reg; | ||
| 82 | } | ||
| 83 | |||
| 84 | IR::Pred Value::Pred() const { | ||
| 85 | ValidateAccess(Type::Pred); | ||
| 86 | return pred; | ||
| 87 | } | ||
| 88 | |||
| 89 | IR::Attribute Value::Attribute() const { | ||
| 90 | ValidateAccess(Type::Attribute); | ||
| 91 | return attribute; | ||
| 92 | } | ||
| 93 | |||
| 94 | IR::Patch Value::Patch() const { | ||
| 95 | ValidateAccess(Type::Patch); | ||
| 96 | return patch; | ||
| 97 | } | ||
| 98 | |||
| 99 | bool Value::U1() const { | ||
| 100 | if (IsIdentity()) { | ||
| 101 | return inst->Arg(0).U1(); | ||
| 102 | } | ||
| 103 | ValidateAccess(Type::U1); | ||
| 104 | return imm_u1; | ||
| 105 | } | ||
| 106 | |||
| 107 | u8 Value::U8() const { | ||
| 108 | if (IsIdentity()) { | ||
| 109 | return inst->Arg(0).U8(); | ||
| 110 | } | ||
| 111 | ValidateAccess(Type::U8); | ||
| 112 | return imm_u8; | ||
| 113 | } | ||
| 114 | |||
| 115 | u16 Value::U16() const { | ||
| 116 | if (IsIdentity()) { | ||
| 117 | return inst->Arg(0).U16(); | ||
| 118 | } | ||
| 119 | ValidateAccess(Type::U16); | ||
| 120 | return imm_u16; | ||
| 121 | } | ||
| 122 | |||
| 123 | u32 Value::U32() const { | ||
| 124 | if (IsIdentity()) { | ||
| 125 | return inst->Arg(0).U32(); | ||
| 126 | } | ||
| 127 | ValidateAccess(Type::U32); | ||
| 128 | return imm_u32; | ||
| 129 | } | ||
| 130 | |||
| 131 | f32 Value::F32() const { | ||
| 132 | if (IsIdentity()) { | ||
| 133 | return inst->Arg(0).F32(); | ||
| 134 | } | ||
| 135 | ValidateAccess(Type::F32); | ||
| 136 | return imm_f32; | ||
| 137 | } | ||
| 138 | |||
| 139 | u64 Value::U64() const { | ||
| 140 | if (IsIdentity()) { | ||
| 141 | return inst->Arg(0).U64(); | ||
| 142 | } | ||
| 143 | ValidateAccess(Type::U64); | ||
| 144 | return imm_u64; | ||
| 145 | } | ||
| 146 | |||
| 147 | f64 Value::F64() const { | ||
| 148 | if (IsIdentity()) { | ||
| 149 | return inst->Arg(0).F64(); | ||
| 150 | } | ||
| 151 | ValidateAccess(Type::F64); | ||
| 152 | return imm_f64; | ||
| 153 | } | ||
| 154 | |||
| 155 | bool Value::operator==(const Value& other) const { | 54 | bool Value::operator==(const Value& other) const { |
| 156 | if (type != other.type) { | 55 | if (type != other.type) { |
| 157 | return false; | 56 | return false; |
| @@ -205,10 +104,4 @@ bool Value::operator!=(const Value& other) const { | |||
| 205 | return !operator==(other); | 104 | return !operator==(other); |
| 206 | } | 105 | } |
| 207 | 106 | ||
| 208 | void Value::ValidateAccess(IR::Type expected) const { | ||
| 209 | if (type != expected) { | ||
| 210 | throw LogicError("Reading {} out of {}", expected, type); | ||
| 211 | } | ||
| 212 | } | ||
| 213 | |||
| 214 | } // namespace Shader::IR | 107 | } // namespace Shader::IR |