__ Trunc_uw_d(i.InputDoubleRegister(0), i.OutputRegister(), scratch);
break;
}
+ case kMipsFmoveLowUwD:
+ __ FmoveLow(i.OutputRegister(), i.InputDoubleRegister(0));
+ break;
+ case kMipsFmoveLowDUw:
+ __ FmoveLow(i.OutputDoubleRegister(), i.InputRegister(1));
+ break;
+ case kMipsFmoveHighUwD:
+ __ FmoveHigh(i.OutputRegister(), i.InputDoubleRegister(0));
+ break;
+ case kMipsFmoveHighDUw:
+ __ FmoveHigh(i.OutputDoubleRegister(), i.InputRegister(1));
+ break;
// ... more basic instructions ...
case kMipsLbu:
V(MipsSwc1) \
V(MipsLdc1) \
V(MipsSdc1) \
+ V(MipsFmoveLowUwD) \
+ V(MipsFmoveLowDUw) \
+ V(MipsFmoveHighUwD) \
+ V(MipsFmoveHighDUw) \
V(MipsPush) \
V(MipsStoreToStackSlot) \
V(MipsStackClaim) \
}
+void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) {
+ MipsOperandGenerator g(this);
+ Emit(kMipsFmoveLowUwD, g.DefineAsRegister(node),
+ g.UseRegister(node->InputAt(0)));
+}
+
+
+void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) {
+ MipsOperandGenerator g(this);
+ Emit(kMipsFmoveHighUwD, g.DefineAsRegister(node),
+ g.UseRegister(node->InputAt(0)));
+}
+
+
+void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
+ MipsOperandGenerator g(this);
+ Node* left = node->InputAt(0);
+ Node* right = node->InputAt(1);
+ Emit(kMipsFmoveLowDUw, g.DefineSameAsFirst(node), g.UseRegister(left),
+ g.UseRegister(right));
+}
+
+
+void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
+ MipsOperandGenerator g(this);
+ Node* left = node->InputAt(0);
+ Node* right = node->InputAt(1);
+ Emit(kMipsFmoveHighDUw, g.DefineSameAsFirst(node), g.UseRegister(left),
+ g.UseRegister(right));
+}
+
+
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
__ Trunc_uw_d(i.InputDoubleRegister(0), i.OutputRegister(), scratch);
break;
}
+ case kMips64FmoveLowUwD:
+ __ FmoveLow(i.OutputRegister(), i.InputDoubleRegister(0));
+ // remove sign.
+ __ dsll32(i.OutputRegister(), i.OutputRegister(), 0);
+ __ dsrl32(i.OutputRegister(), i.OutputRegister(), 0);
+ break;
+ case kMips64FmoveLowDUw:
+ __ FmoveLow(i.OutputDoubleRegister(), i.InputRegister(1));
+ break;
+ case kMips64FmoveHighUwD:
+ __ FmoveHigh(i.OutputRegister(), i.InputDoubleRegister(0));
+ break;
+ case kMips64FmoveHighDUw:
+ __ FmoveHigh(i.OutputDoubleRegister(), i.InputRegister(1));
+ break;
// ... more basic instructions ...
case kMips64Lbu:
V(Mips64Swc1) \
V(Mips64Ldc1) \
V(Mips64Sdc1) \
+ V(Mips64FmoveLowUwD) \
+ V(Mips64FmoveLowDUw) \
+ V(Mips64FmoveHighUwD) \
+ V(Mips64FmoveHighDUw) \
V(Mips64Push) \
V(Mips64StoreToStackSlot) \
V(Mips64StackClaim) \
}
+void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) {
+ Mips64OperandGenerator g(this);
+ Emit(kMips64FmoveLowUwD, g.DefineAsRegister(node),
+ g.UseRegister(node->InputAt(0)));
+}
+
+
+void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) {
+ Mips64OperandGenerator g(this);
+ Emit(kMips64FmoveHighUwD, g.DefineAsRegister(node),
+ g.UseRegister(node->InputAt(0)));
+}
+
+
+void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
+ Mips64OperandGenerator g(this);
+ Node* left = node->InputAt(0);
+ Node* right = node->InputAt(1);
+ Emit(kMips64FmoveLowDUw, g.DefineSameAsFirst(node), g.UseRegister(left),
+ g.UseRegister(right));
+}
+
+
+void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
+ Mips64OperandGenerator g(this);
+ Node* left = node->InputAt(0);
+ Node* right = node->InputAt(1);
+ Emit(kMips64FmoveHighDUw, g.DefineSameAsFirst(node), g.UseRegister(left),
+ g.UseRegister(right));
+}
+
+
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
}
+void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) {
+ if (IsFp64Mode()) {
+ DCHECK(!src_low.is(at));
+ mfhc1(at, dst);
+ mtc1(src_low, dst);
+ mthc1(at, dst);
+ } else {
+ mtc1(src_low, dst);
+ }
+}
+
+
void MacroAssembler::Move(FPURegister dst, float imm) {
li(at, Operand(bit_cast<int32_t>(imm)));
mtc1(at, dst);
Mfhc1(dst_high, src);
}
+ inline void FmoveHigh(FPURegister dst, Register src_high) {
+ Mthc1(src_high, dst);
+ }
+
inline void FmoveLow(Register dst_low, FPURegister src) {
mfc1(dst_low, src);
}
+ void FmoveLow(FPURegister dst, Register src_low);
+
inline void Move(FPURegister dst, Register src_low, Register src_high) {
mtc1(src_low, dst);
Mthc1(src_high, dst);
}
+void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) {
+ DCHECK(!src_low.is(at));
+ mfhc1(at, dst);
+ mtc1(src_low, dst);
+ mthc1(at, dst);
+}
+
+
void MacroAssembler::Move(FPURegister dst, float imm) {
li(at, Operand(bit_cast<int32_t>(imm)));
mtc1(at, dst);
mfhc1(dst_high, src);
}
+ inline void FmoveHigh(FPURegister dst, Register src_high) {
+ mthc1(src_high, dst);
+ }
+
inline void FmoveLow(Register dst_low, FPURegister src) {
mfc1(dst_low, src);
}
+ void FmoveLow(FPURegister dst, Register src_low);
+
inline void Move(FPURegister dst, Register src_low, Register src_high) {
mtc1(src_low, dst);
mthc1(src_high, dst);