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

Side by Side Diff: src/compiler/instruction-selector-unittest.h

Issue 600383002: [turbofan] Add backend support for Float32Constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add InstructionSelector unit test. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/instruction-selector-unittest.cc » ('j') | 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. 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 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return !IsDouble(virtual_register) && !IsReference(virtual_register); 136 return !IsDouble(virtual_register) && !IsReference(virtual_register);
137 } 137 }
138 138
139 bool IsReference(const InstructionOperand* operand) const { 139 bool IsReference(const InstructionOperand* operand) const {
140 return IsReference(ToVreg(operand)); 140 return IsReference(ToVreg(operand));
141 } 141 }
142 bool IsReference(int virtual_register) const { 142 bool IsReference(int virtual_register) const {
143 return references_.find(virtual_register) != references_.end(); 143 return references_.find(virtual_register) != references_.end();
144 } 144 }
145 145
146 float ToFloat32(const InstructionOperand* operand) const {
147 return ToConstant(operand).ToFloat32();
148 }
149
146 int32_t ToInt32(const InstructionOperand* operand) const { 150 int32_t ToInt32(const InstructionOperand* operand) const {
147 return ToConstant(operand).ToInt32(); 151 return ToConstant(operand).ToInt32();
148 } 152 }
149 153
150 int64_t ToInt64(const InstructionOperand* operand) const { 154 int64_t ToInt64(const InstructionOperand* operand) const {
151 return ToConstant(operand).ToInt64(); 155 return ToConstant(operand).ToInt64();
152 } 156 }
153 157
154 int ToVreg(const InstructionOperand* operand) const { 158 int ToVreg(const InstructionOperand* operand) const {
155 if (operand->IsConstant()) return operand->index(); 159 if (operand->IsConstant()) return operand->index();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 template <typename T> 204 template <typename T>
201 class InstructionSelectorTestWithParam 205 class InstructionSelectorTestWithParam
202 : public InstructionSelectorTest, 206 : public InstructionSelectorTest,
203 public ::testing::WithParamInterface<T> {}; 207 public ::testing::WithParamInterface<T> {};
204 208
205 } // namespace compiler 209 } // namespace compiler
206 } // namespace internal 210 } // namespace internal
207 } // namespace v8 211 } // namespace v8
208 212
209 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ 213 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/instruction-selector-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698