Commit 483400e5 authored by Lu Yahan's avatar Lu Yahan Committed by V8 LUCI CQ

[riscv64] Delete kNoCondition


Port commit 738f4b69


Change-Id: I1f8e36f2db7a4b5a88a2fa5b726df1dfa997f28e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3631835
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: 's avatarji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#80410}
parent e75af609
...@@ -3605,13 +3605,12 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, ...@@ -3605,13 +3605,12 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
// last output of the instruction. // last output of the instruction.
DCHECK_NE(0u, instr->OutputCount()); DCHECK_NE(0u, instr->OutputCount());
Register result = i.OutputRegister(instr->OutputCount() - 1); Register result = i.OutputRegister(instr->OutputCount() - 1);
Condition cc = kNoCondition;
// RISC-V does not have condition code flags, so compare and branch are // RISC-V does not have condition code flags, so compare and branch are
// implemented differently than on the other arch's. The compare operations // implemented differently than on the other arch's. The compare operations
// emit riscv64 pseudo-instructions, which are checked and handled here. // emit riscv64 pseudo-instructions, which are checked and handled here.
if (instr->arch_opcode() == kRiscvTst) { if (instr->arch_opcode() == kRiscvTst) {
cc = FlagsConditionToConditionTst(condition); Condition cc = FlagsConditionToConditionTst(condition);
if (cc == eq) { if (cc == eq) {
__ Sltu(result, kScratchReg, 1); __ Sltu(result, kScratchReg, 1);
} else { } else {
...@@ -3620,7 +3619,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, ...@@ -3620,7 +3619,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
return; return;
} else if (instr->arch_opcode() == kRiscvAdd64 || } else if (instr->arch_opcode() == kRiscvAdd64 ||
instr->arch_opcode() == kRiscvSub64) { instr->arch_opcode() == kRiscvSub64) {
cc = FlagsConditionToConditionOvf(condition); Condition cc = FlagsConditionToConditionOvf(condition);
// Check for overflow creates 1 or 0 for result. // Check for overflow creates 1 or 0 for result.
__ Srl64(kScratchReg, i.OutputRegister(), 63); __ Srl64(kScratchReg, i.OutputRegister(), 63);
__ Srl32(kScratchReg2, i.OutputRegister(), 31); __ Srl32(kScratchReg2, i.OutputRegister(), 31);
...@@ -3636,7 +3635,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, ...@@ -3636,7 +3635,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
// Overflow occurs if overflow register is not zero // Overflow occurs if overflow register is not zero
__ Sgtu(result, kScratchReg, zero_reg); __ Sgtu(result, kScratchReg, zero_reg);
} else if (instr->arch_opcode() == kRiscvCmp) { } else if (instr->arch_opcode() == kRiscvCmp) {
cc = FlagsConditionToConditionCmp(condition); Condition cc = FlagsConditionToConditionCmp(condition);
switch (cc) { switch (cc) {
case eq: case eq:
case ne: { case ne: {
...@@ -3721,7 +3720,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, ...@@ -3721,7 +3720,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
} }
return; return;
} else if (instr->arch_opcode() == kRiscvCmpZero) { } else if (instr->arch_opcode() == kRiscvCmpZero) {
cc = FlagsConditionToConditionCmp(condition); Condition cc = FlagsConditionToConditionCmp(condition);
switch (cc) { switch (cc) {
case eq: { case eq: {
Register left = i.InputOrZeroRegister(0); Register left = i.InputOrZeroRegister(0);
...@@ -3773,7 +3772,6 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, ...@@ -3773,7 +3772,6 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
} }
return; return;
} else if (instr->arch_opcode() == kArchStackPointerGreaterThan) { } else if (instr->arch_opcode() == kArchStackPointerGreaterThan) {
cc = FlagsConditionToConditionCmp(condition);
Register lhs_register = sp; Register lhs_register = sp;
uint32_t offset; uint32_t offset;
if (ShouldApplyOffsetToStackCheck(instr, &offset)) { if (ShouldApplyOffsetToStackCheck(instr, &offset)) {
......
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