| ... | @@ -3897,7 +3897,7 @@ fn airArrayElemVal(func: *Func, inst: Air.Inst.Index) !void { | ... | @@ -3897,7 +3897,7 @@ fn airArrayElemVal(func: *Func, inst: Air.Inst.Index) !void { |
| 3897 | | 3897 | |
| 3898 | if (array_ty.isVector(zcu)) { | 3898 | if (array_ty.isVector(zcu)) { |
| 3899 | // we need to load the vector, vslidedown to get the element we want | 3899 | // we need to load the vector, vslidedown to get the element we want |
| 3900 | // and store that element at in a load frame. | 3900 | // and store that element in a load frame. |
| 3901 | | 3901 | |
| 3902 | const src_reg, const src_lock = try func.allocReg(.vector); | 3902 | const src_reg, const src_lock = try func.allocReg(.vector); |
| 3903 | defer func.register_manager.unlockReg(src_lock); | 3903 | defer func.register_manager.unlockReg(src_lock); |
| ... | @@ -3970,12 +3970,15 @@ fn airPtrElemVal(func: *Func, inst: Air.Inst.Index) !void { | ... | @@ -3970,12 +3970,15 @@ fn airPtrElemVal(func: *Func, inst: Air.Inst.Index) !void { |
| 3970 | }; | 3970 | }; |
| 3971 | defer if (index_lock) |lock| func.register_manager.unlockReg(lock); | 3971 | defer if (index_lock) |lock| func.register_manager.unlockReg(lock); |
| 3972 | | 3972 | |
| 3973 | const elem_ptr_reg = if (base_ptr_mcv.isRegister() and func.liveness.operandDies(inst, 0)) | 3973 | const elem_ptr_reg, const elem_ptr_lock = if (base_ptr_mcv.isRegister() and |
| 3974 | base_ptr_mcv.register | 3974 | func.liveness.operandDies(inst, 0)) |
| 3975 | else | 3975 | .{ base_ptr_mcv.register, null } |
| 3976 | try func.copyToTmpRegister(base_ptr_ty, base_ptr_mcv); | 3976 | else blk: { |
| 3977 | const elem_ptr_lock = func.register_manager.lockRegAssumeUnused(elem_ptr_reg); | 3977 | const reg, const lock = try func.allocReg(.int); |
| 3978 | defer func.register_manager.unlockReg(elem_ptr_lock); | 3978 | try func.genSetReg(base_ptr_ty, reg, base_ptr_mcv); |
| | 3979 | break :blk .{ reg, lock }; |
| | 3980 | }; |
| | 3981 | defer if (elem_ptr_lock) |lock| func.register_manager.unlockReg(lock); |
| 3979 | | 3982 | |
| 3980 | try func.genBinOp( | 3983 | try func.genBinOp( |
| 3981 | .ptr_add, | 3984 | .ptr_add, |