mulu


Multiplies unsigned word.

[Syntax]

-

mulu reg1, reg2, reg3

-

mulu imm, reg2, reg3

 

The following can be specified for imm:

-

Absolute expression having a value of up to 32 bits

-

Relative expression

[Function]

-

Syntax "mulu reg1, reg2, reg3"

Multiplies the register value specified by the first operand by the register value specified by the second operand as an unsigned value and stores the lower 32 bits of the result in the register specified by the second operand, and the higher 32 bits in the register specified by the third operand. If the same register is specified by the second and third operands, the higher 32 bits of the multiplication result are stored in that register.

-

Syntax "mulu imm, reg2, reg3"

Multiplies the value of the absolute or relative expression specified by the first operand by the register value specified by the second operand as an unsigned value and stores the lower 32 bits of the result in the register specified by the second operand, and the higher 32 bits in the register specified by the third operand. If the same register is specified by the second and third operands, the higher 32 bits of the multiplication result are stored in that register.

[Description]

-

If the instruction is executed in syntax "mulu reg1, reg2, reg3", the assembler generates one mulu machine instruction.

-

If the instruction is executed in syntax "mulu imm, reg2, reg3", and imm is an absolute expression within the range of 0 to +511, the assembler generates one mulu machine instruction.

mulu    imm9, reg2, reg3
mulu    imm9, reg2, reg3

-

If the instruction is executed in syntax "mulu imm, reg2, reg3", and the following expression is specified for imm, the assembler executes instruction expansion to generate multiple machine instructions.

(a)

Absolute expression within the range of -16 to -1

mulu    imm5, reg2, reg3
mov     imm5, r1
mulu    r1, reg2, reg3

(b)

Absolute expression exceeding the range of -16 to +511, but within the range of -32,768 to +32,767

mulu    imm16, reg2, reg3
movea   imm16, r0, r1
mulu    r1, reg2, reg3

(c)

Absolute expression having a value exceeding the range of -32,768 to +32,767

If all the lower 16 bits of the value of imm are 0

mulu    imm, reg2, reg3
movhi   HIGHW(imm), r0, r1
mulu    r1, reg2, reg3

Else

mulu    imm, reg2, reg3
mov     imm, r1
mulu    r1, reg2, reg3

(d)

Relative expression having !label or %label, or that having $label for a label having a definition in the sdata/sbss-attribute section

mulu    !label, reg2, reg3
movea   !label, r0, r1
mulu    r1, reg2, reg3
 
mulu    %label, reg2, reg3
movea   %label, r0, r1
mulu    r1, reg2, reg3
 
mulu    $label, reg2, reg3
movea   $label, r0, r1
mulu    r1, reg2, reg3

(e)

Relative expression having #label or label, or that having $label for a label having no definition in the sdata/sbss-attribute section

mulu    #label, reg2, reg3
mov     #label, r1
mulu    r1, reg2, reg3
mulu    label, reg2, reg3
mov     label, r1
mulu    r1, reg2, reg3
mulu    $label, reg2, reg3
mov     $label, r1
mulu    r1, reg2, reg3

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---