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

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

Issue 88623004: MIPS: Optimize Integer32ToSmi. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years 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/mips/lithium-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4615 matching lines...) Expand 10 before | Expand all | Expand 10 after
4626 } 4626 }
4627 __ cvt_d_w(ToDoubleRegister(output), single_scratch); 4627 __ cvt_d_w(ToDoubleRegister(output), single_scratch);
4628 } 4628 }
4629 4629
4630 4630
4631 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { 4631 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) {
4632 LOperand* input = instr->value(); 4632 LOperand* input = instr->value();
4633 LOperand* output = instr->result(); 4633 LOperand* output = instr->result();
4634 Register scratch = scratch0(); 4634 Register scratch = scratch0();
4635 4635
4636 __ SmiTagCheckOverflow(ToRegister(output), ToRegister(input), scratch); 4636 ASSERT(output->IsRegister());
4637 if (!instr->hydrogen()->value()->HasRange() || 4637 if (!instr->hydrogen()->value()->HasRange() ||
4638 !instr->hydrogen()->value()->range()->IsInSmiRange()) { 4638 !instr->hydrogen()->value()->range()->IsInSmiRange()) {
4639 __ SmiTagCheckOverflow(ToRegister(output), ToRegister(input), scratch);
4639 DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg)); 4640 DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
4641 } else {
4642 __ SmiTag(ToRegister(output), ToRegister(input));
4640 } 4643 }
4641 } 4644 }
4642 4645
4643 4646
4644 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { 4647 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) {
4645 LOperand* input = instr->value(); 4648 LOperand* input = instr->value();
4646 LOperand* output = instr->result(); 4649 LOperand* output = instr->result();
4647 4650
4648 FPURegister dbl_scratch = double_scratch0(); 4651 FPURegister dbl_scratch = double_scratch0();
4649 __ mtc1(ToRegister(input), dbl_scratch); 4652 __ mtc1(ToRegister(input), dbl_scratch);
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
5867 __ Subu(scratch, result, scratch); 5870 __ Subu(scratch, result, scratch);
5868 __ lw(result, FieldMemOperand(scratch, 5871 __ lw(result, FieldMemOperand(scratch,
5869 FixedArray::kHeaderSize - kPointerSize)); 5872 FixedArray::kHeaderSize - kPointerSize));
5870 __ bind(&done); 5873 __ bind(&done);
5871 } 5874 }
5872 5875
5873 5876
5874 #undef __ 5877 #undef __
5875 5878
5876 } } // namespace v8::internal 5879 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698