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,
// last output of the instruction.
DCHECK_NE(0u, instr->OutputCount());
Register result = i.OutputRegister(instr->OutputCount() - 1);
Condition cc = kNoCondition;
// RISC-V does not have condition code flags, so compare and branch are
// implemented differently than on the other arch's. The compare operations
// emit riscv64 pseudo-instructions, which are checked and handled here.
if (instr->arch_opcode() == kRiscvTst) {
cc = FlagsConditionToConditionTst(condition);
Condition cc = FlagsConditionToConditionTst(condition);
if (cc == eq) {
__ Sltu(result, kScratchReg, 1);
} else {
......@@ -3620,7 +3619,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
return;
} else if (instr->arch_opcode() == kRiscvAdd64 ||
instr->arch_opcode() == kRiscvSub64) {
cc = FlagsConditionToConditionOvf(condition);
Condition cc = FlagsConditionToConditionOvf(condition);
// Check for overflow creates 1 or 0 for result.
__ Srl64(kScratchReg, i.OutputRegister(), 63);
__ Srl32(kScratchReg2, i.OutputRegister(), 31);
......@@ -3636,7 +3635,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
// Overflow occurs if overflow register is not zero
__ Sgtu(result, kScratchReg, zero_reg);
} else if (instr->arch_opcode() == kRiscvCmp) {
cc = FlagsConditionToConditionCmp(condition);
Condition cc = FlagsConditionToConditionCmp(condition);
switch (cc) {
case eq:
case ne: {
......@@ -3721,7 +3720,7 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
}
return;
} else if (instr->arch_opcode() == kRiscvCmpZero) {
cc = FlagsConditionToConditionCmp(condition);
Condition cc = FlagsConditionToConditionCmp(condition);
switch (cc) {
case eq: {
Register left = i.InputOrZeroRegister(0);
......@@ -3773,7 +3772,6 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
}
return;
} else if (instr->arch_opcode() == kArchStackPointerGreaterThan) {
cc = FlagsConditionToConditionCmp(condition);
Register lhs_register = sp;
uint32_t 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