diff --git a/Changes b/Changes index 201c5ce53..2337574b0 100644 --- a/Changes +++ b/Changes @@ -6,7 +6,7 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Support '#' comments in $readmem, bug1411. [Frederick Requin] -**** Fix missing VL_SHIFTL_QQW error, bug1412. [Larry Lee] +**** Fix missing VL_SHIFTL_ errors, bug1412, bug1415. [Larry Lee] **** Fix MinGW GCC 6 printf formats, bug1413. [Sergey Kvachonok] diff --git a/include/verilated.h b/include/verilated.h index 06a5cf97c..1008cceab 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -1967,7 +1967,7 @@ static inline WDataOutP VL_SHIFTR_WWW(int obits, int lbits, int rbits, } return VL_SHIFTR_WWI(obits,lbits,32,owp,lwp,rwp[0]); } -static inline IData VL_SHIFTR_IIW(int obits,int,int rbits,IData lhs, WDataInP rwp) VL_MT_SAFE { +static inline IData VL_SHIFTR_IIW(int obits, int, int rbits, IData lhs, WDataInP rwp) VL_MT_SAFE { for (int i=1; i < VL_WORDS_I(rbits); ++i) { if (VL_UNLIKELY(rwp[i])) { // Huge shift 1>>32 or more return 0; @@ -1975,6 +1975,15 @@ static inline IData VL_SHIFTR_IIW(int obits,int,int rbits,IData lhs, WDataInP rw } return VL_CLEAN_II(obits,obits,lhs>>rwp[0]); } +static inline QData VL_SHIFTR_QQW(int obits, int, int rbits, QData lhs, WDataInP rwp) VL_MT_SAFE { + for (int i=1; i < VL_WORDS_I(rbits); ++i) { + if (VL_UNLIKELY(rwp[i])) { // Huge shift 1>>32 or more + return 0; + } + } + // Above checks rwp[1]==0 so not needed in below shift + return VL_CLEAN_QQ(obits, obits, lhs>>(static_cast(rwp[0]))); +} // EMIT_RULE: VL_SHIFTRS: oclean=false; lclean=clean, rclean==clean; static inline IData VL_SHIFTRS_III(int obits, int lbits, int, IData lhs, IData rhs) VL_PURE {