When both the input register and the carry flag are constants, the result can be precomputed. Before: 0x52800016 mov w22, #0x0 ; =0 0x2a3603f6 mvn w22, w22 After:
std::copy
std::copy_n
std::none_of