[PATCH] D17181: [X86] Don't turn (c?-v:v) into (c?-v:0) by blindly using PSIGN.
Ahmed Bougacha via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 15 16:30:26 PST 2016
ab marked 4 inline comments as done.
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:26475-26478
@@ +26474,6 @@
+ // Here, we have a mask, M (all 1s or 0), and, similarly, we know that:
+ // ((M & 1) ? -X : X) == ((X ^ -(M & 1)) + (M & 1))
+ // ( M ? -X : X) == ((X ^ M ) + (M & 1))
+ // This lets us transform our vselect to:
+ // (add (xor X, M), (and M, 1))
+ // And further to:
----------------
Ah yes, beautiful!
http://reviews.llvm.org/D17181
More information about the llvm-commits
mailing list