3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-05-11 17:54:44 +00:00

cxxrtl: fix missing sign extension before shift operation for signed values

This commit is contained in:
sdjasj 2025-05-03 17:38:16 +08:00 committed by GitHub
parent aa30589c12
commit da1ac9ae47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1769,7 +1769,7 @@ value<BitsY> shr_uu(const value<BitsA> &a, const value<BitsB> &b) {
template<size_t BitsY, size_t BitsA, size_t BitsB>
CXXRTL_ALWAYS_INLINE
value<BitsY> shr_su(const value<BitsA> &a, const value<BitsB> &b) {
return a.shr(b).template scast<BitsY>();
return a.template scast<BitsY>().shr(b);
}
template<size_t BitsY, size_t BitsA, size_t BitsB>