ARM架构的CSET指令是如何工作的?比较标准条件检查哪些寄存器?请帮忙。
最佳答案
每 ARMv8 ISA :
CSET Wd, cond
Conditional Set: Wd = if cond then 1 else 0.
这意味着指令执行条件设置指令。什么是条件设置指令?
Conditional set: conditionally select between 0 and 1 or -1, for example to materialize the condition flags as a Boolean value or mask in a general register.
您可以将其转换为简单的三元运算:
Wd = cond ? 1 : 0
.所以,如果 cond
是 true
, Wd = 1
.否则,Wd = 0
.什么是条件?
cond - A standard ARM condition EQ, NE, CS|HS, CC|LO, MI, PL, VS, VC, HI, LS, GE, LT, GT, LE, AL or NV with the same meanings as in AArch32. Note that although AL and NV represent different encodings, as in AArch32 they are both interpreted as the “always true” condition. Unless stated AArch64 instructions do not set or use the condition flags, but those that do set all of the condition flags. If used in a pseudo-code expression this symbol represents a Boolean whose value is the truth of the specified condition test.
关于assembly - ARMV8指令集的CSET指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31822662/