summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir/value.h
diff options
context:
space:
mode:
authorFeng Chen <VonChenPlus@gmail.com>2022-11-04 07:39:42 +0100
committerGitHub <noreply@github.com>2022-11-04 07:39:42 +0100
commit75596c07e0fc1462c2a19484e168f4944c33d3d3 (patch)
tree1aa919ea76f467c51b3fc591a72c57f5ade92560 /src/shader_recompiler/frontend/ir/value.h
parentUI: Add options to hide extra columns (#9093) (diff)
downloadyuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.gz
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.bz2
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.lz
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.xz
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.zst
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.zip
Diffstat (limited to 'src/shader_recompiler/frontend/ir/value.h')
-rw-r--r--src/shader_recompiler/frontend/ir/value.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 6a673ca05..e8bbb93a5 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -44,6 +44,7 @@ public:
explicit Value(u8 value) noexcept;
explicit Value(u16 value) noexcept;
explicit Value(u32 value) noexcept;
+ explicit Value(s32 value) noexcept;
explicit Value(f32 value) noexcept;
explicit Value(u64 value) noexcept;
explicit Value(f64 value) noexcept;
@@ -66,6 +67,7 @@ public:
[[nodiscard]] u8 U8() const;
[[nodiscard]] u16 U16() const;
[[nodiscard]] u32 U32() const;
+ [[nodiscard]] s32 S32() const;
[[nodiscard]] f32 F32() const;
[[nodiscard]] u64 U64() const;
[[nodiscard]] f64 F64() const;
@@ -85,6 +87,7 @@ private:
u8 imm_u8;
u16 imm_u16;
u32 imm_u32;
+ s32 imm_s32;
f32 imm_f32;
u64 imm_u64;
f64 imm_f64;
@@ -266,6 +269,7 @@ using U8 = TypedValue<Type::U8>;
using U16 = TypedValue<Type::U16>;
using U32 = TypedValue<Type::U32>;
using U64 = TypedValue<Type::U64>;
+using S32 = TypedValue<Type::S32>;
using F16 = TypedValue<Type::F16>;
using F32 = TypedValue<Type::F32>;
using F64 = TypedValue<Type::F64>;
@@ -377,6 +381,14 @@ inline u32 Value::U32() const {
return imm_u32;
}
+inline s32 Value::S32() const {
+ if (IsIdentity()) {
+ return inst->Arg(0).S32();
+ }
+ DEBUG_ASSERT(type == Type::S32);
+ return imm_s32;
+}
+
inline f32 Value::F32() const {
if (IsIdentity()) {
return inst->Arg(0).F32();