|
|
|
|
|
by wyldfire
1110 days ago
|
|
IIRC you can compose an xor and subtract to do abs, which might eliminate the need for a dedicated opcode. Although negate/cmov might work better. Either way you'd only need an abs if it showed up often enough that you wanted to save code size or could schedule the pipeline better, which seems unlikely. |
|
https://en.m.wikipedia.org/wiki/X86_Bit_manipulation_instruc...
Popcnt, LZCNT and TZCNT are pretty nifty and all, but probably more obscure than absolute value.
I do think pdep and pext are brilliant and that more people should play with those two BMI2 instructions.