We need cast to int32_t? I think ma is implicit casted to larger size even if the bit size of ma is less than 18.