void
LIRGeneratorX86Shared::visitSimdSelect(MSimdSelect* ins)
{
    MOZ_ASSERT(IsSimdType(ins->type()));

    LSimdSelect* lins = new(alloc()) LSimdSelect;
    MDefinition* r0 = ins->getOperand(0);
    MDefinition* r1 = ins->getOperand(1);
    MDefinition* r2 = ins->getOperand(2);

    lins->setOperand(0, useRegister(r0));
    lins->setOperand(1, useRegister(r1));
    lins->setOperand(2, useRegister(r2));
    lins->setTemp(0, temp(LDefinition::SIMD128FLOAT));

    define(lins, ins);
}
void
LIRGeneratorX86Shared::visitSimdSelect(MSimdSelect* ins)
{
    MOZ_ASSERT(IsSimdType(ins->type()));
    MOZ_ASSERT(ins->type() == MIRType::Int32x4 || ins->type() == MIRType::Float32x4,
               "Unknown SIMD kind when doing bitwise operations");

    LSimdSelect* lins = new(alloc()) LSimdSelect;
    MDefinition* r0 = ins->getOperand(0);
    MDefinition* r1 = ins->getOperand(1);
    MDefinition* r2 = ins->getOperand(2);

    lins->setOperand(0, useRegister(r0));
    lins->setOperand(1, useRegister(r1));
    lins->setOperand(2, useRegister(r2));
    lins->setTemp(0, temp(LDefinition::FLOAT32X4));

    define(lins, ins);
}
Exemplo n.º 3
0
bool
LIRGeneratorX86Shared::visitSimdTernaryBitwise(MSimdTernaryBitwise *ins)
{
    MOZ_ASSERT(IsSimdType(ins->type()));

    if (ins->type() == MIRType_Int32x4 || ins->type() == MIRType_Float32x4) {
        LSimdSelect *lins = new(alloc()) LSimdSelect;

        // This must be useRegisterAtStart() because it is destroyed.
        lins->setOperand(0, useRegisterAtStart(ins->getOperand(0)));
        // This must be useRegisterAtStart() because it is destroyed.
        lins->setOperand(1, useRegisterAtStart(ins->getOperand(1)));
        // This could be useRegister(), but combining it with
        // useRegisterAtStart() is broken see bug 772830.
        lins->setOperand(2, useRegisterAtStart(ins->getOperand(2)));
        // The output is constrained to be in the same register as the second
        // argument to avoid redundantly copying the result into place. The
        // register allocator will move the result if necessary.
        return defineReuseInput(lins, ins, 1);
    }

    MOZ_CRASH("Unknown SIMD kind when doing bitwise operations");
    return false;
}