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

Side by Side Diff: src/mips64/lithium-codegen-mips64.cc

Issue 952233002: MIPS64: Improve and fix nan hole checks and canonicalization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/cpu-profiler.h" 9 #include "src/cpu-profiler.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 __ li(at, Operand(factory()->the_hole_value())); 2356 __ li(at, Operand(factory()->the_hole_value()));
2357 EmitBranch(instr, eq, input_reg, Operand(at)); 2357 EmitBranch(instr, eq, input_reg, Operand(at));
2358 return; 2358 return;
2359 } 2359 }
2360 2360
2361 DoubleRegister input_reg = ToDoubleRegister(instr->object()); 2361 DoubleRegister input_reg = ToDoubleRegister(instr->object());
2362 EmitFalseBranchF(instr, eq, input_reg, input_reg); 2362 EmitFalseBranchF(instr, eq, input_reg, input_reg);
2363 2363
2364 Register scratch = scratch0(); 2364 Register scratch = scratch0();
2365 __ FmoveHigh(scratch, input_reg); 2365 __ FmoveHigh(scratch, input_reg);
2366 __ dsll32(scratch, scratch, 0); // FmoveHigh (mfhc1) sign-extends. 2366 EmitBranch(instr, eq, scratch,
2367 __ dsrl32(scratch, scratch, 0); // Use only low 32-bits. 2367 Operand(static_cast<int32_t>(kHoleNanUpper32)));
paul.l... 2015/02/25 16:21:38 this looks like nice solution to remove some instr
2368 EmitBranch(instr, eq, scratch, Operand(kHoleNanUpper32));
2369 } 2368 }
2370 2369
2371 2370
2372 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { 2371 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
2373 Representation rep = instr->hydrogen()->value()->representation(); 2372 Representation rep = instr->hydrogen()->value()->representation();
2374 DCHECK(!rep.IsInteger32()); 2373 DCHECK(!rep.IsInteger32());
2375 Register scratch = ToRegister(instr->temp()); 2374 Register scratch = ToRegister(instr->temp());
2376 2375
2377 if (rep.IsDouble()) { 2376 if (rep.IsDouble()) {
2378 DoubleRegister value = ToDoubleRegister(instr->value()); 2377 DoubleRegister value = ToDoubleRegister(instr->value());
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
3273 __ dsra32(at, key, 0); 3272 __ dsra32(at, key, 0);
3274 } else { 3273 } else {
3275 __ dsra(at, key, -shift_size); 3274 __ dsra(at, key, -shift_size);
3276 } 3275 }
3277 __ Daddu(scratch, scratch, at); 3276 __ Daddu(scratch, scratch, at);
3278 } 3277 }
3279 3278
3280 __ ldc1(result, MemOperand(scratch)); 3279 __ ldc1(result, MemOperand(scratch));
3281 3280
3282 if (instr->hydrogen()->RequiresHoleCheck()) { 3281 if (instr->hydrogen()->RequiresHoleCheck()) {
3283 __ lwu(scratch, MemOperand(scratch, sizeof(kHoleNanLower32))); 3282 __ FmoveHigh(scratch, result);
3284 DeoptimizeIf(eq, instr, Deoptimizer::kHole, scratch, 3283 DeoptimizeIf(eq, instr, Deoptimizer::kHole, scratch,
3285 Operand(kHoleNanUpper32)); 3284 Operand(static_cast<int32_t>(kHoleNanUpper32)));
3286 } 3285 }
3287 } 3286 }
3288 3287
3289 3288
3290 void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { 3289 void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
3291 HLoadKeyed* hinstr = instr->hydrogen(); 3290 HLoadKeyed* hinstr = instr->hydrogen();
3292 Register elements = ToRegister(instr->elements()); 3291 Register elements = ToRegister(instr->elements());
3293 Register result = ToRegister(instr->result()); 3292 Register result = ToRegister(instr->result());
3294 Register scratch = scratch0(); 3293 Register scratch = scratch0();
3295 Register store_base = scratch; 3294 Register store_base = scratch;
(...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after
6053 __ li(at, scope_info); 6052 __ li(at, scope_info);
6054 __ Push(at, ToRegister(instr->function())); 6053 __ Push(at, ToRegister(instr->function()));
6055 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6054 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6056 RecordSafepoint(Safepoint::kNoLazyDeopt); 6055 RecordSafepoint(Safepoint::kNoLazyDeopt);
6057 } 6056 }
6058 6057
6059 6058
6060 #undef __ 6059 #undef __
6061 6060
6062 } } // namespace v8::internal 6061 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698