OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this | 1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include <cmath> | 5 #include <cmath> |
6 #include <functional> | 6 #include <functional> |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/ieee754.h" | 10 #include "src/base/ieee754.h" |
(...skipping 3779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3790 Float32BinopTester bt(&m); | 3790 Float32BinopTester bt(&m); |
3791 bt.AddReturn(m.Float32Min(bt.param0, bt.param1)); | 3791 bt.AddReturn(m.Float32Min(bt.param0, bt.param1)); |
3792 | 3792 |
3793 FOR_FLOAT32_INPUTS(pl) { | 3793 FOR_FLOAT32_INPUTS(pl) { |
3794 FOR_FLOAT32_INPUTS(pr) { | 3794 FOR_FLOAT32_INPUTS(pr) { |
3795 CHECK_FLOAT_EQ(JSMin(*pl, *pr), bt.call(*pl, *pr)); | 3795 CHECK_FLOAT_EQ(JSMin(*pl, *pr), bt.call(*pl, *pr)); |
3796 } | 3796 } |
3797 } | 3797 } |
3798 } | 3798 } |
3799 | 3799 |
| 3800 TEST(RunFloat64Max) { |
| 3801 RawMachineAssemblerTester<int32_t> m; |
| 3802 Float64BinopTester bt(&m); |
| 3803 bt.AddReturn(m.Float64Max(bt.param0, bt.param1)); |
| 3804 |
| 3805 FOR_FLOAT64_INPUTS(pl) { |
| 3806 FOR_FLOAT64_INPUTS(pr) { |
| 3807 CHECK_DOUBLE_EQ(JSMax(*pl, *pr), bt.call(*pl, *pr)); |
| 3808 } |
| 3809 } |
| 3810 } |
| 3811 |
| 3812 TEST(RunFloat64Min) { |
| 3813 RawMachineAssemblerTester<int32_t> m; |
| 3814 Float64BinopTester bt(&m); |
| 3815 bt.AddReturn(m.Float64Min(bt.param0, bt.param1)); |
| 3816 |
| 3817 FOR_FLOAT64_INPUTS(pl) { |
| 3818 FOR_FLOAT64_INPUTS(pr) { |
| 3819 CHECK_DOUBLE_EQ(JSMin(*pl, *pr), bt.call(*pl, *pr)); |
| 3820 } |
| 3821 } |
| 3822 } |
| 3823 |
3800 TEST(RunFloat32SubP) { | 3824 TEST(RunFloat32SubP) { |
3801 RawMachineAssemblerTester<int32_t> m; | 3825 RawMachineAssemblerTester<int32_t> m; |
3802 Float32BinopTester bt(&m); | 3826 Float32BinopTester bt(&m); |
3803 | 3827 |
3804 bt.AddReturn(m.Float32Sub(bt.param0, bt.param1)); | 3828 bt.AddReturn(m.Float32Sub(bt.param0, bt.param1)); |
3805 | 3829 |
3806 FOR_FLOAT32_INPUTS(pl) { | 3830 FOR_FLOAT32_INPUTS(pl) { |
3807 FOR_FLOAT32_INPUTS(pr) { CHECK_FLOAT_EQ(*pl - *pr, bt.call(*pl, *pr)); } | 3831 FOR_FLOAT32_INPUTS(pr) { CHECK_FLOAT_EQ(*pl - *pr, bt.call(*pl, *pr)); } |
3808 } | 3832 } |
3809 } | 3833 } |
(...skipping 2871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6681 r.Goto(&merge); | 6705 r.Goto(&merge); |
6682 r.Bind(&merge); | 6706 r.Bind(&merge); |
6683 Node* phi = r.Phi(MachineRepresentation::kWord32, fa, fb); | 6707 Node* phi = r.Phi(MachineRepresentation::kWord32, fa, fb); |
6684 r.Return(phi); | 6708 r.Return(phi); |
6685 CHECK_EQ(1, r.Call(1)); | 6709 CHECK_EQ(1, r.Call(1)); |
6686 } | 6710 } |
6687 | 6711 |
6688 } // namespace compiler | 6712 } // namespace compiler |
6689 } // namespace internal | 6713 } // namespace internal |
6690 } // namespace v8 | 6714 } // namespace v8 |
OLD | NEW |