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

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 9192011: MIPS: Use shift and add instead of mul on ARM for integer hash. (Closed)
Patch Set: Created 8 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 437
438 // hash = hash + (hash << 2); 438 // hash = hash + (hash << 2);
439 sll(at, reg0, 2); 439 sll(at, reg0, 2);
440 addu(reg0, reg0, at); 440 addu(reg0, reg0, at);
441 441
442 // hash = hash ^ (hash >> 4); 442 // hash = hash ^ (hash >> 4);
443 srl(at, reg0, 4); 443 srl(at, reg0, 4);
444 xor_(reg0, reg0, at); 444 xor_(reg0, reg0, at);
445 445
446 // hash = hash * 2057; 446 // hash = hash * 2057;
447 li(scratch, Operand(2057)); 447 sll(scratch, reg0, 11);
448 mul(reg0, reg0, scratch); 448 sll(at, reg0, 3);
449 addu(reg0, reg0, at);
450 addu(reg0, reg0, scratch);
449 451
450 // hash = hash ^ (hash >> 16); 452 // hash = hash ^ (hash >> 16);
451 srl(at, reg0, 16); 453 srl(at, reg0, 16);
452 xor_(reg0, reg0, at); 454 xor_(reg0, reg0, at);
453 } 455 }
454 456
455 457
456 void MacroAssembler::LoadFromNumberDictionary(Label* miss, 458 void MacroAssembler::LoadFromNumberDictionary(Label* miss,
457 Register elements, 459 Register elements,
458 Register key, 460 Register key,
(...skipping 4586 matching lines...) Expand 10 before | Expand all | Expand 10 after
5045 opcode == BGTZL); 5047 opcode == BGTZL);
5046 opcode = (cond == eq) ? BEQ : BNE; 5048 opcode = (cond == eq) ? BEQ : BNE;
5047 instr = (instr & ~kOpcodeMask) | opcode; 5049 instr = (instr & ~kOpcodeMask) | opcode;
5048 masm_.emit(instr); 5050 masm_.emit(instr);
5049 } 5051 }
5050 5052
5051 5053
5052 } } // namespace v8::internal 5054 } } // namespace v8::internal
5053 5055
5054 #endif // V8_TARGET_ARCH_MIPS 5056 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698