diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-02-05 19:19:36 -0300 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:21 -0400 |
commit | be94ee88d227d0d3dbeabe9ade98bacd910c7a7e (patch) | |
tree | 68a2043d48b8d1ecb7df23d03c1f92f277c70f9a /src/shader_recompiler/frontend/ir/value.h | |
parent | dc04a50ac2aa0bc71db701d0eea857765c2581f0 (diff) |
shader: Make typed IR
Diffstat (limited to 'src/shader_recompiler/frontend/ir/value.h')
-rw-r--r-- | src/shader_recompiler/frontend/ir/value.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h index 31f8317940..2f3688c736 100644 --- a/src/shader_recompiler/frontend/ir/value.h +++ b/src/shader_recompiler/frontend/ir/value.h @@ -28,7 +28,9 @@ public: explicit Value(u8 value) noexcept; explicit Value(u16 value) noexcept; explicit Value(u32 value) noexcept; + explicit Value(f32 value) noexcept; explicit Value(u64 value) noexcept; + explicit Value(f64 value) noexcept; [[nodiscard]] bool IsIdentity() const noexcept; [[nodiscard]] bool IsEmpty() const noexcept; @@ -46,6 +48,7 @@ public: [[nodiscard]] u8 U8() const; [[nodiscard]] u16 U16() const; [[nodiscard]] u32 U32() const; + [[nodiscard]] f32 F32() const; [[nodiscard]] u64 U64() const; [[nodiscard]] bool operator==(const Value& other) const; @@ -65,7 +68,9 @@ private: u8 imm_u8; u16 imm_u16; u32 imm_u32; + f32 imm_f32; u64 imm_u64; + f64 imm_f64; }; }; @@ -93,8 +98,13 @@ using U8 = TypedValue<Type::U8>; using U16 = TypedValue<Type::U16>; using U32 = TypedValue<Type::U32>; using U64 = TypedValue<Type::U64>; +using F16 = TypedValue<Type::F16>; +using F32 = TypedValue<Type::F32>; +using F64 = TypedValue<Type::F64>; using U32U64 = TypedValue<Type::U32 | Type::U64>; +using F32F64 = TypedValue<Type::F32 | Type::F64>; using U16U32U64 = TypedValue<Type::U16 | Type::U32 | Type::U64>; +using F16F32F64 = TypedValue<Type::F16 | Type::F32 | Type::F64>; using UAny = TypedValue<Type::U8 | Type::U16 | Type::U32 | Type::U64>; } // namespace Shader::IR |