MULHI

Multiply the high-order word

MULHI

MULtiply HIgh-order word


[Syntax]

(1)

MULHI src, src2

(2)

MULHI src, src2, Adest [V2.01.00 or later]

 

[Operation]

(1)

signed short tmp1, tmp2;

signed long long tmp3;

tmp1 = (signed short) (src >> 16);

tmp2 = (signed short) (src2 >> 16);

tmp3 = (signed long) tmp1 * (signed long) tmp2;

ACC = (tmp3 << 16);

 

(2)

signed short tmp1, tmp2;

signed 72bit tmp3;

tmp1 = (signed short) (src >> 16);

tmp2 = (signed short) (src2 >> 16);

tmp3 = (signed long) tmp1 * (signed long) tmp2;

Adest = (tmp3 << 16); [V2.01.00 or later]

 

[Function]

(1)

This instruction multiplies the higher-order 16 bits of src by the higher-order 16 bits of src2, and stores the result in the accumulator (ACC). When the result is stored, the least significant bit of the result corresponds to bit 16 of ACC, and the section corresponding to bits 63 to 48 of ACC is sign-extended. Moreover, bits 15 to 0 of ACC are cleared to 0. The higher-order 16 bits of src and the higher-order 16 bits of src2 are treated as signed integers.

(2)

This instruction multiplies the higher-order 16 bits of src by the higher-order 16 bits of src2, and stores the result in the accumulator (ACC0 or ACC1). When the result is stored, the least significant bit of the result corresponds to bit 16 of ACC, and the section corresponding to bits 71 to 48 of ACC is sign-extended. Moreover, bits 15 to 0 of ACC are cleared to 0. The higher-order 16 bits of src and the higher-order 16 bits of src2 are treated as signed integers. You can assemble assembly-language code that includes this instruction if you have specified the assembler option -isa with selection of the instruction set of the RXv2 or a later version. [V2.01.00 or later]

 

[Instruction Format]

Syntax

Operand

Code Size

(Byte)

src

src2

Adest

(1) MULHI src, src2

Rs

Rs2

3

(2) MULHI src, src2, Adest

[V2.01.00 or later]

Rs

Rs2

A0, A1

3

Note

Specify A0 (ACC0) or A1 (ACC1) as Adest.

 

[Flag Change]

-

This instruction does not affect the states of flags.

 

[Description Example]

MULHI R1, R2

MULHI R1, R2, A1