OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "test/cctest/cctest.h" | 5 #include "test/cctest/cctest.h" |
6 | 6 |
7 #include "src/base/utils/random-number-generator.h" | 7 #include "src/base/utils/random-number-generator.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/compiler/graph-inl.h" | 9 #include "src/compiler/graph-inl.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 ReducerTester R; | 788 ReducerTester R; |
789 R.binop = R.machine.Float64Mul(); | 789 R.binop = R.machine.Float64Mul(); |
790 | 790 |
791 FOR_FLOAT64_INPUTS(pl) { | 791 FOR_FLOAT64_INPUTS(pl) { |
792 FOR_FLOAT64_INPUTS(pr) { | 792 FOR_FLOAT64_INPUTS(pr) { |
793 double x = *pl, y = *pr; | 793 double x = *pl, y = *pr; |
794 R.CheckFoldBinop<double>(x * y, x, y); | 794 R.CheckFoldBinop<double>(x * y, x, y); |
795 } | 795 } |
796 } | 796 } |
797 | 797 |
798 double inf = std::numeric_limits<double>::infinity(); | 798 double inf = V8_INFINITY; |
799 R.CheckPutConstantOnRight(-inf); | 799 R.CheckPutConstantOnRight(-inf); |
800 R.CheckPutConstantOnRight(-0.1); | 800 R.CheckPutConstantOnRight(-0.1); |
801 R.CheckPutConstantOnRight(0.1); | 801 R.CheckPutConstantOnRight(0.1); |
802 R.CheckPutConstantOnRight(inf); | 802 R.CheckPutConstantOnRight(inf); |
803 | 803 |
804 Node* x = R.Parameter(); | 804 Node* x = R.Parameter(); |
805 Node* one = R.Constant<double>(1.0); | 805 Node* one = R.Constant<double>(1.0); |
806 | 806 |
807 R.CheckBinop(x, x, one); // x * 1.0 => x | 807 R.CheckBinop(x, x, one); // x * 1.0 => x |
808 R.CheckBinop(x, one, x); // 1.0 * x => x | 808 R.CheckBinop(x, one, x); // 1.0 * x => x |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 // TODO(titzer): test MachineOperatorReducer for Int64Mul | 864 // TODO(titzer): test MachineOperatorReducer for Int64Mul |
865 // TODO(titzer): test MachineOperatorReducer for Int64UMul | 865 // TODO(titzer): test MachineOperatorReducer for Int64UMul |
866 // TODO(titzer): test MachineOperatorReducer for Int64Div | 866 // TODO(titzer): test MachineOperatorReducer for Int64Div |
867 // TODO(titzer): test MachineOperatorReducer for Uint64Div | 867 // TODO(titzer): test MachineOperatorReducer for Uint64Div |
868 // TODO(titzer): test MachineOperatorReducer for Int64Mod | 868 // TODO(titzer): test MachineOperatorReducer for Int64Mod |
869 // TODO(titzer): test MachineOperatorReducer for Uint64Mod | 869 // TODO(titzer): test MachineOperatorReducer for Uint64Mod |
870 // TODO(titzer): test MachineOperatorReducer for Int64Neg | 870 // TODO(titzer): test MachineOperatorReducer for Int64Neg |
871 // TODO(titzer): test MachineOperatorReducer for ChangeInt32ToFloat64 | 871 // TODO(titzer): test MachineOperatorReducer for ChangeInt32ToFloat64 |
872 // TODO(titzer): test MachineOperatorReducer for ChangeFloat64ToInt32 | 872 // TODO(titzer): test MachineOperatorReducer for ChangeFloat64ToInt32 |
873 // TODO(titzer): test MachineOperatorReducer for Float64Compare | 873 // TODO(titzer): test MachineOperatorReducer for Float64Compare |
OLD | NEW |