From da1ac9ae47df62301dcaed05c8679dbb3508fd10 Mon Sep 17 00:00:00 2001 From: sdjasj <89853352+sdjasj@users.noreply.github.com> Date: Sat, 3 May 2025 17:38:16 +0800 Subject: [PATCH] cxxrtl: fix missing sign extension before shift operation for signed values --- backends/cxxrtl/runtime/cxxrtl/cxxrtl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h b/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h index 886d033cb..9b4f5774f 100644 --- a/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h +++ b/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h @@ -1769,7 +1769,7 @@ value shr_uu(const value &a, const value &b) { template CXXRTL_ALWAYS_INLINE value shr_su(const value &a, const value &b) { - return a.shr(b).template scast(); + return a.template scast().shr(b); } template