Commit ee7f97c8 authored by titzer@chromium.org's avatar titzer@chromium.org

TF: Rename ConvertXToY machine operators to ChangeXToY.

R=bmeurer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/435923002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22788 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 204f1ce8
...@@ -705,28 +705,28 @@ void InstructionSelector::VisitInt32UMod(Node* node) { ...@@ -705,28 +705,28 @@ void InstructionSelector::VisitInt32UMod(Node* node) {
} }
void InstructionSelector::VisitConvertInt32ToFloat64(Node* node) { void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
ArmOperandGenerator g(this); ArmOperandGenerator g(this);
Emit(kArmVcvtF64S32, g.DefineAsDoubleRegister(node), Emit(kArmVcvtF64S32, g.DefineAsDoubleRegister(node),
g.UseRegister(node->InputAt(0))); g.UseRegister(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) { void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
ArmOperandGenerator g(this); ArmOperandGenerator g(this);
Emit(kArmVcvtF64U32, g.DefineAsDoubleRegister(node), Emit(kArmVcvtF64U32, g.DefineAsDoubleRegister(node),
g.UseRegister(node->InputAt(0))); g.UseRegister(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertFloat64ToInt32(Node* node) { void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
ArmOperandGenerator g(this); ArmOperandGenerator g(this);
Emit(kArmVcvtS32F64, g.DefineAsRegister(node), Emit(kArmVcvtS32F64, g.DefineAsRegister(node),
g.UseDoubleRegister(node->InputAt(0))); g.UseDoubleRegister(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertFloat64ToUint32(Node* node) { void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
ArmOperandGenerator g(this); ArmOperandGenerator g(this);
Emit(kArmVcvtU32F64, g.DefineAsRegister(node), Emit(kArmVcvtU32F64, g.DefineAsRegister(node),
g.UseDoubleRegister(node->InputAt(0))); g.UseDoubleRegister(node->InputAt(0)));
......
...@@ -426,28 +426,28 @@ void InstructionSelector::VisitConvertInt64ToInt32(Node* node) { ...@@ -426,28 +426,28 @@ void InstructionSelector::VisitConvertInt64ToInt32(Node* node) {
} }
void InstructionSelector::VisitConvertInt32ToFloat64(Node* node) { void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
Arm64OperandGenerator g(this); Arm64OperandGenerator g(this);
Emit(kArm64Int32ToFloat64, g.DefineAsDoubleRegister(node), Emit(kArm64Int32ToFloat64, g.DefineAsDoubleRegister(node),
g.UseRegister(node->InputAt(0))); g.UseRegister(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) { void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
Arm64OperandGenerator g(this); Arm64OperandGenerator g(this);
Emit(kArm64Uint32ToFloat64, g.DefineAsDoubleRegister(node), Emit(kArm64Uint32ToFloat64, g.DefineAsDoubleRegister(node),
g.UseRegister(node->InputAt(0))); g.UseRegister(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertFloat64ToInt32(Node* node) { void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
Arm64OperandGenerator g(this); Arm64OperandGenerator g(this);
Emit(kArm64Float64ToInt32, g.DefineAsRegister(node), Emit(kArm64Float64ToInt32, g.DefineAsRegister(node),
g.UseDoubleRegister(node->InputAt(0))); g.UseDoubleRegister(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertFloat64ToUint32(Node* node) { void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
Arm64OperandGenerator g(this); Arm64OperandGenerator g(this);
Emit(kArm64Float64ToUint32, g.DefineAsRegister(node), Emit(kArm64Float64ToUint32, g.DefineAsRegister(node),
g.UseDoubleRegister(node->InputAt(0))); g.UseDoubleRegister(node->InputAt(0)));
......
...@@ -363,14 +363,14 @@ void InstructionSelector::VisitInt32UMod(Node* node) { ...@@ -363,14 +363,14 @@ void InstructionSelector::VisitInt32UMod(Node* node) {
} }
void InstructionSelector::VisitConvertInt32ToFloat64(Node* node) { void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
IA32OperandGenerator g(this); IA32OperandGenerator g(this);
Emit(kSSEInt32ToFloat64, g.DefineAsDoubleRegister(node), Emit(kSSEInt32ToFloat64, g.DefineAsDoubleRegister(node),
g.Use(node->InputAt(0))); g.Use(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) { void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
IA32OperandGenerator g(this); IA32OperandGenerator g(this);
// TODO(turbofan): IA32 SSE LoadUint32() should take an operand. // TODO(turbofan): IA32 SSE LoadUint32() should take an operand.
Emit(kSSEUint32ToFloat64, g.DefineAsDoubleRegister(node), Emit(kSSEUint32ToFloat64, g.DefineAsDoubleRegister(node),
...@@ -378,13 +378,13 @@ void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) { ...@@ -378,13 +378,13 @@ void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) {
} }
void InstructionSelector::VisitConvertFloat64ToInt32(Node* node) { void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
IA32OperandGenerator g(this); IA32OperandGenerator g(this);
Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertFloat64ToUint32(Node* node) { void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
IA32OperandGenerator g(this); IA32OperandGenerator g(this);
// TODO(turbofan): IA32 SSE subsd() should take an operand. // TODO(turbofan): IA32 SSE subsd() should take an operand.
Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node),
......
...@@ -551,14 +551,14 @@ void InstructionSelector::VisitNode(Node* node) { ...@@ -551,14 +551,14 @@ void InstructionSelector::VisitNode(Node* node) {
return VisitConvertInt32ToInt64(node); return VisitConvertInt32ToInt64(node);
case IrOpcode::kConvertInt64ToInt32: case IrOpcode::kConvertInt64ToInt32:
return VisitConvertInt64ToInt32(node); return VisitConvertInt64ToInt32(node);
case IrOpcode::kConvertInt32ToFloat64: case IrOpcode::kChangeInt32ToFloat64:
return MarkAsDouble(node), VisitConvertInt32ToFloat64(node); return MarkAsDouble(node), VisitChangeInt32ToFloat64(node);
case IrOpcode::kConvertUint32ToFloat64: case IrOpcode::kChangeUint32ToFloat64:
return MarkAsDouble(node), VisitConvertUint32ToFloat64(node); return MarkAsDouble(node), VisitChangeUint32ToFloat64(node);
case IrOpcode::kConvertFloat64ToInt32: case IrOpcode::kChangeFloat64ToInt32:
return VisitConvertFloat64ToInt32(node); return VisitChangeFloat64ToInt32(node);
case IrOpcode::kConvertFloat64ToUint32: case IrOpcode::kChangeFloat64ToUint32:
return VisitConvertFloat64ToUint32(node); return VisitChangeFloat64ToUint32(node);
case IrOpcode::kFloat64Add: case IrOpcode::kFloat64Add:
return MarkAsDouble(node), VisitFloat64Add(node); return MarkAsDouble(node), VisitFloat64Add(node);
case IrOpcode::kFloat64Sub: case IrOpcode::kFloat64Sub:
......
...@@ -335,17 +335,17 @@ class MachineNodeFactory { ...@@ -335,17 +335,17 @@ class MachineNodeFactory {
Node* ConvertInt64ToInt32(Node* a) { Node* ConvertInt64ToInt32(Node* a) {
return NEW_NODE_1(MACHINE()->ConvertInt64ToInt32(), a); return NEW_NODE_1(MACHINE()->ConvertInt64ToInt32(), a);
} }
Node* ConvertInt32ToFloat64(Node* a) { Node* ChangeInt32ToFloat64(Node* a) {
return NEW_NODE_1(MACHINE()->ConvertInt32ToFloat64(), a); return NEW_NODE_1(MACHINE()->ChangeInt32ToFloat64(), a);
} }
Node* ConvertUint32ToFloat64(Node* a) { Node* ChangeUint32ToFloat64(Node* a) {
return NEW_NODE_1(MACHINE()->ConvertUint32ToFloat64(), a); return NEW_NODE_1(MACHINE()->ChangeUint32ToFloat64(), a);
} }
Node* ConvertFloat64ToInt32(Node* a) { Node* ChangeFloat64ToInt32(Node* a) {
return NEW_NODE_1(MACHINE()->ConvertFloat64ToInt32(), a); return NEW_NODE_1(MACHINE()->ChangeFloat64ToInt32(), a);
} }
Node* ConvertFloat64ToUint32(Node* a) { Node* ChangeFloat64ToUint32(Node* a) {
return NEW_NODE_1(MACHINE()->ConvertFloat64ToUint32(), a); return NEW_NODE_1(MACHINE()->ChangeFloat64ToUint32(), a);
} }
#ifdef MACHINE_ASSEMBLER_SUPPORTS_CALL_C #ifdef MACHINE_ASSEMBLER_SUPPORTS_CALL_C
......
...@@ -147,10 +147,10 @@ class MachineOperatorBuilder { ...@@ -147,10 +147,10 @@ class MachineOperatorBuilder {
// defined for these operators, since they are intended only for use with // defined for these operators, since they are intended only for use with
// integers. // integers.
// TODO(titzer): rename ConvertXXX to ChangeXXX in machine operators. // TODO(titzer): rename ConvertXXX to ChangeXXX in machine operators.
Operator* ConvertInt32ToFloat64() { UNOP(ConvertInt32ToFloat64); } Operator* ChangeInt32ToFloat64() { UNOP(ChangeInt32ToFloat64); }
Operator* ConvertUint32ToFloat64() { UNOP(ConvertUint32ToFloat64); } Operator* ChangeUint32ToFloat64() { UNOP(ChangeUint32ToFloat64); }
Operator* ConvertFloat64ToInt32() { UNOP(ConvertFloat64ToInt32); } Operator* ChangeFloat64ToInt32() { UNOP(ChangeFloat64ToInt32); }
Operator* ConvertFloat64ToUint32() { UNOP(ConvertFloat64ToUint32); } Operator* ChangeFloat64ToUint32() { UNOP(ChangeFloat64ToUint32); }
// Floating point operators always operate with IEEE 754 round-to-nearest. // Floating point operators always operate with IEEE 754 round-to-nearest.
Operator* Float64Add() { BINOP_C(Float64Add); } Operator* Float64Add() { BINOP_C(Float64Add); }
......
...@@ -155,57 +155,57 @@ ...@@ -155,57 +155,57 @@
V(StoreElement) V(StoreElement)
// Opcodes for Machine-level operators. // Opcodes for Machine-level operators.
#define MACHINE_OP_LIST(V) \ #define MACHINE_OP_LIST(V) \
V(Load) \ V(Load) \
V(Store) \ V(Store) \
V(Word32And) \ V(Word32And) \
V(Word32Or) \ V(Word32Or) \
V(Word32Xor) \ V(Word32Xor) \
V(Word32Shl) \ V(Word32Shl) \
V(Word32Shr) \ V(Word32Shr) \
V(Word32Sar) \ V(Word32Sar) \
V(Word32Equal) \ V(Word32Equal) \
V(Word64And) \ V(Word64And) \
V(Word64Or) \ V(Word64Or) \
V(Word64Xor) \ V(Word64Xor) \
V(Word64Shl) \ V(Word64Shl) \
V(Word64Shr) \ V(Word64Shr) \
V(Word64Sar) \ V(Word64Sar) \
V(Word64Equal) \ V(Word64Equal) \
V(Int32Add) \ V(Int32Add) \
V(Int32AddWithOverflow) \ V(Int32AddWithOverflow) \
V(Int32Sub) \ V(Int32Sub) \
V(Int32Mul) \ V(Int32Mul) \
V(Int32Div) \ V(Int32Div) \
V(Int32UDiv) \ V(Int32UDiv) \
V(Int32Mod) \ V(Int32Mod) \
V(Int32UMod) \ V(Int32UMod) \
V(Int32LessThan) \ V(Int32LessThan) \
V(Int32LessThanOrEqual) \ V(Int32LessThanOrEqual) \
V(Uint32LessThan) \ V(Uint32LessThan) \
V(Uint32LessThanOrEqual) \ V(Uint32LessThanOrEqual) \
V(Int64Add) \ V(Int64Add) \
V(Int64Sub) \ V(Int64Sub) \
V(Int64Mul) \ V(Int64Mul) \
V(Int64Div) \ V(Int64Div) \
V(Int64UDiv) \ V(Int64UDiv) \
V(Int64Mod) \ V(Int64Mod) \
V(Int64UMod) \ V(Int64UMod) \
V(Int64LessThan) \ V(Int64LessThan) \
V(Int64LessThanOrEqual) \ V(Int64LessThanOrEqual) \
V(ConvertInt64ToInt32) \ V(ConvertInt64ToInt32) \
V(ConvertInt32ToInt64) \ V(ConvertInt32ToInt64) \
V(ConvertInt32ToFloat64) \ V(ChangeInt32ToFloat64) \
V(ConvertUint32ToFloat64) \ V(ChangeUint32ToFloat64) \
V(ConvertFloat64ToInt32) \ V(ChangeFloat64ToInt32) \
V(ConvertFloat64ToUint32) \ V(ChangeFloat64ToUint32) \
V(Float64Add) \ V(Float64Add) \
V(Float64Sub) \ V(Float64Sub) \
V(Float64Mul) \ V(Float64Mul) \
V(Float64Div) \ V(Float64Div) \
V(Float64Mod) \ V(Float64Mod) \
V(Float64Equal) \ V(Float64Equal) \
V(Float64LessThan) \ V(Float64LessThan) \
V(Float64LessThanOrEqual) V(Float64LessThanOrEqual)
#define VALUE_OP_LIST(V) \ #define VALUE_OP_LIST(V) \
......
...@@ -150,9 +150,9 @@ class RepresentationChanger { ...@@ -150,9 +150,9 @@ class RepresentationChanger {
Operator* op; Operator* op;
if (output_type & rWord32) { if (output_type & rWord32) {
if (output_type & tUint32) { if (output_type & tUint32) {
op = machine()->ConvertUint32ToFloat64(); op = machine()->ChangeUint32ToFloat64();
} else if (output_type & tInt32) { } else if (output_type & tInt32) {
op = machine()->ConvertInt32ToFloat64(); op = machine()->ChangeInt32ToFloat64();
} else { } else {
return TypeError(node, output_type, rFloat64); return TypeError(node, output_type, rFloat64);
} }
...@@ -188,12 +188,10 @@ class RepresentationChanger { ...@@ -188,12 +188,10 @@ class RepresentationChanger {
// Select the correct X -> Word32 operator. // Select the correct X -> Word32 operator.
Operator* op = NULL; Operator* op = NULL;
if (output_type & rFloat64) { if (output_type & rFloat64) {
// TODO(turbofan): could have cheaper float64 conversions that don't do
// the full JavaScript truncation here.
if (output_type & tUint32) { if (output_type & tUint32) {
op = machine()->ConvertFloat64ToUint32(); op = machine()->ChangeFloat64ToUint32();
} else if (output_type & tInt32) { } else if (output_type & tInt32) {
op = machine()->ConvertFloat64ToInt32(); op = machine()->ChangeFloat64ToInt32();
} else { } else {
return TypeError(node, output_type, rWord32); return TypeError(node, output_type, rWord32);
} }
......
...@@ -66,8 +66,8 @@ void SimplifiedLowering::DoChangeTaggedToUI32(Node* node, Node* effect, ...@@ -66,8 +66,8 @@ void SimplifiedLowering::DoChangeTaggedToUI32(Node* node, Node* effect,
Node* loaded = graph()->NewNode( Node* loaded = graph()->NewNode(
machine()->Load(kMachineFloat64), val, machine()->Load(kMachineFloat64), val,
OffsetMinusTagConstant(HeapNumber::kValueOffset), effect); OffsetMinusTagConstant(HeapNumber::kValueOffset), effect);
Operator* op = is_signed ? machine()->ConvertFloat64ToInt32() Operator* op = is_signed ? machine()->ChangeFloat64ToInt32()
: machine()->ConvertFloat64ToUint32(); : machine()->ChangeFloat64ToUint32();
Node* converted = graph()->NewNode(op, loaded); Node* converted = graph()->NewNode(op, loaded);
// false branch. // false branch.
...@@ -100,7 +100,7 @@ void SimplifiedLowering::DoChangeTaggedToFloat64(Node* node, Node* effect, ...@@ -100,7 +100,7 @@ void SimplifiedLowering::DoChangeTaggedToFloat64(Node* node, Node* effect,
Node* fbranch = graph()->NewNode(common()->IfFalse(), branch); Node* fbranch = graph()->NewNode(common()->IfFalse(), branch);
Node* untagged = Untag(val); Node* untagged = Untag(val);
Node* converted = Node* converted =
graph()->NewNode(machine()->ConvertInt32ToFloat64(), untagged); graph()->NewNode(machine()->ChangeInt32ToFloat64(), untagged);
// merge. // merge.
Node* merge = graph()->NewNode(common()->Merge(2), tbranch, fbranch); Node* merge = graph()->NewNode(common()->Merge(2), tbranch, fbranch);
......
...@@ -493,14 +493,14 @@ void InstructionSelector::VisitInt64UMod(Node* node) { ...@@ -493,14 +493,14 @@ void InstructionSelector::VisitInt64UMod(Node* node) {
} }
void InstructionSelector::VisitConvertInt32ToFloat64(Node* node) { void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
X64OperandGenerator g(this); X64OperandGenerator g(this);
Emit(kSSEInt32ToFloat64, g.DefineAsDoubleRegister(node), Emit(kSSEInt32ToFloat64, g.DefineAsDoubleRegister(node),
g.Use(node->InputAt(0))); g.Use(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) { void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
X64OperandGenerator g(this); X64OperandGenerator g(this);
// TODO(turbofan): X64 SSE cvtqsi2sd should support operands. // TODO(turbofan): X64 SSE cvtqsi2sd should support operands.
Emit(kSSEUint32ToFloat64, g.DefineAsDoubleRegister(node), Emit(kSSEUint32ToFloat64, g.DefineAsDoubleRegister(node),
...@@ -508,13 +508,13 @@ void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) { ...@@ -508,13 +508,13 @@ void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) {
} }
void InstructionSelector::VisitConvertFloat64ToInt32(Node* node) { void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
X64OperandGenerator g(this); X64OperandGenerator g(this);
Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
} }
void InstructionSelector::VisitConvertFloat64ToUint32(Node* node) { void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
X64OperandGenerator g(this); X64OperandGenerator g(this);
// TODO(turbofan): X64 SSE cvttsd2siq should support operands. // TODO(turbofan): X64 SSE cvttsd2siq should support operands.
Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node),
......
...@@ -771,6 +771,6 @@ TEST(ReduceFloat64Mod) { ...@@ -771,6 +771,6 @@ TEST(ReduceFloat64Mod) {
// TODO(titzer): test MachineOperatorReducer for Int64Mod // TODO(titzer): test MachineOperatorReducer for Int64Mod
// TODO(titzer): test MachineOperatorReducer for Int64UMod // TODO(titzer): test MachineOperatorReducer for Int64UMod
// TODO(titzer): test MachineOperatorReducer for Int64Neg // TODO(titzer): test MachineOperatorReducer for Int64Neg
// TODO(titzer): test MachineOperatorReducer for ConvertInt32ToFloat64 // TODO(titzer): test MachineOperatorReducer for ChangeInt32ToFloat64
// TODO(titzer): test MachineOperatorReducer for ConvertFloat64ToInt32 // TODO(titzer): test MachineOperatorReducer for ChangeFloat64ToInt32
// TODO(titzer): test MachineOperatorReducer for Float64Compare // TODO(titzer): test MachineOperatorReducer for Float64Compare
...@@ -180,10 +180,10 @@ TEST(SingleChanges) { ...@@ -180,10 +180,10 @@ TEST(SingleChanges) {
CheckChange(IrOpcode::kChangeTaggedToFloat64, rTagged, rFloat64); CheckChange(IrOpcode::kChangeTaggedToFloat64, rTagged, rFloat64);
// Int32,Uint32 <-> Float64 are actually machine conversions. // Int32,Uint32 <-> Float64 are actually machine conversions.
CheckChange(IrOpcode::kConvertInt32ToFloat64, rWord32 | tInt32, rFloat64); CheckChange(IrOpcode::kChangeInt32ToFloat64, rWord32 | tInt32, rFloat64);
CheckChange(IrOpcode::kConvertUint32ToFloat64, rWord32 | tUint32, rFloat64); CheckChange(IrOpcode::kChangeUint32ToFloat64, rWord32 | tUint32, rFloat64);
CheckChange(IrOpcode::kConvertFloat64ToInt32, rFloat64 | tInt32, rWord32); CheckChange(IrOpcode::kChangeFloat64ToInt32, rFloat64 | tInt32, rWord32);
CheckChange(IrOpcode::kConvertFloat64ToUint32, rFloat64 | tUint32, rWord32); CheckChange(IrOpcode::kChangeFloat64ToUint32, rFloat64 | tUint32, rWord32);
} }
...@@ -200,8 +200,8 @@ TEST(SignednessInWord32) { ...@@ -200,8 +200,8 @@ TEST(SignednessInWord32) {
// CheckChange(IrOpcode::kChangeTaggedToInt32, rTagged, rWord32 | tInt32); // CheckChange(IrOpcode::kChangeTaggedToInt32, rTagged, rWord32 | tInt32);
// CheckChange(IrOpcode::kChangeTaggedToUint32, rTagged, rWord32 | tUint32); // CheckChange(IrOpcode::kChangeTaggedToUint32, rTagged, rWord32 | tUint32);
// CheckChange(IrOpcode::kConvertInt32ToFloat64, rWord32, rFloat64); // CheckChange(IrOpcode::kChangeInt32ToFloat64, rWord32, rFloat64);
// CheckChange(IrOpcode::kConvertFloat64ToInt32, rFloat64, rWord32); // CheckChange(IrOpcode::kChangeFloat64ToInt32, rFloat64, rWord32);
} }
......
...@@ -482,7 +482,7 @@ TEST(RunLoopIncrementFloat64) { ...@@ -482,7 +482,7 @@ TEST(RunLoopIncrementFloat64) {
m.Goto(&header); m.Goto(&header);
m.Bind(end); m.Bind(end);
m.Return(m.ConvertFloat64ToInt32(phi)); m.Return(m.ChangeFloat64ToInt32(phi));
CHECK_EQ(10, m.Call()); CHECK_EQ(10, m.Call());
} }
...@@ -2858,12 +2858,12 @@ TEST(RunFloat64ModP) { ...@@ -2858,12 +2858,12 @@ TEST(RunFloat64ModP) {
} }
TEST(RunConvertInt32ToFloat64_A) { TEST(RunChangeInt32ToFloat64_A) {
RawMachineAssemblerTester<int32_t> m; RawMachineAssemblerTester<int32_t> m;
int32_t magic = 0x986234; int32_t magic = 0x986234;
double result = 0; double result = 0;
Node* convert = m.ConvertInt32ToFloat64(m.Int32Constant(magic)); Node* convert = m.ChangeInt32ToFloat64(m.Int32Constant(magic));
m.Store(kMachineFloat64, m.PointerConstant(&result), m.Int32Constant(0), m.Store(kMachineFloat64, m.PointerConstant(&result), m.Int32Constant(0),
convert); convert);
m.Return(m.Int32Constant(magic)); m.Return(m.Int32Constant(magic));
...@@ -2873,11 +2873,11 @@ TEST(RunConvertInt32ToFloat64_A) { ...@@ -2873,11 +2873,11 @@ TEST(RunConvertInt32ToFloat64_A) {
} }
TEST(RunConvertInt32ToFloat64_B) { TEST(RunChangeInt32ToFloat64_B) {
RawMachineAssemblerTester<int32_t> m(kMachineWord32); RawMachineAssemblerTester<int32_t> m(kMachineWord32);
double output = 0; double output = 0;
Node* convert = m.ConvertInt32ToFloat64(m.Parameter(0)); Node* convert = m.ChangeInt32ToFloat64(m.Parameter(0));
m.Store(kMachineFloat64, m.PointerConstant(&output), m.Int32Constant(0), m.Store(kMachineFloat64, m.PointerConstant(&output), m.Int32Constant(0),
convert); convert);
m.Return(m.Parameter(0)); m.Return(m.Parameter(0));
...@@ -2890,11 +2890,11 @@ TEST(RunConvertInt32ToFloat64_B) { ...@@ -2890,11 +2890,11 @@ TEST(RunConvertInt32ToFloat64_B) {
} }
TEST(RunConvertUint32ToFloat64_B) { TEST(RunChangeUint32ToFloat64_B) {
RawMachineAssemblerTester<int32_t> m(kMachineWord32); RawMachineAssemblerTester<int32_t> m(kMachineWord32);
double output = 0; double output = 0;
Node* convert = m.ConvertUint32ToFloat64(m.Parameter(0)); Node* convert = m.ChangeUint32ToFloat64(m.Parameter(0));
m.Store(kMachineFloat64, m.PointerConstant(&output), m.Int32Constant(0), m.Store(kMachineFloat64, m.PointerConstant(&output), m.Int32Constant(0),
convert); convert);
m.Return(m.Parameter(0)); m.Return(m.Parameter(0));
...@@ -2907,14 +2907,14 @@ TEST(RunConvertUint32ToFloat64_B) { ...@@ -2907,14 +2907,14 @@ TEST(RunConvertUint32ToFloat64_B) {
} }
TEST(RunConvertFloat64ToInt32_A) { TEST(RunChangeFloat64ToInt32_A) {
RawMachineAssemblerTester<int32_t> m; RawMachineAssemblerTester<int32_t> m;
int32_t magic = 0x786234; int32_t magic = 0x786234;
double input = 11.1; double input = 11.1;
int32_t result = 0; int32_t result = 0;
m.Store(kMachineWord32, m.PointerConstant(&result), m.Int32Constant(0), m.Store(kMachineWord32, m.PointerConstant(&result), m.Int32Constant(0),
m.ConvertFloat64ToInt32(m.Float64Constant(input))); m.ChangeFloat64ToInt32(m.Float64Constant(input)));
m.Return(m.Int32Constant(magic)); m.Return(m.Int32Constant(magic));
CHECK_EQ(magic, m.Call()); CHECK_EQ(magic, m.Call());
...@@ -2922,14 +2922,14 @@ TEST(RunConvertFloat64ToInt32_A) { ...@@ -2922,14 +2922,14 @@ TEST(RunConvertFloat64ToInt32_A) {
} }
TEST(RunConvertFloat64ToInt32_B) { TEST(RunChangeFloat64ToInt32_B) {
RawMachineAssemblerTester<int32_t> m; RawMachineAssemblerTester<int32_t> m;
double input = 0; double input = 0;
int32_t output = 0; int32_t output = 0;
Node* load = Node* load =
m.Load(kMachineFloat64, m.PointerConstant(&input), m.Int32Constant(0)); m.Load(kMachineFloat64, m.PointerConstant(&input), m.Int32Constant(0));
Node* convert = m.ConvertFloat64ToInt32(load); Node* convert = m.ChangeFloat64ToInt32(load);
m.Store(kMachineWord32, m.PointerConstant(&output), m.Int32Constant(0), m.Store(kMachineWord32, m.PointerConstant(&output), m.Int32Constant(0),
convert); convert);
m.Return(convert); m.Return(convert);
...@@ -2964,14 +2964,14 @@ TEST(RunConvertFloat64ToInt32_B) { ...@@ -2964,14 +2964,14 @@ TEST(RunConvertFloat64ToInt32_B) {
} }
TEST(RunConvertFloat64ToUint32_B) { TEST(RunChangeFloat64ToUint32_B) {
RawMachineAssemblerTester<int32_t> m; RawMachineAssemblerTester<int32_t> m;
double input = 0; double input = 0;
int32_t output = 0; int32_t output = 0;
Node* load = Node* load =
m.Load(kMachineFloat64, m.PointerConstant(&input), m.Int32Constant(0)); m.Load(kMachineFloat64, m.PointerConstant(&input), m.Int32Constant(0));
Node* convert = m.ConvertFloat64ToUint32(load); Node* convert = m.ChangeFloat64ToUint32(load);
m.Store(kMachineWord32, m.PointerConstant(&output), m.Int32Constant(0), m.Store(kMachineWord32, m.PointerConstant(&output), m.Int32Constant(0),
convert); convert);
m.Return(convert); m.Return(convert);
...@@ -3007,7 +3007,7 @@ TEST(RunConvertFloat64ToUint32_B) { ...@@ -3007,7 +3007,7 @@ TEST(RunConvertFloat64ToUint32_B) {
} }
TEST(RunConvertFloat64ToInt32_spilled) { TEST(RunChangeFloat64ToInt32_spilled) {
RawMachineAssemblerTester<int32_t> m; RawMachineAssemblerTester<int32_t> m;
const int kNumInputs = 32; const int kNumInputs = 32;
int32_t magic = 0x786234; int32_t magic = 0x786234;
...@@ -3022,7 +3022,7 @@ TEST(RunConvertFloat64ToInt32_spilled) { ...@@ -3022,7 +3022,7 @@ TEST(RunConvertFloat64ToInt32_spilled) {
for (int i = 0; i < kNumInputs; i++) { for (int i = 0; i < kNumInputs; i++) {
m.Store(kMachineWord32, m.PointerConstant(&result), m.Int32Constant(i * 4), m.Store(kMachineWord32, m.PointerConstant(&result), m.Int32Constant(i * 4),
m.ConvertFloat64ToInt32(input_node[i])); m.ChangeFloat64ToInt32(input_node[i]));
} }
m.Return(m.Int32Constant(magic)); m.Return(m.Int32Constant(magic));
...@@ -3039,19 +3039,19 @@ TEST(RunConvertFloat64ToInt32_spilled) { ...@@ -3039,19 +3039,19 @@ TEST(RunConvertFloat64ToInt32_spilled) {
} }
TEST(RunDeadConvertFloat64ToInt32) { TEST(RunDeadChangeFloat64ToInt32) {
RawMachineAssemblerTester<int32_t> m; RawMachineAssemblerTester<int32_t> m;
const int magic = 0x88abcda4; const int magic = 0x88abcda4;
m.ConvertFloat64ToInt32(m.Float64Constant(999.78)); m.ChangeFloat64ToInt32(m.Float64Constant(999.78));
m.Return(m.Int32Constant(magic)); m.Return(m.Int32Constant(magic));
CHECK_EQ(magic, m.Call()); CHECK_EQ(magic, m.Call());
} }
TEST(RunDeadConvertInt32ToFloat64) { TEST(RunDeadChangeInt32ToFloat64) {
RawMachineAssemblerTester<int32_t> m; RawMachineAssemblerTester<int32_t> m;
const int magic = 0x8834abcd; const int magic = 0x8834abcd;
m.ConvertInt32ToFloat64(m.Int32Constant(magic - 6888)); m.ChangeInt32ToFloat64(m.Int32Constant(magic - 6888));
m.Return(m.Int32Constant(magic)); m.Return(m.Int32Constant(magic));
CHECK_EQ(magic, m.Call()); CHECK_EQ(magic, m.Call());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment