Skip to content

Commit 3546ccf

Browse files
authored
riscv64: Cleanup unused lower_float_unordered (#6096)
1 parent 602ff71 commit 3546ccf

File tree

1 file changed

+0
-62
lines changed
  • cranelift/codegen/src/isa/riscv64/inst

1 file changed

+0
-62
lines changed

cranelift/codegen/src/isa/riscv64/inst/emit.rs

-62
Original file line numberDiff line numberDiff line change
@@ -370,68 +370,6 @@ impl Inst {
370370
}
371371
insts
372372
}
373-
374-
/// check if float is unordered.
375-
pub(crate) fn lower_float_unordered(
376-
tmp: Writable<Reg>,
377-
ty: Type,
378-
x: Reg,
379-
y: Reg,
380-
taken: BranchTarget,
381-
not_taken: BranchTarget,
382-
) -> SmallInstVec<Inst> {
383-
let mut insts = SmallInstVec::new();
384-
let class_op = if ty == F32 {
385-
FpuOPRR::FclassS
386-
} else {
387-
FpuOPRR::FclassD
388-
};
389-
// if x is nan
390-
insts.push(Inst::FpuRR {
391-
frm: None,
392-
alu_op: class_op,
393-
rd: tmp,
394-
rs: x,
395-
});
396-
insts.push(Inst::AluRRImm12 {
397-
alu_op: AluOPRRI::Andi,
398-
rd: tmp,
399-
rs: tmp.to_reg(),
400-
imm12: Imm12::from_bits(FClassResult::is_nan_bits() as i16),
401-
});
402-
insts.push(Inst::CondBr {
403-
taken,
404-
not_taken: BranchTarget::zero(),
405-
kind: IntegerCompare {
406-
kind: IntCC::NotEqual,
407-
rs1: tmp.to_reg(),
408-
rs2: zero_reg(),
409-
},
410-
});
411-
// if y is nan.
412-
insts.push(Inst::FpuRR {
413-
frm: None,
414-
alu_op: class_op,
415-
rd: tmp,
416-
rs: y,
417-
});
418-
insts.push(Inst::AluRRImm12 {
419-
alu_op: AluOPRRI::Andi,
420-
rd: tmp,
421-
rs: tmp.to_reg(),
422-
imm12: Imm12::from_bits(FClassResult::is_nan_bits() as i16),
423-
});
424-
insts.push(Inst::CondBr {
425-
taken,
426-
not_taken,
427-
kind: IntegerCompare {
428-
kind: IntCC::NotEqual,
429-
rs1: tmp.to_reg(),
430-
rs2: zero_reg(),
431-
},
432-
});
433-
insts
434-
}
435373
}
436374

437375
impl MachInstEmit for Inst {

0 commit comments

Comments
 (0)