cranelift: Remove booleans (#5031)
Remove the boolean types from cranelift, and the associated instructions breduce, bextend, bconst, and bint. Standardize on using 1/0 for the return value from instructions that produce scalar boolean results, and -1/0 for boolean vector elements. Fixes #3205 Co-authored-by: Afonso Bordado <afonso360@users.noreply.github.com> Co-authored-by: Ulrich Weigand <ulrich.weigand@de.ibm.com> Co-authored-by: Chris Fallin <chris@cfallin.org>
This commit is contained in:
@@ -1039,9 +1039,8 @@ impl MachInstEmit for Inst {
|
||||
&Inst::CondBr {
|
||||
taken,
|
||||
not_taken,
|
||||
kind,
|
||||
mut kind,
|
||||
} => {
|
||||
let mut kind = kind;
|
||||
kind.rs1 = allocs.next(kind.rs1);
|
||||
kind.rs2 = allocs.next(kind.rs2);
|
||||
match taken {
|
||||
@@ -1385,13 +1384,13 @@ impl MachInstEmit for Inst {
|
||||
.for_each(|i| i.emit(&[], sink, emit_info, state));
|
||||
|
||||
sink.bind_label(label_true);
|
||||
Inst::load_imm12(rd, Imm12::from_bits(-1)).emit(&[], sink, emit_info, state);
|
||||
Inst::load_imm12(rd, Imm12::TRUE).emit(&[], sink, emit_info, state);
|
||||
Inst::Jal {
|
||||
dest: BranchTarget::offset(Inst::INSTRUCTION_SIZE * 2),
|
||||
}
|
||||
.emit(&[], sink, emit_info, state);
|
||||
sink.bind_label(label_false);
|
||||
Inst::load_imm12(rd, Imm12::from_bits(0)).emit(&[], sink, emit_info, state);
|
||||
Inst::load_imm12(rd, Imm12::FALSE).emit(&[], sink, emit_info, state);
|
||||
}
|
||||
&Inst::AtomicCas {
|
||||
offset,
|
||||
|
||||
Reference in New Issue
Block a user