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

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

Issue 1597403002: X87: [turbofan] Add the RoundInt32ToFloat32 operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 __ lea(esp, Operand(esp, 2 * kDoubleSize)); 965 __ lea(esp, Operand(esp, 2 * kDoubleSize));
966 break; 966 break;
967 } 967 }
968 case kX87Float64Abs: { 968 case kX87Float64Abs: {
969 __ fstp(0); 969 __ fstp(0);
970 __ fld_d(MemOperand(esp, 0)); 970 __ fld_d(MemOperand(esp, 0));
971 __ fabs(); 971 __ fabs();
972 __ lea(esp, Operand(esp, kDoubleSize)); 972 __ lea(esp, Operand(esp, kDoubleSize));
973 break; 973 break;
974 } 974 }
975 case kX87Int32ToFloat32: {
976 InstructionOperand* input = instr->InputAt(0);
977 DCHECK(input->IsRegister() || input->IsStackSlot());
978 __ fstp(0);
979 if (input->IsRegister()) {
980 Register input_reg = i.InputRegister(0);
981 __ push(input_reg);
982 __ fild_s(Operand(esp, 0));
983 __ pop(input_reg);
984 } else {
985 __ fild_s(i.InputOperand(0));
986 }
987 break;
988 }
975 case kX87Int32ToFloat64: { 989 case kX87Int32ToFloat64: {
976 InstructionOperand* input = instr->InputAt(0); 990 InstructionOperand* input = instr->InputAt(0);
977 DCHECK(input->IsRegister() || input->IsStackSlot()); 991 DCHECK(input->IsRegister() || input->IsStackSlot());
978 __ fstp(0); 992 __ fstp(0);
979 if (input->IsRegister()) { 993 if (input->IsRegister()) {
980 Register input_reg = i.InputRegister(0); 994 Register input_reg = i.InputRegister(0);
981 __ push(input_reg); 995 __ push(input_reg);
982 __ fild_s(Operand(esp, 0)); 996 __ fild_s(Operand(esp, 0));
983 __ pop(input_reg); 997 __ pop(input_reg);
984 } else { 998 } else {
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2021 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2008 __ Nop(padding_size); 2022 __ Nop(padding_size);
2009 } 2023 }
2010 } 2024 }
2011 2025
2012 #undef __ 2026 #undef __
2013 2027
2014 } // namespace compiler 2028 } // namespace compiler
2015 } // namespace internal 2029 } // namespace internal
2016 } // namespace v8 2030 } // 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