Add f16/f128 handling in a couple places

This commit is contained in:
Nicholas Bishop 2024-05-30 18:32:46 -04:00
parent f6e4703e91
commit 99e6a28804
2 changed files with 4 additions and 0 deletions

View File

@ -121,8 +121,10 @@ impl LlvmType for Reg {
match self.kind { match self.kind {
RegKind::Integer => cx.type_ix(self.size.bits()), RegKind::Integer => cx.type_ix(self.size.bits()),
RegKind::Float => match self.size.bits() { RegKind::Float => match self.size.bits() {
16 => cx.type_f16(),
32 => cx.type_f32(), 32 => cx.type_f32(),
64 => cx.type_f64(), 64 => cx.type_f64(),
128 => cx.type_f128(),
_ => bug!("unsupported float: {:?}", self), _ => bug!("unsupported float: {:?}", self),
}, },
RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()), RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()),

View File

@ -236,8 +236,10 @@ impl Reg {
_ => panic!("unsupported integer: {self:?}"), _ => panic!("unsupported integer: {self:?}"),
}, },
RegKind::Float => match self.size.bits() { RegKind::Float => match self.size.bits() {
16 => dl.f16_align.abi,
32 => dl.f32_align.abi, 32 => dl.f32_align.abi,
64 => dl.f64_align.abi, 64 => dl.f64_align.abi,
128 => dl.f128_align.abi,
_ => panic!("unsupported float: {self:?}"), _ => panic!("unsupported float: {self:?}"),
}, },
RegKind::Vector => dl.vector_align(self.size).abi, RegKind::Vector => dl.vector_align(self.size).abi,