Skip to content

Commit

Permalink
Add f16/f128 handling in a couple places
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasbishop committed May 30, 2024
1 parent f6e4703 commit 99e6a28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_llvm/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ 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: 2 additions & 0 deletions compiler/rustc_target/src/abi/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ 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 99e6a28

Please sign in to comment.