mulhw

Multiply High Word

mulhw RT, RA, RB

Multiplies two 32-bit integers and returns the upper 32 bits (Signed).

Details

The mulhw instruction multiplies the low-order 32 bits of two source registers (RA and RB) and places the high-order 32 bits of the 64-bit product into the destination register RT. The result is undefined for the lower 32 bits of RT.

Pseudocode Operation

prod0:63 ←(RA)32:63 × (RB)32:63
RT32:63 ←prod0:31
RT0:31 ←undefined

Programming Note

When Rc=1 (dot form), CR0 is updated with the signed comparison of the result against zero (LT, GT, EQ) and the current SO bit from XER.

Example

mulhw r3, r4, r5

Encoding

Binary Layout
31
0
RT
6
RA
11
RB
16
OE
21
75
22
Rc
31
 
Format XO-form
Opcode 0x7C000096
Extension Base
Registers Altered CR0

Operands

  • RT
    Target
  • RA
    Src A
  • RB
    Src B