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
  • Hi Petr,

    I am not sure I understand your problem. But the opcode you mention is to give you the higher 32 bits of a signed multiplication.

    So doing 0x7fff.ffff * 0x8000.0000, I'd expect the Rd to contain 0xc000.0000 which is does and seems to be the correct value.

    If you need the full 64bit result, you can use SMULL<c> <RdLo>,<RdHi>,<Rn>,<Rm>

Reply
  • Hi Petr,

    I am not sure I understand your problem. But the opcode you mention is to give you the higher 32 bits of a signed multiplication.

    So doing 0x7fff.ffff * 0x8000.0000, I'd expect the Rd to contain 0xc000.0000 which is does and seems to be the correct value.

    If you need the full 64bit result, you can use SMULL<c> <RdLo>,<RdHi>,<Rn>,<Rm>

Children
No data