ARM base instruction -- cset
CSET
Conditional Set sets the destination register to 1 if the condition is TRUE, and otherwise sets it to 0.
如果条件为TRUE,则条件集将目标寄存器设置为1,否则设置为0。
32-bit variant
Applies when sf == 0.
CSET <Wd>, <cond>
64-bit variant
Applies when sf == 1.
CSET <Xd>, <cond>
CSET W0, EQ # Conditional Set, 相等设置为1,不等设置为0
402608: 7100001f cmp w0, #0x0 // if w0==0, Z=1; else Z=0
40260c: b9401fe0 ldr w0, [sp, #28]
402610: 1a9f07e2 cset w2, ne // if Z=0, w2=1; else w2=0, 或者
// if w0!=0, w2=1; else w2=0