ARM base instruction -- csneg

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值