| ... | ... | @@ -4222,6 +4222,8 @@ fn load(cg: *CodeGen, value_ty: Type, ptr_id: Id, options: MemoryOptions) !Id { |
| 4222 | 4222 | } |
| 4223 | 4223 | |
| 4224 | 4224 | fn store(cg: *CodeGen, value_ty: Type, ptr_id: Id, value_id: Id, options: MemoryOptions) !void { |
| 4225 | const zcu = cg.zcu; |
| 4226 | const alignment: u32 = @intCast(value_ty.abiAlignment(zcu).toByteUnits().?); |
| 4225 | 4227 | const bare_value_id = try cg.convertToIndirect(value_ty, value_id); |
| 4226 | 4228 | const bare_ty_id = try cg.resolveType(value_ty, .indirect); |
| 4227 | 4229 | const store_ty_id = if (cg.needsLayout(options.ptr_address_space, value_ty)) |
| ... | ... | @@ -4232,7 +4234,10 @@ fn store(cg: *CodeGen, value_ty: Type, ptr_id: Id, value_id: Id, options: Memory |
| 4232 | 4234 | try cg.body.emit(cg.gpa, .OpStore, .{ |
| 4233 | 4235 | .pointer = ptr_id, |
| 4234 | 4236 | .object = object_id, |
| 4235 | | .memory_access = .{ .@"volatile" = options.is_volatile }, |
| 4237 | .memory_access = .{ |
| 4238 | .@"volatile" = options.is_volatile, |
| 4239 | .aligned = .{ .literal_integer = alignment }, |
| 4240 | }, |
| 4236 | 4241 | }); |
| 4237 | 4242 | } |
| 4238 | 4243 | |