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

Side by Side Diff: src/compiler/x87/code-generator-x87.cc

Issue 2223793002: X87: [x64][ia32] Add Support for the Float64Neg and Float32Neg turbofan operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | src/compiler/x87/instruction-codes-x87.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 case kX87Float32Abs: { 1172 case kX87Float32Abs: {
1173 if (FLAG_debug_code && FLAG_enable_slow_asserts) { 1173 if (FLAG_debug_code && FLAG_enable_slow_asserts) {
1174 __ VerifyX87StackDepth(1); 1174 __ VerifyX87StackDepth(1);
1175 } 1175 }
1176 __ fstp(0); 1176 __ fstp(0);
1177 __ fld_s(MemOperand(esp, 0)); 1177 __ fld_s(MemOperand(esp, 0));
1178 __ fabs(); 1178 __ fabs();
1179 __ lea(esp, Operand(esp, kFloatSize)); 1179 __ lea(esp, Operand(esp, kFloatSize));
1180 break; 1180 break;
1181 } 1181 }
1182 case kX87Float32Neg: {
1183 if (FLAG_debug_code && FLAG_enable_slow_asserts) {
1184 __ VerifyX87StackDepth(1);
1185 }
1186 __ fstp(0);
1187 __ fld_s(MemOperand(esp, 0));
1188 __ fchs();
1189 __ lea(esp, Operand(esp, kFloatSize));
1190 break;
1191 }
1182 case kX87Float32Round: { 1192 case kX87Float32Round: {
1183 RoundingMode mode = 1193 RoundingMode mode =
1184 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); 1194 static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
1185 // Set the correct round mode in x87 control register 1195 // Set the correct round mode in x87 control register
1186 __ X87SetRC((mode << 10)); 1196 __ X87SetRC((mode << 10));
1187 1197
1188 if (!instr->InputAt(0)->IsFPRegister()) { 1198 if (!instr->InputAt(0)->IsFPRegister()) {
1189 InstructionOperand* input = instr->InputAt(0); 1199 InstructionOperand* input = instr->InputAt(0);
1190 USE(input); 1200 USE(input);
1191 DCHECK(input->IsFPStackSlot()); 1201 DCHECK(input->IsFPStackSlot());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 case kX87Float64Abs: { 1356 case kX87Float64Abs: {
1347 if (FLAG_debug_code && FLAG_enable_slow_asserts) { 1357 if (FLAG_debug_code && FLAG_enable_slow_asserts) {
1348 __ VerifyX87StackDepth(1); 1358 __ VerifyX87StackDepth(1);
1349 } 1359 }
1350 __ fstp(0); 1360 __ fstp(0);
1351 __ fld_d(MemOperand(esp, 0)); 1361 __ fld_d(MemOperand(esp, 0));
1352 __ fabs(); 1362 __ fabs();
1353 __ lea(esp, Operand(esp, kDoubleSize)); 1363 __ lea(esp, Operand(esp, kDoubleSize));
1354 break; 1364 break;
1355 } 1365 }
1366 case kX87Float64Neg: {
1367 if (FLAG_debug_code && FLAG_enable_slow_asserts) {
1368 __ VerifyX87StackDepth(1);
1369 }
1370 __ fstp(0);
1371 __ fld_d(MemOperand(esp, 0));
1372 __ fchs();
1373 __ lea(esp, Operand(esp, kDoubleSize));
1374 break;
1375 }
1356 case kX87Int32ToFloat32: { 1376 case kX87Int32ToFloat32: {
1357 InstructionOperand* input = instr->InputAt(0); 1377 InstructionOperand* input = instr->InputAt(0);
1358 DCHECK(input->IsRegister() || input->IsStackSlot()); 1378 DCHECK(input->IsRegister() || input->IsStackSlot());
1359 if (FLAG_debug_code && FLAG_enable_slow_asserts) { 1379 if (FLAG_debug_code && FLAG_enable_slow_asserts) {
1360 __ VerifyX87StackDepth(1); 1380 __ VerifyX87StackDepth(1);
1361 } 1381 }
1362 __ fstp(0); 1382 __ fstp(0);
1363 if (input->IsRegister()) { 1383 if (input->IsRegister()) {
1364 Register input_reg = i.InputRegister(0); 1384 Register input_reg = i.InputRegister(0);
1365 __ push(input_reg); 1385 __ push(input_reg);
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2636 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2617 __ Nop(padding_size); 2637 __ Nop(padding_size);
2618 } 2638 }
2619 } 2639 }
2620 2640
2621 #undef __ 2641 #undef __
2622 2642
2623 } // namespace compiler 2643 } // namespace compiler
2624 } // namespace internal 2644 } // namespace internal
2625 } // namespace v8 2645 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/x87/instruction-codes-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698