|
| 1 | +From 84386164e3c2c6ac5348040bb2b662310127134e Mon Sep 17 00:00:00 2001 |
| 2 | +From: Mingcong Bai < [email protected]> |
| 3 | +Date: Fri, 18 Oct 2024 14:51:44 +0800 |
| 4 | +Subject: [PATCH 3/3] Revert "Add f16/f128 handling in a couple places" |
| 5 | + |
| 6 | +The f16/f128 handling introduced as part of rust-lang/rustc#125016 (Update |
| 7 | +compiler_builtins to 0.1.114) broke compilation on LoongArch and RISC-V: |
| 8 | + |
| 9 | +error: internal compiler error: compiler/rustc_codegen_llvm/src/abi.rs: |
| 10 | +126:22: unsupported float: Reg { kind: Float, size: Size(2 bytes) } |
| 11 | + |
| 12 | +thread 'rustc' panicked at compiler/rustc_codegen_llvm/src/abi.rs:126:22: |
| 13 | +Box<dyn Any> |
| 14 | + |
| 15 | +This should be resolved with LLVM 19, but we are still on LLVM 18. |
| 16 | + |
| 17 | +Revert 99e6a28804eac57faa37134d61a2bb17069996a2 as a temporary workaround. |
| 18 | + |
| 19 | +Ref: https://github.com/rust-lang/rust/pull/125016 |
| 20 | +--- |
| 21 | + compiler/rustc_codegen_llvm/src/abi.rs | 2 -- |
| 22 | + compiler/rustc_target/src/abi/call/mod.rs | 2 -- |
| 23 | + 2 files changed, 4 deletions(-) |
| 24 | + |
| 25 | +diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs |
| 26 | +index dea574a53c..6d1bfb42e4 100644 |
| 27 | +--- a/compiler/rustc_codegen_llvm/src/abi.rs |
| 28 | ++++ b/compiler/rustc_codegen_llvm/src/abi.rs |
| 29 | +@@ -120,10 +120,8 @@ impl LlvmType for Reg { |
| 30 | + match self.kind { |
| 31 | + RegKind::Integer => cx.type_ix(self.size.bits()), |
| 32 | + RegKind::Float => match self.size.bits() { |
| 33 | +- 16 => cx.type_f16(), |
| 34 | + 32 => cx.type_f32(), |
| 35 | + 64 => cx.type_f64(), |
| 36 | +- 128 => cx.type_f128(), |
| 37 | + _ => bug!("unsupported float: {:?}", self), |
| 38 | + }, |
| 39 | + RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()), |
| 40 | +diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs |
| 41 | +index 082c169b21..78a8de9813 100644 |
| 42 | +--- a/compiler/rustc_target/src/abi/call/mod.rs |
| 43 | ++++ b/compiler/rustc_target/src/abi/call/mod.rs |
| 44 | +@@ -238,10 +238,8 @@ impl Reg { |
| 45 | + _ => panic!("unsupported integer: {self:?}"), |
| 46 | + }, |
| 47 | + RegKind::Float => match self.size.bits() { |
| 48 | +- 16 => dl.f16_align.abi, |
| 49 | + 32 => dl.f32_align.abi, |
| 50 | + 64 => dl.f64_align.abi, |
| 51 | +- 128 => dl.f128_align.abi, |
| 52 | + _ => panic!("unsupported float: {self:?}"), |
| 53 | + }, |
| 54 | + RegKind::Vector => dl.vector_align(self.size).abi, |
| 55 | +-- |
| 56 | +2.47.0 |
| 57 | + |
0 commit comments