static bool MaybeSimdUnbox(TempAllocator &alloc, MInstruction *ins, MIRType type, unsigned op) { MOZ_ASSERT(IsSimdType(type)); MDefinition *in = ins->getOperand(op); if (in->type() == type) return true; MSimdUnbox *replace = MSimdUnbox::New(alloc, in, type); ins->block()->insertBefore(ins, replace); ins->replaceOperand(op, replace); return replace->typePolicy()->adjustInputs(alloc, replace); }
bool SimdSameAsReturnedTypePolicy<Op>::staticAdjustInputs(TempAllocator &alloc, MInstruction *ins) { MIRType type = ins->type(); MOZ_ASSERT(IsSimdType(type)); MDefinition *in = ins->getOperand(Op); if (in->type() == type) return true; MSimdUnbox *replace = MSimdUnbox::New(alloc, in, type); ins->block()->insertBefore(ins, replace); ins->replaceOperand(Op, replace); return replace->typePolicy()->adjustInputs(alloc, replace); }