|
|
|
|
|
by camel-cdr
256 days ago
|
|
Not sure in which context this is used, but you can do -1 << k in most ISAs but that still requires a bit-not.
But if you want to use the value in a bitwise instruction, then there are often variants that can invert the input operand. E.g. in RVV instead of vand.vv(a, vadd.vi(vsll.vv(1,k),-1)) you could do vandn.vv(vsll.vv(-1,k)) AVX-512 can do this with any binary or ternary bitwise logic function via vpternlog |
|