From 72990df7bad1c81d6ebc51179d34e1bfc71e0caf Mon Sep 17 00:00:00 2001
From: ameerj <52414509+ameerj@users.noreply.github.com>
Date: Thu, 18 Mar 2021 02:53:57 -0400
Subject: shader: Implement DADD

---
 src/shader_recompiler/frontend/ir/value.cpp | 8 ++++++++
 src/shader_recompiler/frontend/ir/value.h   | 1 +
 2 files changed, 9 insertions(+)

(limited to 'src/shader_recompiler/frontend/ir')

diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp
index 791ba26906..e8e4662e7b 100644
--- a/src/shader_recompiler/frontend/ir/value.cpp
+++ b/src/shader_recompiler/frontend/ir/value.cpp
@@ -153,6 +153,14 @@ u64 Value::U64() const {
     return imm_u64;
 }
 
+f64 Value::F64() const {
+    if (IsIdentity()) {
+        return inst->Arg(0).F64();
+    }
+    ValidateAccess(Type::F64);
+    return imm_f64;
+}
+
 bool Value::operator==(const Value& other) const {
     if (type != other.type) {
         return false;
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 3602883d6f..b27601e704 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -52,6 +52,7 @@ public:
     [[nodiscard]] u32 U32() const;
     [[nodiscard]] f32 F32() const;
     [[nodiscard]] u64 U64() const;
+    [[nodiscard]] f64 F64() const;
 
     [[nodiscard]] bool operator==(const Value& other) const;
     [[nodiscard]] bool operator!=(const Value& other) const;
-- 
cgit v1.2.3-70-g09d2