Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: test/cctest/compiler/test-run-machops.cc

Issue 1649323002: X87: Change the test case for X87 RunRoundInt32ToFloat32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/utils/random-number-generator.h" 10 #include "src/base/utils/random-number-generator.h"
(...skipping 5997 matching lines...) Expand 10 before | Expand all | Expand 10 after
6008 input = *i; 6008 input = *i;
6009 int32_t expected = bit_cast<int32_t>(input); 6009 int32_t expected = bit_cast<int32_t>(input);
6010 CHECK_EQ(expected, m.Call()); 6010 CHECK_EQ(expected, m.Call());
6011 } 6011 }
6012 } 6012 }
6013 6013
6014 6014
6015 TEST(RunRoundInt32ToFloat32) { 6015 TEST(RunRoundInt32ToFloat32) {
6016 BufferedRawMachineAssemblerTester<float> m(MachineType::Int32()); 6016 BufferedRawMachineAssemblerTester<float> m(MachineType::Int32());
6017 m.Return(m.RoundInt32ToFloat32(m.Parameter(0))); 6017 m.Return(m.RoundInt32ToFloat32(m.Parameter(0)));
6018 FOR_INT32_INPUTS(i) { CHECK_EQ(static_cast<float>(*i), m.Call(*i)); } 6018 FOR_INT32_INPUTS(i) {
6019 volatile float expected = static_cast<float>(*i);
6020 CHECK_EQ(expected, m.Call(*i));
6021 }
6019 } 6022 }
6020 6023
6021 6024
6022 TEST(RunBitcastInt32ToFloat32) { 6025 TEST(RunBitcastInt32ToFloat32) {
6023 int32_t input = 1; 6026 int32_t input = 1;
6024 float output = 0.0; 6027 float output = 0.0;
6025 RawMachineAssemblerTester<int32_t> m; 6028 RawMachineAssemblerTester<int32_t> m;
6026 m.StoreToPointer( 6029 m.StoreToPointer(
6027 &output, MachineRepresentation::kFloat32, 6030 &output, MachineRepresentation::kFloat32,
6028 m.BitcastInt32ToFloat32(m.LoadFromPointer(&input, MachineType::Int32()))); 6031 m.BitcastInt32ToFloat32(m.LoadFromPointer(&input, MachineType::Int32())));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
6082 Node* call = r.AddNode(r.common()->Call(desc), phi); 6085 Node* call = r.AddNode(r.common()->Call(desc), phi);
6083 r.Return(call); 6086 r.Return(call);
6084 6087
6085 CHECK_EQ(33, r.Call(1)); 6088 CHECK_EQ(33, r.Call(1));
6086 CHECK_EQ(44, r.Call(0)); 6089 CHECK_EQ(44, r.Call(0));
6087 } 6090 }
6088 6091
6089 } // namespace compiler 6092 } // namespace compiler
6090 } // namespace internal 6093 } // namespace internal
6091 } // namespace v8 6094 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698