authorgravatar for william@sengir.comWilliam Sengir <william@sengir.com> 2022-03-26 15:30:13-07:00
committergravatar for william@sengir.comWilliam Sengir <william@sengir.com> 2022-03-26 16:29:48-07:00
logadc2824fa405beeea25edacd9362d1f66f8f9520
treee21fb9787b9aa171b87e9f97a805ec6c1f01b728
parent6a48345649de9d0ad5c948ca1ddd3277de046567
signature Commit is signed but in an unrecognized format.

stage2: simplify `scalar_ty` for `mul_add` in LLVM backend


1 files changed, 1 insertions(+), 5 deletions(-)

src/codegen/llvm.zig+1-5
......@@ -5218,6 +5218,7 @@ pub const FuncGen = struct {
52185218
52195219 const ty = self.air.typeOfIndex(inst);
52205220 const llvm_ty = try self.dg.llvmType(ty);
5221 const scalar_ty = ty.scalarType();
52215222 const target = self.dg.module.getTarget();
52225223
52235224 const Strat = union(enum) {
......@@ -5225,11 +5226,6 @@ pub const FuncGen = struct {
52255226 libc: [*:0]const u8,
52265227 };
52275228
5228 const scalar_ty = if (ty.zigTypeTag() == .Vector)
5229 ty.elemType()
5230 else
5231 ty;
5232
52335229 const strat: Strat = switch (scalar_ty.floatBits(target)) {
52345230 16, 32, 64 => Strat.intrinsic,
52355231 80 => if (CType.longdouble.sizeInBits(target) == 80) Strat{ .intrinsic = {} } else Strat{ .libc = "__fmax" },