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

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

Issue 426863006: MIPS64: Add support for architecture revision 6. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.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 // 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 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 } 2357 }
2358 case Token::ADD: 2358 case Token::ADD:
2359 __ AdduAndCheckForOverflow(v0, left, right, scratch1); 2359 __ AdduAndCheckForOverflow(v0, left, right, scratch1);
2360 __ BranchOnOverflow(&stub_call, scratch1); 2360 __ BranchOnOverflow(&stub_call, scratch1);
2361 break; 2361 break;
2362 case Token::SUB: 2362 case Token::SUB:
2363 __ SubuAndCheckForOverflow(v0, left, right, scratch1); 2363 __ SubuAndCheckForOverflow(v0, left, right, scratch1);
2364 __ BranchOnOverflow(&stub_call, scratch1); 2364 __ BranchOnOverflow(&stub_call, scratch1);
2365 break; 2365 break;
2366 case Token::MUL: { 2366 case Token::MUL: {
2367 __ SmiUntag(scratch1, right); 2367 __ Dmulh(v0, left, right);
2368 __ Dmult(left, scratch1); 2368 __ dsra32(scratch2, v0, 0);
2369 __ mflo(scratch1); 2369 __ sra(scratch1, v0, 31);
2370 __ mfhi(scratch2); 2370 __ Branch(USE_DELAY_SLOT, &stub_call, ne, scratch2, Operand(scratch1));
2371 __ dsra32(scratch1, scratch1, 31); 2371 __ SmiTag(v0);
2372 __ Branch(&stub_call, ne, scratch1, Operand(scratch2)); 2372 __ Branch(USE_DELAY_SLOT, &done, ne, v0, Operand(zero_reg));
2373 __ mflo(v0);
2374 __ Branch(&done, ne, v0, Operand(zero_reg));
2375 __ Daddu(scratch2, right, left); 2373 __ Daddu(scratch2, right, left);
2376 __ Branch(&stub_call, lt, scratch2, Operand(zero_reg)); 2374 __ Branch(&stub_call, lt, scratch2, Operand(zero_reg));
2377 ASSERT(Smi::FromInt(0) == 0); 2375 ASSERT(Smi::FromInt(0) == 0);
2378 __ mov(v0, zero_reg); 2376 __ mov(v0, zero_reg);
2379 break; 2377 break;
2380 } 2378 }
2381 case Token::BIT_OR: 2379 case Token::BIT_OR:
2382 __ Or(v0, left, Operand(right)); 2380 __ Or(v0, left, Operand(right));
2383 break; 2381 break;
2384 case Token::BIT_AND: 2382 case Token::BIT_AND:
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
3936 __ ld(scratch1, FieldMemOperand(separator, HeapObject::kMapOffset)); 3934 __ ld(scratch1, FieldMemOperand(separator, HeapObject::kMapOffset));
3937 __ lbu(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); 3935 __ lbu(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
3938 __ JumpIfInstanceTypeIsNotSequentialAscii(scratch1, scratch2, &bailout); 3936 __ JumpIfInstanceTypeIsNotSequentialAscii(scratch1, scratch2, &bailout);
3939 3937
3940 // Add (separator length times array_length) - separator length to the 3938 // Add (separator length times array_length) - separator length to the
3941 // string_length to get the length of the result string. array_length is not 3939 // string_length to get the length of the result string. array_length is not
3942 // smi but the other values are, so the result is a smi. 3940 // smi but the other values are, so the result is a smi.
3943 __ ld(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset)); 3941 __ ld(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset));
3944 __ Dsubu(string_length, string_length, Operand(scratch1)); 3942 __ Dsubu(string_length, string_length, Operand(scratch1));
3945 __ SmiUntag(scratch1); 3943 __ SmiUntag(scratch1);
3946 __ Dmult(array_length, scratch1); 3944 __ Dmul(scratch2, array_length, scratch1);
3947 // Check for smi overflow. No overflow if higher 33 bits of 64-bit result are 3945 // Check for smi overflow. No overflow if higher 33 bits of 64-bit result are
3948 // zero. 3946 // zero.
3949 __ mfhi(scratch2); 3947 __ dsra32(scratch1, scratch2, 0);
3950 __ Branch(&bailout, ne, scratch2, Operand(zero_reg)); 3948 __ Branch(&bailout, ne, scratch2, Operand(zero_reg));
3951 __ mflo(scratch2);
3952 __ SmiUntag(string_length); 3949 __ SmiUntag(string_length);
3953 __ AdduAndCheckForOverflow(string_length, string_length, scratch2, scratch3); 3950 __ AdduAndCheckForOverflow(string_length, string_length, scratch2, scratch3);
3954 __ BranchOnOverflow(&bailout, scratch3); 3951 __ BranchOnOverflow(&bailout, scratch3);
3955 3952
3956 // Get first element in the array to free up the elements register to be used 3953 // Get first element in the array to free up the elements register to be used
3957 // for the result. 3954 // for the result.
3958 __ Daddu(element, 3955 __ Daddu(element,
3959 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 3956 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
3960 result = elements; // End of live range for elements. 3957 result = elements; // End of live range for elements.
3961 elements = no_reg; 3958 elements = no_reg;
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
4882 Assembler::target_address_at(pc_immediate_load_address)) == 4879 Assembler::target_address_at(pc_immediate_load_address)) ==
4883 reinterpret_cast<uint64_t>( 4880 reinterpret_cast<uint64_t>(
4884 isolate->builtins()->OsrAfterStackCheck()->entry())); 4881 isolate->builtins()->OsrAfterStackCheck()->entry()));
4885 return OSR_AFTER_STACK_CHECK; 4882 return OSR_AFTER_STACK_CHECK;
4886 } 4883 }
4887 4884
4888 4885
4889 } } // namespace v8::internal 4886 } } // namespace v8::internal
4890 4887
4891 #endif // V8_TARGET_ARCH_MIPS64 4888 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698