Skip to content

Commit

Permalink
Revert "Add f16/f128 handling in a couple places"
Browse files Browse the repository at this point in the history
The f16/f128 handling introduced as part of rust-lang/rustc#125016 (Update
compiler_builtins to 0.1.114) broke compilation on LoongArch and RISC-V:

error: internal compiler error: compiler/rustc_codegen_llvm/src/abi.rs:
126:22: unsupported float: Reg { kind: Float, size: Size(2 bytes) }

thread 'rustc' panicked at compiler/rustc_codegen_llvm/src/abi.rs:126:22:
Box<dyn Any>

This should be resolved with LLVM 19, but we are still on LLVM 18.

Revert 99e6a28 as a temporary workaround.

Ref: rust-lang#125016
  • Loading branch information
MingcongBai committed Oct 18, 2024
1 parent 93896c7 commit 8438616
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_llvm/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ impl LlvmType for Reg {
match self.kind {
RegKind::Integer => cx.type_ix(self.size.bits()),
RegKind::Float => match self.size.bits() {
16 => cx.type_f16(),
32 => cx.type_f32(),
64 => cx.type_f64(),
128 => cx.type_f128(),
_ => bug!("unsupported float: {:?}", self),
},
RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()),
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_target/src/abi/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,8 @@ impl Reg {
_ => panic!("unsupported integer: {self:?}"),
},
RegKind::Float => match self.size.bits() {
16 => dl.f16_align.abi,
32 => dl.f32_align.abi,
64 => dl.f64_align.abi,
128 => dl.f128_align.abi,
_ => panic!("unsupported float: {self:?}"),
},
RegKind::Vector => dl.vector_align(self.size).abi,
Expand Down

0 comments on commit 8438616

Please sign in to comment.