This would allow us to add Select to B3. The FTL uses Select quite a bit, so this is probably a good idea.
Select is a non-branching instruction of the form x = select(a, b, c) where if a is non-zero then x = b else x = c. This is implemented using conditional moves, a CPU instruction that does not branch, but performs a move dependent on some condition. At the machine code level, a “cmov” is formatted very similarly to a branch, so it’s probably a matter of tweaking our branch formatting code. We probably want the API to be something like: m_jit.moveConditionally(LessThan, gpr1, gpr2, gpr3, gpr4); // move gpr3 to gpr4 if gpr1 is less than gpr2. m_jit.moveConditionallyTest(NonZero, gpr1, gpr2, gpr3, gpr4); // move gpr3 to gpr4 if (gpr1 & gpr2) != 0. m_jit.moveConditionallyDouble(DoubleEqual, fpr1, fpr2, gpr1, gpr2) // move gpr1 to gpr2 if fpr1 == fpr2.
Created attachment 264761 [details] Patch
Comment on attachment 264761 [details] Patch Clearing flags on attachment: 264761 Committed r192131: <http://trac.webkit.org/changeset/192131>
All reviewed patches have been landed. Closing bug.