The current code is pretty branchy, and it is not yet obvious that we'll reduce the incidence of cmp64Set by boolean optimization for control (bug 1286816) since it'll lead to fairly hairy code in the compiler on 32-bit systems. So it would be good to generate better code for cmp64Set. Probably this comes down to breaking x86 and ARM apart and having custom code for both. ARM is more important; it should be easy to generate good code on ARM.
I'd like to take a stab at this one. Cmp64Set is defined here http://searchfox.org/mozilla-central/source/js/src/wasm/WasmBaselineCompile.cpp#2987 Looks like cmp64Set() is used for reducing repeated code when emitting compare operations. http://searchfox.org/mozilla-central/source/js/src/wasm/WasmBaselineCompile.cpp#6247 First step: Figure out how to do the equivalent of the x64 case for arm.
Created attachment 8823828 [details] [diff] [review] bug1316822_add_cmp64set_for_arm32.patch WIP. Untested. The cmp ARM instruction sets the APSR register. According to the docs it's supposed to be equivalent to a subs (but without writing back the result). I wonder if there's any instruction that can be used for comparing 64 bit values on a 32 bit arm platform. That would simplify things a bit. So far I haven't found any.
Created attachment 8826574 [details] [diff] [review] bug1316822_add_cmp64set_for_arm32.patch