Quadword Remainder (remq)

Syntax

remq $s_reg1, $s_reg2, $d_reg

remq $d_reg/$s_reg1, $s_reg2

remq $s_reg1, val_immed, $d_reg

remq $d_reg/$s_reg1, val_immed

Description

Quadword Remainder computes the remainder of the division of two signed 64-bit values. The remainder remq (i, j) is defined as i-(j*divq(i, j)) where j != 0. This instruction divides the contents of $s_reg1 by the contents of $s_reg2 or the immediate value and then puts the remainder in the destination register.

The remq instruction rounds toward zero. For example, divq (5,-3)=-1, and remq (5,-3)=2.

For divide-by-zero, an error is signaled and a call_pal PAL_gentrap instruction may be issued.

Note   The assembler destroys the contents of temporary registers $at, $t9, $t10, $t11, and $t12 for this instruction.