| ... | ... | @@ -5189,14 +5189,12 @@ pub const FuncGen = struct { |
| 5189 | 5189 | if (self.liveness.isUnused(inst)) |
| 5190 | 5190 | return null; |
| 5191 | 5191 | |
| 5192 | | const pl_op = self.air.instructions.items(.data)[inst].pl_op; |
| 5193 | | const extra = self.air.extraData(Air.Bin, pl_op.payload).data; |
| 5192 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| 5193 | const extra = self.air.extraData(Air.Bin, ty_pl.payload).data; |
| 5194 | 5194 | |
| 5195 | | const ptr = try self.resolveInst(pl_op.operand); |
| 5196 | 5195 | const lhs = try self.resolveInst(extra.lhs); |
| 5197 | 5196 | const rhs = try self.resolveInst(extra.rhs); |
| 5198 | 5197 | |
| 5199 | | const ptr_ty = self.air.typeOf(pl_op.operand); |
| 5200 | 5198 | const lhs_ty = self.air.typeOf(extra.lhs); |
| 5201 | 5199 | |
| 5202 | 5200 | const intrinsic_name = if (lhs_ty.isSignedInt()) signed_intrinsic else unsigned_intrinsic; |
| ... | ... | @@ -5205,13 +5203,7 @@ pub const FuncGen = struct { |
| 5205 | 5203 | |
| 5206 | 5204 | const llvm_fn = self.getIntrinsic(intrinsic_name, &.{llvm_lhs_ty}); |
| 5207 | 5205 | const result_struct = self.builder.buildCall(llvm_fn, &[_]*const llvm.Value{ lhs, rhs }, 2, .Fast, .Auto, ""); |
| 5208 | | |
| 5209 | | const result = self.builder.buildExtractValue(result_struct, 0, ""); |
| 5210 | | const overflow_bit = self.builder.buildExtractValue(result_struct, 1, ""); |
| 5211 | | |
| 5212 | | self.store(ptr, ptr_ty, result, .NotAtomic); |
| 5213 | | |
| 5214 | | return overflow_bit; |
| 5206 | return result_struct; |
| 5215 | 5207 | } |
| 5216 | 5208 | |
| 5217 | 5209 | fn airMulAdd(self: *FuncGen, inst: Air.Inst.Index) !?*const llvm.Value { |
| ... | ... | @@ -5293,16 +5285,16 @@ pub const FuncGen = struct { |
| 5293 | 5285 | if (self.liveness.isUnused(inst)) |
| 5294 | 5286 | return null; |
| 5295 | 5287 | |
| 5296 | | const pl_op = self.air.instructions.items(.data)[inst].pl_op; |
| 5297 | | const extra = self.air.extraData(Air.Bin, pl_op.payload).data; |
| 5288 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| 5289 | const extra = self.air.extraData(Air.Bin, ty_pl.payload).data; |
| 5298 | 5290 | |
| 5299 | | const ptr = try self.resolveInst(pl_op.operand); |
| 5300 | 5291 | const lhs = try self.resolveInst(extra.lhs); |
| 5301 | 5292 | const rhs = try self.resolveInst(extra.rhs); |
| 5302 | 5293 | |
| 5303 | | const ptr_ty = self.air.typeOf(pl_op.operand); |
| 5304 | 5294 | const lhs_ty = self.air.typeOf(extra.lhs); |
| 5305 | 5295 | const rhs_ty = self.air.typeOf(extra.rhs); |
| 5296 | const dest_ty = self.air.typeOfIndex(inst); |
| 5297 | const llvm_dest_ty = try self.dg.llvmType(dest_ty); |
| 5306 | 5298 | |
| 5307 | 5299 | const tg = self.dg.module.getTarget(); |
| 5308 | 5300 | |
| ... | ... | @@ -5319,9 +5311,8 @@ pub const FuncGen = struct { |
| 5319 | 5311 | |
| 5320 | 5312 | const overflow_bit = self.builder.buildICmp(.NE, lhs, reconstructed, ""); |
| 5321 | 5313 | |
| 5322 | | self.store(ptr, ptr_ty, result, .NotAtomic); |
| 5323 | | |
| 5324 | | return overflow_bit; |
| 5314 | const partial = self.builder.buildInsertValue(llvm_dest_ty.getUndef(), result, 0, ""); |
| 5315 | return self.builder.buildInsertValue(partial, overflow_bit, 1, ""); |
| 5325 | 5316 | } |
| 5326 | 5317 | |
| 5327 | 5318 | fn airAnd(self: *FuncGen, inst: Air.Inst.Index) !?*const llvm.Value { |