Commit b3517e2b authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS64: Use the Lsa() and Dlsa() macros/r6 instructions in existing code.

BUG=

Review URL: https://codereview.chromium.org/1605093002

Cr-Commit-Position: refs/heads/master@{#33430}
parent 0e4cae13
......@@ -1410,8 +1410,7 @@ void LCodeGen::DoMulS(LMulS* instr) {
if (constant < 0) __ Dsubu(result, zero_reg, result);
} else if (base::bits::IsPowerOfTwo32(constant_abs - 1)) {
int32_t shift = WhichPowerOf2(constant_abs - 1);
__ dsll(scratch, left, shift);
__ Daddu(result, scratch, left);
__ Dlsa(result, left, left, shift);
// Correct the sign of the result if the constant is negative.
if (constant < 0) __ Dsubu(result, zero_reg, result);
} else if (base::bits::IsPowerOfTwo32(constant_abs + 1)) {
......@@ -1512,8 +1511,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
if (constant < 0) __ Subu(result, zero_reg, result);
} else if (base::bits::IsPowerOfTwo32(constant_abs - 1)) {
int32_t shift = WhichPowerOf2(constant_abs - 1);
__ sll(scratch, left, shift);
__ addu(result, scratch, left);
__ Lsa(result, left, left, shift);
// Correct the sign of the result if the constant is negative.
if (constant < 0) __ Subu(result, zero_reg, result);
} else if (base::bits::IsPowerOfTwo32(constant_abs + 1)) {
......@@ -2703,8 +2701,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi
__ SmiUntag(reg);
__ dsll(at, reg, kPointerSizeLog2);
__ Daddu(sp, sp, at);
__ Dlsa(sp, sp, reg, kPointerSizeLog2);
}
__ Jump(ra);
......@@ -2921,8 +2918,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
Register index = ToRegister(instr->index());
__ li(at, Operand(const_length + 1));
__ Dsubu(result, at, index);
__ dsll(at, result, kPointerSizeLog2);
__ Daddu(at, arguments, at);
__ Dlsa(at, arguments, result, kPointerSizeLog2);
__ ld(result, MemOperand(at));
}
} else if (instr->index()->IsConstantOperand()) {
......@@ -2931,12 +2927,10 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
int loc = const_index - 1;
if (loc != 0) {
__ Dsubu(result, length, Operand(loc));
__ dsll(at, result, kPointerSizeLog2);
__ Daddu(at, arguments, at);
__ Dlsa(at, arguments, result, kPointerSizeLog2);
__ ld(result, MemOperand(at));
} else {
__ dsll(at, length, kPointerSizeLog2);
__ Daddu(at, arguments, at);
__ Dlsa(at, arguments, length, kPointerSizeLog2);
__ ld(result, MemOperand(at));
}
} else {
......@@ -2944,8 +2938,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
Register index = ToRegister(instr->index());
__ Dsubu(result, length, index);
__ Daddu(result, result, 1);
__ dsll(at, result, kPointerSizeLog2);
__ Daddu(at, arguments, at);
__ Dlsa(at, arguments, result, kPointerSizeLog2);
__ ld(result, MemOperand(at));
}
}
......@@ -3107,8 +3100,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
__ SmiScale(scratch, key, kPointerSizeLog2);
__ daddu(scratch, elements, scratch);
} else {
__ dsll(scratch, key, kPointerSizeLog2);
__ daddu(scratch, elements, scratch);
__ Dlsa(scratch, elements, key, kPointerSizeLog2);
}
}
......@@ -4282,8 +4274,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
__ SmiScale(scratch, key, kPointerSizeLog2);
__ daddu(store_base, elements, scratch);
} else {
__ dsll(scratch, key, kPointerSizeLog2);
__ daddu(store_base, elements, scratch);
__ Dlsa(store_base, elements, key, kPointerSizeLog2);
}
}
......@@ -4588,8 +4579,7 @@ void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) {
__ Branch(deferred->entry(), hi,
char_code, Operand(String::kMaxOneByteCharCode));
__ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex);
__ dsll(scratch, char_code, kPointerSizeLog2);
__ Daddu(result, result, scratch);
__ Dlsa(result, result, char_code, kPointerSizeLog2);
__ ld(result, FieldMemOperand(result, FixedArray::kHeaderSize));
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
__ Branch(deferred->entry(), eq, result, Operand(scratch));
......
......@@ -3802,8 +3802,7 @@ void FullCodeGenerator::EmitFastOneByteArrayJoin(CallRuntime* expr) {
__ mov(string_length, zero_reg);
__ Daddu(element,
elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ dsll(elements_end, array_length, kPointerSizeLog2);
__ Daddu(elements_end, element, elements_end);
__ Dlsa(elements_end, element, array_length, kPointerSizeLog2);
// Loop condition: while (element < elements_end).
// Live values in registers:
// elements: Fixed array of strings.
......@@ -3882,8 +3881,7 @@ void FullCodeGenerator::EmitFastOneByteArrayJoin(CallRuntime* expr) {
// Prepare for looping. Set up elements_end to end of the array. Set
// result_pos to the position of the result where to write the first
// character.
__ dsll(elements_end, array_length, kPointerSizeLog2);
__ Daddu(elements_end, element, elements_end);
__ Dlsa(elements_end, element, array_length, kPointerSizeLog2);
result_pos = array_length; // End of live range for array_length.
array_length = no_reg;
__ Daddu(result_pos,
......
......@@ -42,13 +42,11 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm,
scratch = no_reg;
// Multiply by 3 because there are 3 fields per entry (name, code, map).
__ dsll(offset_scratch, offset, 1);
__ Daddu(offset_scratch, offset_scratch, offset);
__ Dlsa(offset_scratch, offset, offset, 1);
// Calculate the base address of the entry.
__ li(base_addr, Operand(key_offset));
__ dsll(at, offset_scratch, kPointerSizeLog2);
__ Daddu(base_addr, base_addr, at);
__ Dlsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2);
// Check that the key in the entry matches the name.
__ ld(at, MemOperand(base_addr, 0));
......
......@@ -4054,10 +4054,8 @@ void NameDictionaryLookupStub::Generate(MacroAssembler* masm) {
// Scale the index by multiplying by the entry size.
STATIC_ASSERT(NameDictionary::kEntrySize == 3);
// index *= 3.
__ mov(at, index);
__ Lsa(index, index, index, 1);
STATIC_ASSERT(kSmiTagSize == 1);
__ Lsa(index, dictionary, index, 2);
__ lw(entry_key, FieldMemOperand(index, kElementsStartOffset));
......
......@@ -156,8 +156,7 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
{
__ Branch(USE_DELAY_SLOT, &no_arguments, eq, a0, Operand(zero_reg));
__ Dsubu(a0, a0, Operand(1));
__ dsll(a0, a0, kPointerSizeLog2);
__ Daddu(sp, a0, sp);
__ Dlsa(sp, sp, a0, kPointerSizeLog2);
__ ld(a0, MemOperand(sp));
__ Drop(2);
}
......@@ -192,8 +191,7 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
Label no_arguments, done;
__ Branch(USE_DELAY_SLOT, &no_arguments, eq, a0, Operand(zero_reg));
__ Dsubu(a0, a0, Operand(1));
__ dsll(a0, a0, kPointerSizeLog2);
__ Daddu(sp, a0, sp);
__ Dlsa(sp, sp, a0, kPointerSizeLog2);
__ ld(a0, MemOperand(sp));
__ Drop(2);
__ jmp(&done);
......@@ -257,8 +255,7 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
{
__ Branch(USE_DELAY_SLOT, &no_arguments, eq, a0, Operand(zero_reg));
__ Dsubu(a0, a0, Operand(1));
__ dsll(a0, a0, kPointerSizeLog2);
__ Daddu(sp, a0, sp);
__ Dlsa(sp, sp, a0, kPointerSizeLog2);
__ ld(a0, MemOperand(sp));
__ Drop(2);
}
......@@ -319,8 +316,7 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
Label no_arguments, done;
__ Branch(USE_DELAY_SLOT, &no_arguments, eq, a0, Operand(zero_reg));
__ Dsubu(a0, a0, Operand(1));
__ dsll(a0, a0, kPointerSizeLog2);
__ Daddu(sp, a0, sp);
__ Dlsa(sp, sp, a0, kPointerSizeLog2);
__ ld(a0, MemOperand(sp));
__ Drop(2);
__ jmp(&done);
......@@ -611,8 +607,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ mov(t0, a0);
__ jmp(&entry);
__ bind(&loop);
__ dsll(a4, t0, kPointerSizeLog2);
__ Daddu(a4, a2, Operand(a4));
__ Dlsa(a4, a2, t0, kPointerSizeLog2);
__ ld(a5, MemOperand(a4));
__ push(a5);
__ bind(&entry);
......@@ -798,8 +793,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// a3: argc
// s0: argv, i.e. points to first arg
Label loop, entry;
__ dsll(a4, a3, kPointerSizeLog2);
__ daddu(a6, s0, a4);
__ Dlsa(a6, s0, a3, kPointerSizeLog2);
__ b(&entry);
__ nop(); // Branch delay slot nop.
// a6 points past last arg.
......@@ -955,8 +949,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Daddu(a0, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister);
__ lbu(a0, MemOperand(a0));
__ dsll(at, a0, kPointerSizeLog2);
__ Daddu(at, kInterpreterDispatchTableRegister, at);
__ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
__ ld(at, MemOperand(at));
// TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
// and header removal.
......@@ -1091,8 +1084,7 @@ static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
__ Daddu(a1, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister);
__ lbu(a1, MemOperand(a1));
__ dsll(a1, a1, kPointerSizeLog2);
__ Daddu(a1, kInterpreterDispatchTableRegister, a1);
__ Dlsa(a1, kInterpreterDispatchTableRegister, a1, kPointerSizeLog2);
__ ld(a1, MemOperand(a1));
__ Daddu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
__ Jump(a1);
......@@ -1408,8 +1400,7 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// Do the compatible receiver check
Label receiver_check_failed;
__ sll(at, a0, kPointerSizeLog2);
__ Daddu(t8, sp, at);
__ Dlsa(t8, sp, a0, kPointerSizeLog2);
__ ld(t0, MemOperand(t8));
CompatibleReceiverCheck(masm, t0, t1, &receiver_check_failed);
......@@ -1543,6 +1534,7 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
Register scratch = a4;
__ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
__ mov(a3, a2);
// Dlsa() cannot be used hare as scratch value used later.
__ dsll(scratch, a0, kPointerSizeLog2);
__ Daddu(a0, sp, Operand(scratch));
__ ld(a1, MemOperand(a0)); // receiver
......@@ -1613,8 +1605,7 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// 2. Get the function to call (passed as receiver) from the stack.
// a0: actual number of arguments
__ dsll(at, a0, kPointerSizeLog2);
__ daddu(at, sp, at);
__ Dlsa(at, sp, a0, kPointerSizeLog2);
__ ld(a1, MemOperand(at));
// 3. Shift arguments and return address one slot down on the stack
......@@ -1625,8 +1616,7 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
{
Label loop;
// Calculate the copy start address (destination). Copy end address is sp.
__ dsll(at, a0, kPointerSizeLog2);
__ daddu(a2, sp, at);
__ Dlsa(a2, sp, a0, kPointerSizeLog2);
__ bind(&loop);
__ ld(at, MemOperand(a2, -kPointerSize));
......@@ -1726,6 +1716,7 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
Register scratch = a4;
__ LoadRoot(a1, Heap::kUndefinedValueRootIndex);
__ mov(a2, a1);
// Dlsa() cannot be used hare as scratch value used later.
__ dsll(scratch, a0, kPointerSizeLog2);
__ Daddu(a0, sp, Operand(scratch));
__ sd(a2, MemOperand(a0)); // receiver
......@@ -1937,8 +1928,7 @@ void Builtins::Generate_Apply(MacroAssembler* masm) {
Label done, loop;
__ bind(&loop);
__ Branch(&done, eq, a4, Operand(a2));
__ dsll(at, a4, kPointerSizeLog2);
__ Daddu(at, a0, at);
__ Dlsa(at, a0, a4, kPointerSizeLog2);
__ ld(at, FieldMemOperand(at, FixedArray::kHeaderSize));
__ Push(at);
__ Daddu(a4, a4, Operand(1));
......@@ -2001,8 +1991,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
__ LoadGlobalProxy(a3);
} else {
Label convert_to_object, convert_receiver;
__ dsll(at, a0, kPointerSizeLog2);
__ daddu(at, sp, at);
__ Dlsa(at, sp, a0, kPointerSizeLog2);
__ ld(a3, MemOperand(at));
__ JumpIfSmi(a3, &convert_to_object);
STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
......@@ -2038,8 +2027,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
__ ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
__ bind(&convert_receiver);
}
__ dsll(at, a0, kPointerSizeLog2);
__ daddu(at, sp, at);
__ Dlsa(at, sp, a0, kPointerSizeLog2);
__ sd(a3, MemOperand(at));
}
__ bind(&done_convert);
......@@ -2079,8 +2067,7 @@ void Builtins::Generate_CallBoundFunction(MacroAssembler* masm) {
// Patch the receiver to [[BoundThis]].
{
__ ld(at, FieldMemOperand(a1, JSBoundFunction::kBoundThisOffset));
__ dsll(a4, a0, kPointerSizeLog2);
__ daddu(a4, a4, sp);
__ Dlsa(a4, sp, a0, kPointerSizeLog2);
__ sd(at, MemOperand(a4));
}
......@@ -2121,11 +2108,9 @@ void Builtins::Generate_CallBoundFunction(MacroAssembler* masm) {
__ mov(a5, zero_reg);
__ bind(&loop);
__ Branch(&done_loop, gt, a5, Operand(a0));
__ dsll(a6, a4, kPointerSizeLog2);
__ daddu(a6, a6, sp);
__ Dlsa(a6, sp, a4, kPointerSizeLog2);
__ ld(at, MemOperand(a6));
__ dsll(a6, a5, kPointerSizeLog2);
__ daddu(a6, a6, sp);
__ Dlsa(a6, sp, a5, kPointerSizeLog2);
__ sd(at, MemOperand(a6));
__ Daddu(a4, a4, Operand(1));
__ Daddu(a5, a5, Operand(1));
......@@ -2142,11 +2127,9 @@ void Builtins::Generate_CallBoundFunction(MacroAssembler* masm) {
__ bind(&loop);
__ Dsubu(a4, a4, Operand(1));
__ Branch(&done_loop, lt, a4, Operand(zero_reg));
__ dsll(a5, a4, kPointerSizeLog2);
__ daddu(a5, a5, a2);
__ Dlsa(a5, a2, a4, kPointerSizeLog2);
__ ld(at, MemOperand(a5));
__ dsll(a5, a0, kPointerSizeLog2);
__ daddu(a5, a5, sp);
__ Dlsa(a5, sp, a0, kPointerSizeLog2);
__ sd(at, MemOperand(a5));
__ Daddu(a0, a0, Operand(1));
__ Branch(&loop);
......@@ -2197,8 +2180,7 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) {
__ And(t1, t1, Operand(1 << Map::kIsCallable));
__ Branch(&non_callable, eq, t1, Operand(zero_reg));
// Overwrite the original receiver with the (original) target.
__ dsll(at, a0, kPointerSizeLog2);
__ daddu(at, sp, at);
__ Dlsa(at, sp, a0, kPointerSizeLog2);
__ sd(a1, MemOperand(at));
// Let the "call_as_function_delegate" take care of the rest.
__ LoadNativeContextSlot(Context::CALL_AS_FUNCTION_DELEGATE_INDEX, a1);
......@@ -2284,11 +2266,9 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ mov(a5, zero_reg);
__ bind(&loop);
__ Branch(&done_loop, ge, a5, Operand(a0));
__ dsll(a6, a4, kPointerSizeLog2);
__ daddu(a6, a6, sp);
__ Dlsa(a6, sp, a4, kPointerSizeLog2);
__ ld(at, MemOperand(a6));
__ dsll(a6, a5, kPointerSizeLog2);
__ daddu(a6, a6, sp);
__ Dlsa(a6, sp, a5, kPointerSizeLog2);
__ sd(at, MemOperand(a6));
__ Daddu(a4, a4, Operand(1));
__ Daddu(a5, a5, Operand(1));
......@@ -2305,11 +2285,9 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ bind(&loop);
__ Dsubu(a4, a4, Operand(1));
__ Branch(&done_loop, lt, a4, Operand(zero_reg));
__ dsll(a5, a4, kPointerSizeLog2);
__ daddu(a5, a5, a2);
__ Dlsa(a5, a2, a4, kPointerSizeLog2);
__ ld(at, MemOperand(a5));
__ dsll(a5, a0, kPointerSizeLog2);
__ daddu(a5, a5, sp);
__ Dlsa(a5, sp, a0, kPointerSizeLog2);
__ sd(at, MemOperand(a5));
__ Daddu(a0, a0, Operand(1));
__ Branch(&loop);
......@@ -2388,8 +2366,7 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
// Called Construct on an exotic Object with a [[Construct]] internal method.
{
// Overwrite the original receiver with the (original) target.
__ dsll(at, a0, kPointerSizeLog2);
__ daddu(at, sp, at);
__ Dlsa(at, sp, a0, kPointerSizeLog2);
__ sd(a1, MemOperand(at));
// Let the "call_as_constructor_delegate" take care of the rest.
__ LoadNativeContextSlot(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, a1);
......
......@@ -1073,8 +1073,7 @@ void CEntryStub::Generate(MacroAssembler* masm) {
__ mov(s1, a2);
} else {
// Compute the argv pointer in a callee-saved register.
__ dsll(s1, a0, kPointerSizeLog2);
__ Daddu(s1, sp, s1);
__ Dlsa(s1, sp, a0, kPointerSizeLog2);
__ Dsubu(s1, s1, kPointerSize);
}
......@@ -3192,8 +3191,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
// Locate first character of substring to copy.
STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
__ dsll(a4, a3, 1);
__ Daddu(a5, a5, a4);
__ Dlsa(a5, a5, a3, 1);
// Locate first character of result.
__ Daddu(a1, v0, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
......@@ -3928,16 +3926,14 @@ void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm,
// Scale the index by multiplying by the entry size.
STATIC_ASSERT(NameDictionary::kEntrySize == 3);
__ dsll(at, index, 1);
__ Daddu(index, index, at); // index *= 3.
__ Dlsa(index, index, index, 1); // index *= 3.
Register entity_name = scratch0;
// Having undefined at this place means the name is not contained.
STATIC_ASSERT(kSmiTagSize == 1);
Register tmp = properties;
__ dsll(scratch0, index, kPointerSizeLog2);
__ Daddu(tmp, properties, scratch0);
__ Dlsa(tmp, properties, index, kPointerSizeLog2);
__ ld(entity_name, FieldMemOperand(tmp, kElementsStartOffset));
DCHECK(!tmp.is(entity_name));
......@@ -4026,13 +4022,10 @@ void NameDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm,
// Scale the index by multiplying by the entry size.
STATIC_ASSERT(NameDictionary::kEntrySize == 3);
// scratch2 = scratch2 * 3.
__ dsll(at, scratch2, 1);
__ Daddu(scratch2, scratch2, at);
__ Dlsa(scratch2, scratch2, scratch2, 1);
// Check if the key is identical to the name.
__ dsll(at, scratch2, kPointerSizeLog2);
__ Daddu(scratch2, elements, at);
__ Dlsa(scratch2, elements, scratch2, kPointerSizeLog2);
__ ld(at, FieldMemOperand(scratch2, kElementsStartOffset));
__ Branch(done, eq, name, Operand(at));
}
......@@ -4113,14 +4106,10 @@ void NameDictionaryLookupStub::Generate(MacroAssembler* masm) {
// Scale the index by multiplying by the entry size.
STATIC_ASSERT(NameDictionary::kEntrySize == 3);
// index *= 3.
__ mov(at, index);
__ dsll(index, index, 1);
__ Daddu(index, index, at);
__ Dlsa(index, index, index, 1);
STATIC_ASSERT(kSmiTagSize == 1);
__ dsll(index, index, kPointerSizeLog2);
__ Daddu(index, index, dictionary);
__ Dlsa(index, dictionary, index, kPointerSizeLog2);
__ ld(entry_key, FieldMemOperand(index, kElementsStartOffset));
// Having undefined at this place means the name is not contained.
......@@ -5105,8 +5094,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
switch (argument_count()) {
case ANY:
case MORE_THAN_ONE:
__ dsll(at, a0, kPointerSizeLog2);
__ Daddu(at, sp, at);
__ Dlsa(at, sp, a0, kPointerSizeLog2);
__ sd(a1, MemOperand(at));
__ li(at, Operand(3));
__ Daddu(a0, a0, at);
......@@ -5212,8 +5200,7 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
}
// Load the PropertyCell value at the specified slot.
__ dsll(at, slot_reg, kPointerSizeLog2);
__ Daddu(at, at, Operand(context_reg));
__ Dlsa(at, context_reg, slot_reg, kPointerSizeLog2);
__ ld(result_reg, ContextMemOperand(at, 0));
__ ld(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset));
......@@ -5251,8 +5238,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
}
// Load the PropertyCell at the specified slot.
__ dsll(at, slot_reg, kPointerSizeLog2);
__ Daddu(at, at, Operand(context_reg));
__ Dlsa(at, context_reg, slot_reg, kPointerSizeLog2);
__ ld(cell_reg, ContextMemOperand(at, 0));
// Load PropertyDetails for the cell (actually only the cell_type and kind).
......
......@@ -1078,8 +1078,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
__ And(at, result, Operand(kStringEncodingMask));
__ Branch(&one_byte, ne, at, Operand(zero_reg));
// Two-byte string.
__ dsll(at, index, 1);
__ Daddu(at, string, at);
__ Dlsa(at, string, index, 1);
__ lhu(result, MemOperand(at));
__ jmp(&done);
__ bind(&one_byte);
......@@ -1151,8 +1150,7 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm,
// Must not call ExpConstant() after overwriting temp3!
__ li(temp3, Operand(ExternalReference::math_exp_log_table()));
__ dsll(at, temp2, 3);
__ Daddu(temp3, temp3, Operand(at));
__ Dlsa(temp3, temp3, temp2, 3);
__ lwu(temp2, MemOperand(temp3, Register::kMantissaOffset));
__ lwu(temp3, MemOperand(temp3, Register::kExponentOffset));
// The first word is loaded is the lower number register.
......
......@@ -273,8 +273,7 @@ void Deoptimizer::TableEntryGenerator::Generate() {
// a1 = one past the last FrameDescription**.
__ lw(a1, MemOperand(a0, Deoptimizer::output_count_offset()));
__ ld(a4, MemOperand(a0, Deoptimizer::output_offset())); // a4 is output_.
__ dsll(a1, a1, kPointerSizeLog2); // Count to offset.
__ daddu(a1, a4, a1); // a1 = one past the last FrameDescription**.
__ Dlsa(a1, a4, a1, kPointerSizeLog2);
__ BranchShort(&outer_loop_header);
__ bind(&outer_push_loop);
// Inner loop state: a2 = current FrameDescription*, a3 = loop index.
......
......@@ -503,16 +503,14 @@ void MacroAssembler::GetNumberHash(Register reg0, Register scratch) {
// hash = ~hash + (hash << 15);
// The algorithm uses 32-bit integer values.
nor(scratch, reg0, zero_reg);
sll(at, reg0, 15);
addu(reg0, scratch, at);
Lsa(reg0, scratch, reg0, 15);
// hash = hash ^ (hash >> 12);
srl(at, reg0, 12);
xor_(reg0, reg0, at);
// hash = hash + (hash << 2);
sll(at, reg0, 2);
addu(reg0, reg0, at);
Lsa(reg0, reg0, reg0, 2);
// hash = hash ^ (hash >> 4);
srl(at, reg0, 4);
......@@ -520,8 +518,7 @@ void MacroAssembler::GetNumberHash(Register reg0, Register scratch) {
// hash = hash * 2057;
sll(scratch, reg0, 11);
sll(at, reg0, 3);
addu(reg0, reg0, at);
Lsa(reg0, reg0, reg0, 3);
addu(reg0, reg0, scratch);
// hash = hash ^ (hash >> 16);
......@@ -581,12 +578,10 @@ void MacroAssembler::LoadFromNumberDictionary(Label* miss,
// Scale the index by multiplying by the element size.
DCHECK(SeededNumberDictionary::kEntrySize == 3);
dsll(at, reg2, 1); // 2x.
daddu(reg2, reg2, at); // reg2 = reg2 * 3.
Dlsa(reg2, reg2, reg2, 1); // reg2 = reg2 * 3.
// Check if the key is identical to the name.
dsll(at, reg2, kPointerSizeLog2);
daddu(reg2, elements, at);
Dlsa(reg2, elements, reg2, kPointerSizeLog2);
ld(at, FieldMemOperand(reg2, SeededNumberDictionary::kElementsStartOffset));
if (i != kNumberDictionaryProbes - 1) {
......@@ -3839,8 +3834,7 @@ void MacroAssembler::Allocate(Register object_size, Register result,
// to calculate the new top. Object size may be in words so a shift is
// required to get the number of bytes.
if ((flags & SIZE_IN_WORDS) != 0) {
dsll(result_end, object_size, kPointerSizeLog2);
Daddu(result_end, result, result_end);
Dlsa(result_end, result, object_size, kPointerSizeLog2);
} else {
Daddu(result_end, result, Operand(object_size));
}
......@@ -5584,8 +5578,7 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
if (argument_count_is_length) {
daddu(sp, sp, argument_count);
} else {
dsll(t8, argument_count, kPointerSizeLog2);
daddu(sp, sp, t8);
Dlsa(sp, sp, argument_count, kPointerSizeLog2, t8);
}
}
......@@ -6173,8 +6166,7 @@ void MacroAssembler::GetMarkBits(Register addr_reg,
Ext(mask_reg, addr_reg, kPointerSizeLog2, Bitmap::kBitsPerCellLog2);
const int kLowBits = kPointerSizeLog2 + Bitmap::kBitsPerCellLog2;
Ext(t8, addr_reg, kLowBits, kPageSizeBits - kLowBits);
dsll(t8, t8, Bitmap::kBytesPerCellLog2);
Daddu(bitmap_reg, bitmap_reg, t8);
Dlsa(bitmap_reg, bitmap_reg, t8, Bitmap::kBytesPerCellLog2);
li(t8, Operand(1));
dsllv(mask_reg, t8, mask_reg);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment