| author | |
| committer | |
| log | 2ba1ef165aa3fb5da40d05fed9a120630b2529d2 |
| tree | a57611866e4f857483ff03fb666f82fb3a4aba3f |
| parent | ec62e764551557bfaef2bc0daa0398307420257e |
| signature |
5 files changed, 20 insertions(+), 8 deletions(-)
src/arch/aarch64/CodeGen.zig+20-3| ... | ... | @@ -3057,8 +3057,6 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro |
| 3057 | 3057 | const abi_size = ty.abiSize(self.target.*); |
| 3058 | 3058 | switch (mcv) { |
| 3059 | 3059 | .dead => unreachable, |
| 3060 | .ptr_stack_offset => unreachable, | |
| 3061 | .ptr_embedded_in_code => unreachable, | |
| 3062 | 3060 | .unreach, .none => return, // Nothing to do. |
| 3063 | 3061 | .undef => { |
| 3064 | 3062 | if (!self.wantSafety()) |
| ... | ... | @@ -3075,6 +3073,8 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro |
| 3075 | 3073 | .compare_flags_unsigned, |
| 3076 | 3074 | .compare_flags_signed, |
| 3077 | 3075 | .immediate, |
| 3076 | .ptr_stack_offset, | |
| 3077 | .ptr_embedded_in_code, | |
| 3078 | 3078 | => { |
| 3079 | 3079 | const reg = try self.copyToTmpRegister(ty, mcv); |
| 3080 | 3080 | return self.genSetStack(ty, stack_offset, MCValue{ .register = reg }); |
| ... | ... | @@ -3179,7 +3179,6 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro |
| 3179 | 3179 | fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void { |
| 3180 | 3180 | switch (mcv) { |
| 3181 | 3181 | .dead => unreachable, |
| 3182 | .ptr_stack_offset => unreachable, | |
| 3183 | 3182 | .ptr_embedded_in_code => unreachable, |
| 3184 | 3183 | .unreach, .none => return, // Nothing to do. |
| 3185 | 3184 | .undef => { |
| ... | ... | @@ -3192,6 +3191,24 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void |
| 3192 | 3191 | else => unreachable, // unexpected register size |
| 3193 | 3192 | } |
| 3194 | 3193 | }, |
| 3194 | .ptr_stack_offset => |unadjusted_off| { | |
| 3195 | // TODO: maybe addressing from sp instead of fp | |
| 3196 | const elem_ty = ty.childType(); | |
| 3197 | const abi_size = elem_ty.abiSize(self.target.*); | |
| 3198 | const adj_off = unadjusted_off + abi_size; | |
| 3199 | ||
| 3200 | const imm12 = math.cast(u12, adj_off) catch | |
| 3201 | return self.fail("TODO larger stack offsets", .{}); | |
| 3202 | ||
| 3203 | _ = try self.addInst(.{ | |
| 3204 | .tag = .sub_immediate, | |
| 3205 | .data = .{ .rr_imm12_sh = .{ | |
| 3206 | .rd = reg, | |
| 3207 | .rn = .x29, | |
| 3208 | .imm12 = imm12, | |
| 3209 | } }, | |
| 3210 | }); | |
| 3211 | }, | |
| 3195 | 3212 | .compare_flags_unsigned, |
| 3196 | 3213 | .compare_flags_signed, |
| 3197 | 3214 | => |op| { |
test/behavior/align.zig-2| ... | ... | @@ -27,7 +27,6 @@ test "default alignment allows unspecified in type syntax" { |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | test "implicitly decreasing pointer alignment" { |
| 30 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 31 | 30 | const a: u32 align(4) = 3; |
| 32 | 31 | const b: u32 align(8) = 4; |
| 33 | 32 | try expect(addUnaligned(&a, &b) == 7); |
| ... | ... | @@ -38,7 +37,6 @@ fn addUnaligned(a: *align(1) const u32, b: *align(1) const u32) u32 { |
| 38 | 37 | } |
| 39 | 38 | |
| 40 | 39 | test "@alignCast pointers" { |
| 41 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 42 | 40 | var x: u32 align(4) = 1; |
| 43 | 41 | expectsOnly1(&x); |
| 44 | 42 | try expect(x == 2); |
test/behavior/basic.zig-1| ... | ... | @@ -327,7 +327,6 @@ const FnPtrWrapper = struct { |
| 327 | 327 | }; |
| 328 | 328 | |
| 329 | 329 | test "const ptr from var variable" { |
| 330 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 331 | 330 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 332 | 331 | |
| 333 | 332 | var x: u64 = undefined; |
test/behavior/cast.zig-1| ... | ... | @@ -211,7 +211,6 @@ test "implicit cast from *[N]T to [*c]T" { |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | test "*usize to *void" { |
| 214 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 215 | 214 | var i = @as(usize, 0); |
| 216 | 215 | var v = @ptrCast(*void, &i); |
| 217 | 216 | v.* = {}; |
test/behavior/optional.zig-1| ... | ... | @@ -36,7 +36,6 @@ test "optional pointer to size zero struct" { |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | test "equality compare optional pointers" { |
| 39 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 40 | 39 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 41 | 40 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 42 | 41 |