Conditional Select Negation returns, in the destination register, the value of the first source register if the condition is TRUE, and otherwise returns the negated value of the second source register.
如果条件为TRUE,则条件选择否定在目标寄存器中返回第一个源寄存器的值,否则返回第二个源寄存器被否定的值。
32-bit variant
Applies when sf == 0.
CSNEG <Wd>, <Wn>, <Wm>, <cond>
64-bit variant
Applies when sf == 1.
CSNEG <Xd>, <Xn>, <Xm>, <cond>
Decode for all variants of this encoding
integer d = UInt(Rd);
integer n = UInt(Rn);
integer m = UInt(Rm);
integer datasize = if sf == '1' then 64 else 32;
Operation
bits(datasize) result;
bits(datasize) operand1 = X[n];
bits(datasize) operand2 = X[m];
if ConditionHolds(cond) then
result = operand1;
else
result = NOT(operand2);
result = result + 1;
X[d] = result;
415b90: 7100001f cmp w0, #0x0
415b94: 1100fc01 add w1, w0, #0x3f
415b98: 1a80b021 csel w1, w1, w0, lt // lt = tstop
415b9c: 6b0003e2 negs w2, w0
415ba0: 12001404 and w4, w0, #0x3f
415ba4: 12001442 and w2, w2, #0x3f
415ba8: 5a824482 csneg w2, w4, w2, mi // mi = first