SDIV
Signed divide
This instruction divides a signed integer register value
by another signed integer register value, and writes the result
to the destination register. The condition flags are not affected.
0
0
1
1
0
1
0
1
1
0
0
0
0
0
1
1
0
SDIV <Wd>, <Wn>, <Wm>
1
SDIV <Xd>, <Xn>, <Xm>
constant integer d = UInt(Rd);
constant integer n = UInt(Rn);
constant integer m = UInt(Rm);
constant integer datasize = 32 << UInt(sf);
<Wd>
Is the 32-bit name of the general-purpose destination register, encoded in the "Rd" field.
<Wn>
Is the 32-bit name of the first general-purpose source register, encoded in the "Rn" field.
<Wm>
Is the 32-bit name of the second general-purpose source register, encoded in the "Rm" field.
<Xd>
Is the 64-bit name of the general-purpose destination register, encoded in the "Rd" field.
<Xn>
Is the 64-bit name of the first general-purpose source register, encoded in the "Rn" field.
<Xm>
Is the 64-bit name of the second general-purpose source register, encoded in the "Rm" field.
constant bits(datasize) operand1 = X[n, datasize];
constant bits(datasize) operand2 = X[m, datasize];
integer result;
if IsZero(operand2) then
result = 0;
else
result = RoundTowardsZero(Real(SInt(operand1)) / Real(SInt(operand2)));
X[d, datasize] = result<datasize-1:0>;