riscv64: Cleanup unused lower_float_unordered (#6096)

This commit is contained in:
Afonso Bordado
2023-03-23 21:08:38 +00:00
committed by GitHub
parent 602ff71fe4
commit 3546ccf7d1

View File

@@ -370,68 +370,6 @@ impl Inst {
} }
insts insts
} }
/// check if float is unordered.
pub(crate) fn lower_float_unordered(
tmp: Writable<Reg>,
ty: Type,
x: Reg,
y: Reg,
taken: BranchTarget,
not_taken: BranchTarget,
) -> SmallInstVec<Inst> {
let mut insts = SmallInstVec::new();
let class_op = if ty == F32 {
FpuOPRR::FclassS
} else {
FpuOPRR::FclassD
};
// if x is nan
insts.push(Inst::FpuRR {
frm: None,
alu_op: class_op,
rd: tmp,
rs: x,
});
insts.push(Inst::AluRRImm12 {
alu_op: AluOPRRI::Andi,
rd: tmp,
rs: tmp.to_reg(),
imm12: Imm12::from_bits(FClassResult::is_nan_bits() as i16),
});
insts.push(Inst::CondBr {
taken,
not_taken: BranchTarget::zero(),
kind: IntegerCompare {
kind: IntCC::NotEqual,
rs1: tmp.to_reg(),
rs2: zero_reg(),
},
});
// if y is nan.
insts.push(Inst::FpuRR {
frm: None,
alu_op: class_op,
rd: tmp,
rs: y,
});
insts.push(Inst::AluRRImm12 {
alu_op: AluOPRRI::Andi,
rd: tmp,
rs: tmp.to_reg(),
imm12: Imm12::from_bits(FClassResult::is_nan_bits() as i16),
});
insts.push(Inst::CondBr {
taken,
not_taken,
kind: IntegerCompare {
kind: IntCC::NotEqual,
rs1: tmp.to_reg(),
rs2: zero_reg(),
},
});
insts
}
} }
impl MachInstEmit for Inst { impl MachInstEmit for Inst {