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

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

Issue 9296046: MIPS: Some assembler-level optimizations on ARM. (Closed)
Patch Set: rebased on r10562 Created 8 years, 10 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 | « src/mips/macro-assembler-mips.h ('k') | 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 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 4523 matching lines...) Expand 10 before | Expand all | Expand 10 after
4534 } else { 4534 } else {
4535 ASSERT(!dst.is(src)); 4535 ASSERT(!dst.is(src));
4536 ASSERT(!dst.is(overflow)); 4536 ASSERT(!dst.is(overflow));
4537 ASSERT(!src.is(overflow)); 4537 ASSERT(!src.is(overflow));
4538 SmiTag(dst, src); 4538 SmiTag(dst, src);
4539 xor_(overflow, dst, src); // Overflow if (value ^ 2 * value) < 0. 4539 xor_(overflow, dst, src); // Overflow if (value ^ 2 * value) < 0.
4540 } 4540 }
4541 } 4541 }
4542 4542
4543 4543
4544 void MacroAssembler::UntagAndJumpIfSmi(Register dst,
4545 Register src,
4546 Label* smi_case) {
4547 JumpIfSmi(src, smi_case, at, USE_DELAY_SLOT);
4548 SmiUntag(dst, src);
4549 }
4550
4551
4552 void MacroAssembler::UntagAndJumpIfNotSmi(Register dst,
4553 Register src,
4554 Label* non_smi_case) {
4555 JumpIfNotSmi(src, non_smi_case, at, USE_DELAY_SLOT);
4556 SmiUntag(dst, src);
4557 }
4558
4559 void MacroAssembler::JumpIfSmi(Register value,
4560 Label* smi_label,
4561 Register scratch,
4562 BranchDelaySlot bd) {
4563 ASSERT_EQ(0, kSmiTag);
4564 andi(scratch, value, kSmiTagMask);
4565 Branch(bd, smi_label, eq, scratch, Operand(zero_reg));
4566 }
4567
4568 void MacroAssembler::JumpIfNotSmi(Register value,
4569 Label* not_smi_label,
4570 Register scratch,
4571 BranchDelaySlot bd) {
4572 ASSERT_EQ(0, kSmiTag);
4573 andi(scratch, value, kSmiTagMask);
4574 Branch(bd, not_smi_label, ne, scratch, Operand(zero_reg));
4575 }
4576
4577
4544 void MacroAssembler::JumpIfNotBothSmi(Register reg1, 4578 void MacroAssembler::JumpIfNotBothSmi(Register reg1,
4545 Register reg2, 4579 Register reg2,
4546 Label* on_not_both_smi) { 4580 Label* on_not_both_smi) {
4547 STATIC_ASSERT(kSmiTag == 0); 4581 STATIC_ASSERT(kSmiTag == 0);
4548 ASSERT_EQ(1, kSmiTagMask); 4582 ASSERT_EQ(1, kSmiTagMask);
4549 or_(at, reg1, reg2); 4583 or_(at, reg1, reg2);
4550 JumpIfNotSmi(at, on_not_both_smi); 4584 JumpIfNotSmi(at, on_not_both_smi);
4551 } 4585 }
4552 4586
4553 4587
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
5172 opcode == BGTZL); 5206 opcode == BGTZL);
5173 opcode = (cond == eq) ? BEQ : BNE; 5207 opcode = (cond == eq) ? BEQ : BNE;
5174 instr = (instr & ~kOpcodeMask) | opcode; 5208 instr = (instr & ~kOpcodeMask) | opcode;
5175 masm_.emit(instr); 5209 masm_.emit(instr);
5176 } 5210 }
5177 5211
5178 5212
5179 } } // namespace v8::internal 5213 } } // namespace v8::internal
5180 5214
5181 #endif // V8_TARGET_ARCH_MIPS 5215 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698