From adc2824fa405beeea25edacd9362d1f66f8f9520 Mon Sep 17 00:00:00 2001 From: William Sengir Date: Sat, 26 Mar 2022 15:30:13 -0700 Subject: stage2: simplify `scalar_ty` for `mul_add` in LLVM backend --- src/codegen/llvm.zig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index df7f05948d..049f7bfad6 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -5218,6 +5218,7 @@ pub const FuncGen = struct { const ty = self.air.typeOfIndex(inst); const llvm_ty = try self.dg.llvmType(ty); + const scalar_ty = ty.scalarType(); const target = self.dg.module.getTarget(); const Strat = union(enum) { @@ -5225,11 +5226,6 @@ pub const FuncGen = struct { libc: [*:0]const u8, }; - const scalar_ty = if (ty.zigTypeTag() == .Vector) - ty.elemType() - else - ty; - const strat: Strat = switch (scalar_ty.floatBits(target)) { 16, 32, 64 => Strat.intrinsic, 80 => if (CType.longdouble.sizeInBits(target) == 80) Strat{ .intrinsic = {} } else Strat{ .libc = "__fmax" }, -- cgit v1.2.3