From 8909f52166bf9c27d52b5a722efbd46d1a11e876 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Mon, 23 Sep 2019 22:55:25 -0400 Subject: Shader_IR: Implement Fast BRX and allow multi-branches in the CFG. --- src/video_core/shader/expr.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/video_core/shader/expr.h') diff --git a/src/video_core/shader/expr.h b/src/video_core/shader/expr.h index d3dcd00ec..e41d23e93 100644 --- a/src/video_core/shader/expr.h +++ b/src/video_core/shader/expr.h @@ -17,13 +17,14 @@ using Tegra::Shader::Pred; class ExprAnd; class ExprBoolean; class ExprCondCode; +class ExprGprEqual; class ExprNot; class ExprOr; class ExprPredicate; class ExprVar; -using ExprData = - std::variant; +using ExprData = std::variant; using Expr = std::shared_ptr; class ExprAnd final { @@ -118,6 +119,18 @@ public: bool value; }; +class ExprGprEqual final { +public: + ExprGprEqual(u32 gpr, u32 value) : gpr{gpr}, value{value} {} + + bool operator==(const ExprGprEqual& b) const { + return gpr == b.gpr && value == b.value; + } + + u32 gpr; + u32 value; +}; + template Expr MakeExpr(Args&&... args) { static_assert(std::is_convertible_v); -- cgit v1.2.3 From be856a38d6b0c7c90c861baf3204ac48a108f3d2 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Thu, 17 Oct 2019 10:35:16 -0400 Subject: Shader_IR: Address Feedback. --- src/video_core/shader/expr.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/video_core/shader/expr.h') diff --git a/src/video_core/shader/expr.h b/src/video_core/shader/expr.h index e41d23e93..4e8264367 100644 --- a/src/video_core/shader/expr.h +++ b/src/video_core/shader/expr.h @@ -127,6 +127,10 @@ public: return gpr == b.gpr && value == b.value; } + bool operator!=(const ExprGprEqual& b) const { + return !operator==(b); + } + u32 gpr; u32 value; }; -- cgit v1.2.3