This instruction conditionally moves a value from one register to
another, otherwise leaving the destination unchanged:
cmov RD, RN, CC == csel RD, RN, RD, CC
Also define `cmov.CC' for all condition codes CC.
Use this to slightly improve `rijndael_setup_arm64_crypto'.
.macro endprologue
.endm
+// cmov RD, RN, CC: set RD to RN if CC is satisfied, otherwise do nothing
+.macro cmov rd, rn, cc
+ csel \rd, \rn, \rd, \cc
+.endm
+
// Notational improvement: write `csel.CC' etc., rather than `csel ..., CC'.
#define _COND(_) \
_(eq) _(ne) _(cs) _(cc) _(vs) _(vc) _(mi) _(pl) \
_(hs) _(lo)
#define _INST(_) \
_(ccmp) _(ccmn) \
- _(csel) \
+ _(csel) _(cmov) \
_(csinc) _(cinc) _(cset) \
_(csneg) _(cneg) \
_(csinv) _(cinv) _(csetm)
sub x6, x6, #1
cmp x8, x3
cbz x6, 9f
- csel x8, x8, xzr, cc
+ cmov.cs x8, xzr
b 0b
// Next job is to construct the decryption keys. The keys for the