stage2: simplify scalar_ty for mul_add in LLVM backend

This commit is contained in:
William Sengir 2022-03-26 15:30:13 -07:00
parent 6a48345649
commit adc2824fa4
No known key found for this signature in database
GPG Key ID: 83492BF162833F2A

View File

@ -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" },