| ... | @@ -1104,9 +1104,10 @@ pub const Value = struct { | ... | @@ -1104,9 +1104,10 @@ pub const Value = struct { |
| 1104 | ) !bool { | 1104 | ) !bool { |
| 1105 | try vi.reextendToPcs(isel); | 1105 | try vi.reextendToPcs(isel); |
| 1106 | try vi.collectDefs(isel); | 1106 | try vi.collectDefs(isel); |
| | 1107 | if (opts.@"volatile") |
| | 1108 | try (try vi.mat(isel, .{})).finish(isel); |
| 1107 | const loc = vi.takeLocationMarkWritten(isel) orelse return false; | 1109 | const loc = vi.takeLocationMarkWritten(isel) orelse return false; |
| 1108 | wip_mir_log.debug(" | # load {f} <- [${t}, #{d}] ({d}B)", .{ vi, base_reg, offset, vi.size(isel) }); | 1110 | wip_mir_log.debug(" | # load {f} <- [${t}, #{d}] ({d}B)", .{ vi, base_reg, offset, vi.size(isel) }); |
| 1109 | _ = opts; | | |
| 1110 | | 1111 | |
| 1111 | try isel.moveLoc( | 1112 | try isel.moveLoc( |
| 1112 | loc, | 1113 | loc, |
| ... | @@ -1277,7 +1278,6 @@ pub const Value = struct { | ... | @@ -1277,7 +1278,6 @@ pub const Value = struct { |
| 1277 | } | 1278 | } |
| 1278 | | 1279 | |
| 1279 | const MemoryAccessOptions = struct { | 1280 | const MemoryAccessOptions = struct { |
| 1280 | // TODO unimplemented, remove? | | |
| 1281 | @"volatile": bool = false, | 1281 | @"volatile": bool = false, |
| 1282 | }; | 1282 | }; |
| 1283 | | 1283 | |
| ... | @@ -3971,7 +3971,8 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) codegen.Error!void | ... | @@ -3971,7 +3971,8 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) codegen.Error!void |
| 3971 | const ptr_info = ptr_ty.ptrInfo(zcu); | 3971 | const ptr_info = ptr_ty.ptrInfo(zcu); |
| 3972 | if (ptr_info.packed_offset.host_size > 0) return isel.fail("packed load", .{}); | 3972 | if (ptr_info.packed_offset.host_size > 0) return isel.fail("packed load", .{}); |
| 3973 | | 3973 | |
| 3974 | if (ptr_info.flags.is_volatile) _ = try isel.use(air.inst_index.toRef()); | 3974 | if (ptr_info.flags.is_volatile) |
| | 3975 | _ = try isel.use(air.inst_index.toRef()); |
| 3975 | if (isel.live_values.fetchRemove(air.inst_index)) |dst_vi| { | 3976 | if (isel.live_values.fetchRemove(air.inst_index)) |dst_vi| { |
| 3976 | defer dst_vi.value.deref(isel); | 3977 | defer dst_vi.value.deref(isel); |
| 3977 | | 3978 | |