Commit 43f1eae6 authored by Junliang Yan's avatar Junliang Yan Committed by V8 LUCI CQ

ppc: cleanup cmpli/cmpl as CmpU64

Change-Id: I6833e9815d2655064967f249c607c5d2b8fe2c01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3010681Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75607}
parent 9663bb31
...@@ -383,7 +383,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { ...@@ -383,7 +383,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
// (i.e. debug break and preemption) here, so check the "real stack limit". // (i.e. debug break and preemption) here, so check the "real stack limit".
Label stack_overflow; Label stack_overflow;
__ LoadStackLimit(scratch, StackLimitKind::kRealStackLimit); __ LoadStackLimit(scratch, StackLimitKind::kRealStackLimit);
__ cmpl(sp, scratch); __ CmpU64(sp, scratch);
__ blt(&stack_overflow); __ blt(&stack_overflow);
// ----------- S t a t e ------------- // ----------- S t a t e -------------
...@@ -1155,7 +1155,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1155,7 +1155,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Do a stack check to ensure we don't go over the limit. // Do a stack check to ensure we don't go over the limit.
__ sub(r8, sp, r5); __ sub(r8, sp, r5);
__ LoadStackLimit(r0, StackLimitKind::kRealStackLimit); __ LoadStackLimit(r0, StackLimitKind::kRealStackLimit);
__ cmpl(r8, r0); __ CmpU64(r8, r0);
__ blt(&stack_overflow); __ blt(&stack_overflow);
// If ok, push undefined as the initial value for all register file entries. // If ok, push undefined as the initial value for all register file entries.
...@@ -1189,7 +1189,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1189,7 +1189,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// TODO(solanes): Merge with the real stack limit check above. // TODO(solanes): Merge with the real stack limit check above.
Label stack_check_interrupt, after_stack_check_interrupt; Label stack_check_interrupt, after_stack_check_interrupt;
__ LoadStackLimit(r0, StackLimitKind::kInterruptStackLimit); __ LoadStackLimit(r0, StackLimitKind::kInterruptStackLimit);
__ cmpl(sp, r0); __ CmpU64(sp, r0);
__ blt(&stack_check_interrupt); __ blt(&stack_check_interrupt);
__ bind(&after_stack_check_interrupt); __ bind(&after_stack_check_interrupt);
...@@ -2183,7 +2183,7 @@ void Generate_PushBoundArguments(MacroAssembler* masm) { ...@@ -2183,7 +2183,7 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
// limit". // limit".
{ {
__ LoadStackLimit(scratch, StackLimitKind::kRealStackLimit); __ LoadStackLimit(scratch, StackLimitKind::kRealStackLimit);
__ cmpl(r0, scratch); __ CmpU64(r0, scratch);
} }
__ bgt(&done); // Signed comparison. __ bgt(&done); // Signed comparison.
{ {
......
...@@ -1407,7 +1407,7 @@ void TurboAssembler::PrepareForTailCall(Register callee_args_count, ...@@ -1407,7 +1407,7 @@ void TurboAssembler::PrepareForTailCall(Register callee_args_count,
addi(src_reg, src_reg, Operand(kSystemPointerSize)); addi(src_reg, src_reg, Operand(kSystemPointerSize));
if (FLAG_debug_code) { if (FLAG_debug_code) {
cmpl(src_reg, dst_reg); CmpU64(src_reg, dst_reg);
Check(lt, AbortReason::kStackAccessBelowStackPointer); Check(lt, AbortReason::kStackAccessBelowStackPointer);
} }
...@@ -1821,7 +1821,7 @@ void MacroAssembler::JumpIfIsInRange(Register value, unsigned lower_limit, ...@@ -1821,7 +1821,7 @@ void MacroAssembler::JumpIfIsInRange(Register value, unsigned lower_limit,
cmpli(scratch, Operand(higher_limit - lower_limit)); cmpli(scratch, Operand(higher_limit - lower_limit));
} else { } else {
mov(scratch, Operand(higher_limit)); mov(scratch, Operand(higher_limit));
cmpl(value, scratch); CmpU64(value, scratch);
} }
ble(on_in_range); ble(on_in_range);
} }
...@@ -2625,17 +2625,21 @@ void TurboAssembler::CmpS64(Register src1, const Operand& src2, ...@@ -2625,17 +2625,21 @@ void TurboAssembler::CmpS64(Register src1, const Operand& src2,
} }
} }
void TurboAssembler::Cmpli(Register src1, const Operand& src2, Register scratch, void TurboAssembler::CmpU64(Register src1, const Operand& src2,
CRegister cr) { Register scratch, CRegister cr) {
intptr_t value = src2.immediate(); intptr_t value = src2.immediate();
if (is_uint16(value)) { if (is_uint16(value)) {
cmpli(src1, src2, cr); cmpli(src1, src2, cr);
} else { } else {
mov(scratch, src2); mov(scratch, src2);
cmpl(src1, scratch, cr); CmpU64(src1, scratch, cr);
} }
} }
void TurboAssembler::CmpU64(Register src1, Register src2, CRegister cr) {
cmpl(src1, src2, cr);
}
void TurboAssembler::Cmpwi(Register src1, const Operand& src2, Register scratch, void TurboAssembler::Cmpwi(Register src1, const Operand& src2, Register scratch,
CRegister cr) { CRegister cr) {
intptr_t value = src2.immediate(); intptr_t value = src2.immediate();
...@@ -2721,10 +2725,10 @@ void MacroAssembler::CmpSmiLiteral(Register src1, Smi smi, Register scratch, ...@@ -2721,10 +2725,10 @@ void MacroAssembler::CmpSmiLiteral(Register src1, Smi smi, Register scratch,
void MacroAssembler::CmplSmiLiteral(Register src1, Smi smi, Register scratch, void MacroAssembler::CmplSmiLiteral(Register src1, Smi smi, Register scratch,
CRegister cr) { CRegister cr) {
#if defined(V8_COMPRESS_POINTERS) || defined(V8_31BIT_SMIS_ON_64BIT_ARCH) #if defined(V8_COMPRESS_POINTERS) || defined(V8_31BIT_SMIS_ON_64BIT_ARCH)
Cmpli(src1, Operand(smi), scratch, cr); CmpU64(src1, Operand(smi), scratch, cr);
#else #else
LoadSmiLiteral(scratch, smi); LoadSmiLiteral(scratch, smi);
cmpl(src1, scratch, cr); CmpU64(src1, scratch, cr);
#endif #endif
} }
......
...@@ -155,8 +155,9 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -155,8 +155,9 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void CmpS64(Register src1, const Operand& src2, Register scratch, void CmpS64(Register src1, const Operand& src2, Register scratch,
CRegister cr = cr7); CRegister cr = cr7);
void CmpS64(Register src1, Register src2, CRegister cr = cr7); void CmpS64(Register src1, Register src2, CRegister cr = cr7);
void Cmpli(Register src1, const Operand& src2, Register scratch, void CmpU64(Register src1, const Operand& src2, Register scratch,
CRegister cr = cr7); CRegister cr = cr7);
void CmpU64(Register src1, Register src2, CRegister cr = cr7);
void Cmpwi(Register src1, const Operand& src2, Register scratch, void Cmpwi(Register src1, const Operand& src2, Register scratch,
CRegister cr = cr7); CRegister cr = cr7);
void CompareTagged(Register src1, Register src2, CRegister cr = cr7) { void CompareTagged(Register src1, Register src2, CRegister cr = cr7) {
......
...@@ -1201,7 +1201,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1201,7 +1201,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
constexpr size_t kValueIndex = 0; constexpr size_t kValueIndex = 0;
DCHECK(instr->InputAt(kValueIndex)->IsRegister()); DCHECK(instr->InputAt(kValueIndex)->IsRegister());
__ cmpl(lhs_register, i.InputRegister(kValueIndex), cr0); __ CmpU64(lhs_register, i.InputRegister(kValueIndex), cr0);
break; break;
} }
case kArchStackCheckOffset: case kArchStackCheckOffset:
...@@ -4039,7 +4039,7 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -4039,7 +4039,7 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
cases[index] = GetLabel(i.InputRpo(index + 2)); cases[index] = GetLabel(i.InputRpo(index + 2));
} }
Label* const table = AddJumpTable(cases, case_count); Label* const table = AddJumpTable(cases, case_count);
__ Cmpli(input, Operand(case_count), r0); __ CmpU64(input, Operand(case_count), r0);
__ bge(GetLabel(i.InputRpo(1))); __ bge(GetLabel(i.InputRpo(1)));
__ mov_label_addr(kScratchReg, table); __ mov_label_addr(kScratchReg, table);
__ ShiftLeftImm(r0, input, Operand(kSystemPointerSizeLog2)); __ ShiftLeftImm(r0, input, Operand(kSystemPointerSizeLog2));
...@@ -4178,7 +4178,7 @@ void CodeGenerator::AssembleConstructFrame() { ...@@ -4178,7 +4178,7 @@ void CodeGenerator::AssembleConstructFrame() {
__ LoadU64(scratch, MemOperand(scratch), r0); __ LoadU64(scratch, MemOperand(scratch), r0);
__ AddS64(scratch, scratch, __ AddS64(scratch, scratch,
Operand(required_slots * kSystemPointerSize), r0); Operand(required_slots * kSystemPointerSize), r0);
__ cmpl(sp, scratch); __ CmpU64(sp, scratch);
__ bge(&done); __ bge(&done);
} }
......
...@@ -202,13 +202,13 @@ void RegExpMacroAssemblerPPC::Bind(Label* label) { __ bind(label); } ...@@ -202,13 +202,13 @@ void RegExpMacroAssemblerPPC::Bind(Label* label) { __ bind(label); }
void RegExpMacroAssemblerPPC::CheckCharacter(uint32_t c, Label* on_equal) { void RegExpMacroAssemblerPPC::CheckCharacter(uint32_t c, Label* on_equal) {
__ Cmpli(current_character(), Operand(c), r0); __ CmpU64(current_character(), Operand(c), r0);
BranchOrBacktrack(eq, on_equal); BranchOrBacktrack(eq, on_equal);
} }
void RegExpMacroAssemblerPPC::CheckCharacterGT(base::uc16 limit, void RegExpMacroAssemblerPPC::CheckCharacterGT(base::uc16 limit,
Label* on_greater) { Label* on_greater) {
__ Cmpli(current_character(), Operand(limit), r0); __ CmpU64(current_character(), Operand(limit), r0);
BranchOrBacktrack(gt, on_greater); BranchOrBacktrack(gt, on_greater);
} }
...@@ -231,7 +231,7 @@ void RegExpMacroAssemblerPPC::CheckNotAtStart(int cp_offset, ...@@ -231,7 +231,7 @@ void RegExpMacroAssemblerPPC::CheckNotAtStart(int cp_offset,
void RegExpMacroAssemblerPPC::CheckCharacterLT(base::uc16 limit, void RegExpMacroAssemblerPPC::CheckCharacterLT(base::uc16 limit,
Label* on_less) { Label* on_less) {
__ Cmpli(current_character(), Operand(limit), r0); __ CmpU64(current_character(), Operand(limit), r0);
BranchOrBacktrack(lt, on_less); BranchOrBacktrack(lt, on_less);
} }
...@@ -456,7 +456,7 @@ void RegExpMacroAssemblerPPC::CheckNotBackReference(int start_reg, ...@@ -456,7 +456,7 @@ void RegExpMacroAssemblerPPC::CheckNotBackReference(int start_reg,
void RegExpMacroAssemblerPPC::CheckNotCharacter(unsigned c, void RegExpMacroAssemblerPPC::CheckNotCharacter(unsigned c,
Label* on_not_equal) { Label* on_not_equal) {
__ Cmpli(current_character(), Operand(c), r0); __ CmpU64(current_character(), Operand(c), r0);
BranchOrBacktrack(ne, on_not_equal); BranchOrBacktrack(ne, on_not_equal);
} }
...@@ -468,7 +468,7 @@ void RegExpMacroAssemblerPPC::CheckCharacterAfterAnd(uint32_t c, uint32_t mask, ...@@ -468,7 +468,7 @@ void RegExpMacroAssemblerPPC::CheckCharacterAfterAnd(uint32_t c, uint32_t mask,
__ and_(r3, current_character(), r0, SetRC); __ and_(r3, current_character(), r0, SetRC);
} else { } else {
__ and_(r3, current_character(), r0); __ and_(r3, current_character(), r0);
__ Cmpli(r3, Operand(c), r0, cr0); __ CmpU64(r3, Operand(c), r0, cr0);
} }
BranchOrBacktrack(eq, on_equal, cr0); BranchOrBacktrack(eq, on_equal, cr0);
} }
...@@ -482,7 +482,7 @@ void RegExpMacroAssemblerPPC::CheckNotCharacterAfterAnd(unsigned c, ...@@ -482,7 +482,7 @@ void RegExpMacroAssemblerPPC::CheckNotCharacterAfterAnd(unsigned c,
__ and_(r3, current_character(), r0, SetRC); __ and_(r3, current_character(), r0, SetRC);
} else { } else {
__ and_(r3, current_character(), r0); __ and_(r3, current_character(), r0);
__ Cmpli(r3, Operand(c), r0, cr0); __ CmpU64(r3, Operand(c), r0, cr0);
} }
BranchOrBacktrack(ne, on_not_equal, cr0); BranchOrBacktrack(ne, on_not_equal, cr0);
} }
...@@ -493,7 +493,7 @@ void RegExpMacroAssemblerPPC::CheckNotCharacterAfterMinusAnd( ...@@ -493,7 +493,7 @@ void RegExpMacroAssemblerPPC::CheckNotCharacterAfterMinusAnd(
__ subi(r3, current_character(), Operand(minus)); __ subi(r3, current_character(), Operand(minus));
__ mov(r0, Operand(mask)); __ mov(r0, Operand(mask));
__ and_(r3, r3, r0); __ and_(r3, r3, r0);
__ Cmpli(r3, Operand(c), r0); __ CmpU64(r3, Operand(c), r0);
BranchOrBacktrack(ne, on_not_equal); BranchOrBacktrack(ne, on_not_equal);
} }
...@@ -502,7 +502,7 @@ void RegExpMacroAssemblerPPC::CheckCharacterInRange(base::uc16 from, ...@@ -502,7 +502,7 @@ void RegExpMacroAssemblerPPC::CheckCharacterInRange(base::uc16 from,
Label* on_in_range) { Label* on_in_range) {
__ mov(r0, Operand(from)); __ mov(r0, Operand(from));
__ sub(r3, current_character(), r0); __ sub(r3, current_character(), r0);
__ Cmpli(r3, Operand(to - from), r0); __ CmpU64(r3, Operand(to - from), r0);
BranchOrBacktrack(le, on_in_range); // Unsigned lower-or-same condition. BranchOrBacktrack(le, on_in_range); // Unsigned lower-or-same condition.
} }
...@@ -511,7 +511,7 @@ void RegExpMacroAssemblerPPC::CheckCharacterNotInRange(base::uc16 from, ...@@ -511,7 +511,7 @@ void RegExpMacroAssemblerPPC::CheckCharacterNotInRange(base::uc16 from,
Label* on_not_in_range) { Label* on_not_in_range) {
__ mov(r0, Operand(from)); __ mov(r0, Operand(from));
__ sub(r3, current_character(), r0); __ sub(r3, current_character(), r0);
__ Cmpli(r3, Operand(to - from), r0); __ CmpU64(r3, Operand(to - from), r0);
BranchOrBacktrack(gt, on_not_in_range); // Unsigned higher condition. BranchOrBacktrack(gt, on_not_in_range); // Unsigned higher condition.
} }
...@@ -719,7 +719,7 @@ Handle<HeapObject> RegExpMacroAssemblerPPC::GetCode(Handle<String> source) { ...@@ -719,7 +719,7 @@ Handle<HeapObject> RegExpMacroAssemblerPPC::GetCode(Handle<String> source) {
__ ble(&stack_limit_hit, cr0); __ ble(&stack_limit_hit, cr0);
// Check if there is room for the variable number of registers above // Check if there is room for the variable number of registers above
// the stack limit. // the stack limit.
__ Cmpli(r3, Operand(num_registers_ * kSystemPointerSize), r0); __ CmpU64(r3, Operand(num_registers_ * kSystemPointerSize), r0);
__ bge(&stack_ok); __ bge(&stack_ok);
// Exit with OutOfMemory exception. There is not enough space on the stack // Exit with OutOfMemory exception. There is not enough space on the stack
// for our working registers. // for our working registers.
...@@ -1283,7 +1283,7 @@ void RegExpMacroAssemblerPPC::CheckPreemption() { ...@@ -1283,7 +1283,7 @@ void RegExpMacroAssemblerPPC::CheckPreemption() {
ExternalReference::address_of_jslimit(isolate()); ExternalReference::address_of_jslimit(isolate());
__ mov(r3, Operand(stack_limit)); __ mov(r3, Operand(stack_limit));
__ LoadU64(r3, MemOperand(r3)); __ LoadU64(r3, MemOperand(r3));
__ cmpl(sp, r3); __ CmpU64(sp, r3);
SafeCall(&check_preempt_label_, le); SafeCall(&check_preempt_label_, le);
} }
...@@ -1293,7 +1293,7 @@ void RegExpMacroAssemblerPPC::CheckStackLimit() { ...@@ -1293,7 +1293,7 @@ void RegExpMacroAssemblerPPC::CheckStackLimit() {
ExternalReference::address_of_regexp_stack_limit_address(isolate()); ExternalReference::address_of_regexp_stack_limit_address(isolate());
__ mov(r3, Operand(stack_limit)); __ mov(r3, Operand(stack_limit));
__ LoadU64(r3, MemOperand(r3)); __ LoadU64(r3, MemOperand(r3));
__ cmpl(backtrack_stackpointer(), r3); __ CmpU64(backtrack_stackpointer(), r3);
SafeCall(&stack_overflow_label_, le); SafeCall(&stack_overflow_label_, le);
} }
......
...@@ -1026,7 +1026,7 @@ void LiftoffAssembler::emit_cond_jump(LiftoffCondition liftoff_cond, ...@@ -1026,7 +1026,7 @@ void LiftoffAssembler::emit_cond_jump(LiftoffCondition liftoff_cond,
if (use_signed) { if (use_signed) {
CmpS64(lhs, rhs); CmpS64(lhs, rhs);
} else { } else {
cmpl(lhs, rhs); CmpU64(lhs, rhs);
} }
break; break;
default: default:
...@@ -1090,7 +1090,7 @@ void LiftoffAssembler::emit_i64_set_cond(LiftoffCondition liftoff_cond, ...@@ -1090,7 +1090,7 @@ void LiftoffAssembler::emit_i64_set_cond(LiftoffCondition liftoff_cond,
if (use_signed) { if (use_signed) {
CmpS64(lhs.gp(), rhs.gp()); CmpS64(lhs.gp(), rhs.gp());
} else { } else {
cmpl(lhs.gp(), rhs.gp()); CmpU64(lhs.gp(), rhs.gp());
} }
Label done; Label done;
mov(dst, Operand(1)); mov(dst, Operand(1));
......
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