Open
Description
incp
index += GetActiveElementCount(Sve.CreateTrueMaskUInt32(), loopmask);
Generates:
ptrue p0
cntp x7, p0, p2.s
add x6, x7, x6
Instead it should do:
incp x6, p2.s
decp
Also
index -= GetActiveElementCount(Sve.CreateTrueMaskUInt32(), loopmask);
Should produce:
decp x6, p2.s
sqincp
Note that the user can also do:
index = Sve.SaturatingIncrementByActiveElementCount(index, loopmask);
This correctly produces:
sqincp x6, p2.s
This is currently more optimal than using GetActiveElementCount()
. However, the user may not want it to saturate.
(There is nothing to fix here. It is just for reference).
incb/inch/incw/decb/dech/decw
index += Sve.Count32BitElements(SveMaskPattern.ALL);
Produces:
cntw x7, ALL
add x6, x7, x6
Instead it should produce:
incw x6, ALL
The same needs to happen for Count8BitElements()
, Count16BitElements()
, Count64BitElements()
. Also should use the DECx instructions when decrementing.