This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Loss of information - SMMUL

Why the Cortex M4 instruction SMMUL (32 = 32 x 32b) preserves a redundant sign bit and discards one useful bit of information? What could possibly be the justification for such blatant disregard of the ISO/IEC TR 18037 standard Fract format?

Parents
  • I think they just missed a trick there when defining the DSP instructions. You can get  the result you want by using a long multiply and double but it takes a few extra cycles. Or one can get by with one less bit of precision and do a shift left of one of the operands before the multiply but that isn't any sort of standard. Or if they had set carry for the top bit of the low half then doubling would have just taken an extra cycle.

    By the way that 'redundant sign bit' isn't completely redundant because 0x80000000 multiplied by 0x80000000 gives 0x4000000 for the top half. An instruction designed for DSP would have to do saturation to 0x7fffffff or else ignore that case and get 0 or 0x80000000.

    As to blatant disregard for Fract format - the instructions were defined and implemented long before that standard was thought of as far as I'm aware.

Reply
  • I think they just missed a trick there when defining the DSP instructions. You can get  the result you want by using a long multiply and double but it takes a few extra cycles. Or one can get by with one less bit of precision and do a shift left of one of the operands before the multiply but that isn't any sort of standard. Or if they had set carry for the top bit of the low half then doubling would have just taken an extra cycle.

    By the way that 'redundant sign bit' isn't completely redundant because 0x80000000 multiplied by 0x80000000 gives 0x4000000 for the top half. An instruction designed for DSP would have to do saturation to 0x7fffffff or else ignore that case and get 0 or 0x80000000.

    As to blatant disregard for Fract format - the instructions were defined and implemented long before that standard was thought of as far as I'm aware.

Children