Browse Source

Pre Merge pull request !648 from songmingyang001/smy_cleancode

pull/648/MERGE
songmingyang001 Gitee 3 years ago
parent
commit
b62d4b5d2a
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      parser/common/parser_fp16_t.cc

+ 2
- 2
parser/common/parser_fp16_t.cc View File

@@ -978,7 +978,7 @@ static void SetValByUint16Val(const uint16_t &input_val, const uint16_t &sign, u
}
} else {
e_ret = static_cast<int16_t>(kFp16ExpBias);
m_tmp = m_tmp << (kManBitLength - len);
m_tmp = m_tmp << static_cast<uint16_t>(kManBitLength - len);
e_ret = e_ret + (len - 1);
}
auto m_ret = static_cast<uint16_t>(m_tmp);
@@ -1116,7 +1116,7 @@ fp16_t &fp16_t::operator=(const uint32_t &ui_val) {
uint32_t m_min = kFp16ManHideBit;
uint32_t m_max = m_min << 1;
uint16_t len = static_cast<uint16_t>(GetManBitLength(m_tmp));
if (len > kDim11) {
if (len > static_cast<>kDim11) {
e_ret = kFp16ExpBias + kFp16ManLen;
uint32_t m_trunc = 0;
uint32_t trunc_mask = 1;


Loading…
Cancel
Save