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

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 2063693002: [builtins] Introduce proper Float64Log2 and Float64Log10 operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More precise log10. Created 4 years, 6 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 | « src/compiler/instruction-scheduler.cc ('k') | src/compiler/js-builtin-reducer.h » ('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 #include "src/compiler/instruction-selector.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/adapters.h" 9 #include "src/base/adapters.h"
10 #include "src/compiler/instruction-selector-impl.h" 10 #include "src/compiler/instruction-selector-impl.h"
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 case IrOpcode::kFloat64Abs: 1135 case IrOpcode::kFloat64Abs:
1136 return MarkAsFloat64(node), VisitFloat64Abs(node); 1136 return MarkAsFloat64(node), VisitFloat64Abs(node);
1137 case IrOpcode::kFloat64Atan: 1137 case IrOpcode::kFloat64Atan:
1138 return MarkAsFloat64(node), VisitFloat64Atan(node); 1138 return MarkAsFloat64(node), VisitFloat64Atan(node);
1139 case IrOpcode::kFloat64Atan2: 1139 case IrOpcode::kFloat64Atan2:
1140 return MarkAsFloat64(node), VisitFloat64Atan2(node); 1140 return MarkAsFloat64(node), VisitFloat64Atan2(node);
1141 case IrOpcode::kFloat64Log: 1141 case IrOpcode::kFloat64Log:
1142 return MarkAsFloat64(node), VisitFloat64Log(node); 1142 return MarkAsFloat64(node), VisitFloat64Log(node);
1143 case IrOpcode::kFloat64Log1p: 1143 case IrOpcode::kFloat64Log1p:
1144 return MarkAsFloat64(node), VisitFloat64Log1p(node); 1144 return MarkAsFloat64(node), VisitFloat64Log1p(node);
1145 case IrOpcode::kFloat64Log2:
1146 return MarkAsFloat64(node), VisitFloat64Log2(node);
1147 case IrOpcode::kFloat64Log10:
1148 return MarkAsFloat64(node), VisitFloat64Log10(node);
1145 case IrOpcode::kFloat64Sqrt: 1149 case IrOpcode::kFloat64Sqrt:
1146 return MarkAsFloat64(node), VisitFloat64Sqrt(node); 1150 return MarkAsFloat64(node), VisitFloat64Sqrt(node);
1147 case IrOpcode::kFloat64Equal: 1151 case IrOpcode::kFloat64Equal:
1148 return VisitFloat64Equal(node); 1152 return VisitFloat64Equal(node);
1149 case IrOpcode::kFloat64LessThan: 1153 case IrOpcode::kFloat64LessThan:
1150 return VisitFloat64LessThan(node); 1154 return VisitFloat64LessThan(node);
1151 case IrOpcode::kFloat64LessThanOrEqual: 1155 case IrOpcode::kFloat64LessThanOrEqual:
1152 return VisitFloat64LessThanOrEqual(node); 1156 return VisitFloat64LessThanOrEqual(node);
1153 case IrOpcode::kFloat32RoundDown: 1157 case IrOpcode::kFloat32RoundDown:
1154 return MarkAsFloat32(node), VisitFloat32RoundDown(node); 1158 return MarkAsFloat32(node), VisitFloat32RoundDown(node);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 } 1260 }
1257 1261
1258 void InstructionSelector::VisitFloat64Log(Node* node) { 1262 void InstructionSelector::VisitFloat64Log(Node* node) {
1259 VisitFloat64Ieee754Unop(node, kIeee754Float64Log); 1263 VisitFloat64Ieee754Unop(node, kIeee754Float64Log);
1260 } 1264 }
1261 1265
1262 void InstructionSelector::VisitFloat64Log1p(Node* node) { 1266 void InstructionSelector::VisitFloat64Log1p(Node* node) {
1263 VisitFloat64Ieee754Unop(node, kIeee754Float64Log1p); 1267 VisitFloat64Ieee754Unop(node, kIeee754Float64Log1p);
1264 } 1268 }
1265 1269
1270 void InstructionSelector::VisitFloat64Log2(Node* node) {
1271 VisitFloat64Ieee754Unop(node, kIeee754Float64Log2);
1272 }
1273
1274 void InstructionSelector::VisitFloat64Log10(Node* node) {
1275 VisitFloat64Ieee754Unop(node, kIeee754Float64Log10);
1276 }
1277
1266 void InstructionSelector::EmitTableSwitch(const SwitchInfo& sw, 1278 void InstructionSelector::EmitTableSwitch(const SwitchInfo& sw,
1267 InstructionOperand& index_operand) { 1279 InstructionOperand& index_operand) {
1268 OperandGenerator g(this); 1280 OperandGenerator g(this);
1269 size_t input_count = 2 + sw.value_range; 1281 size_t input_count = 2 + sw.value_range;
1270 auto* inputs = zone()->NewArray<InstructionOperand>(input_count); 1282 auto* inputs = zone()->NewArray<InstructionOperand>(input_count);
1271 inputs[0] = index_operand; 1283 inputs[0] = index_operand;
1272 InstructionOperand default_operand = g.Label(sw.default_branch); 1284 InstructionOperand default_operand = g.Label(sw.default_branch);
1273 std::fill(&inputs[1], &inputs[input_count], default_operand); 1285 std::fill(&inputs[1], &inputs[input_count], default_operand);
1274 for (size_t index = 0; index < sw.case_count; ++index) { 1286 for (size_t index = 0; index < sw.case_count; ++index) {
1275 size_t value = sw.case_values[index] - sw.min_value; 1287 size_t value = sw.case_values[index] - sw.min_value;
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 return new (instruction_zone()) FrameStateDescriptor( 1889 return new (instruction_zone()) FrameStateDescriptor(
1878 instruction_zone(), state_info.type(), state_info.bailout_id(), 1890 instruction_zone(), state_info.type(), state_info.bailout_id(),
1879 state_info.state_combine(), parameters, locals, stack, 1891 state_info.state_combine(), parameters, locals, stack,
1880 state_info.shared_info(), outer_state); 1892 state_info.shared_info(), outer_state);
1881 } 1893 }
1882 1894
1883 1895
1884 } // namespace compiler 1896 } // namespace compiler
1885 } // namespace internal 1897 } // namespace internal
1886 } // namespace v8 1898 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-scheduler.cc ('k') | src/compiler/js-builtin-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698