diff --git a/hphp/runtime/vm/jit/vasm-simplify-arm.cpp b/hphp/runtime/vm/jit/vasm-simplify-arm.cpp index cc7c363dba01eb..e2b8df38409a9e 100644 --- a/hphp/runtime/vm/jit/vasm-simplify-arm.cpp +++ b/hphp/runtime/vm/jit/vasm-simplify-arm.cpp @@ -134,6 +134,23 @@ bool simplify(Env& env, const ldimmq& inst, Vlabel b, size_t i) { /////////////////////////////////////////////////////////////////////////////// +bool simplify(Env& env, const movtqb& inst, Vlabel b, size_t i) { + if (env.use_counts[inst.d] != 1) + return false; + + if (if_inst(env, b, i + 1, [&](const movzbq& ext) { + if (ext.s != inst.d) + return false; + + return simplify_impl(env, b, i, [&] (Vout& v) { + v << movzbq{Vreg8((Vreg)inst.s), ext.d}; + return 2; + }); + })) { + } + return false; +} + bool simplify(Env& env, const movzbl& inst, Vlabel b, size_t i) { // movzbl{s, d}; shrli{2, s, d} --> ubfmli{2, 7, s, d} return if_inst(env, b, i + 1, [&](const shrli& sh) {