| ... | ... | @@ -207,10 +207,12 @@ pub const MCValue = union(enum) { |
| 207 | 207 | /// The value is a pointer to a value referenced indirectly via GOT. |
| 208 | 208 | /// Payload is a symbol index. |
| 209 | 209 | lea_got: u32, |
| 210 | | /// TODO indirection via actual .got table |
| 211 | | /// LOL Jakub, the king of naming... |
| 212 | | load_actual_got: u32, |
| 213 | | lea_actual_got: u32, |
| 210 | /// The value is an extern variable referenced via GOT. |
| 211 | /// Payload is a symbol index. |
| 212 | load_extern_got: u32, |
| 213 | /// The value is a pointer to an extern variable referenced via GOT. |
| 214 | /// Payload is a symbol index. |
| 215 | lea_extern_got: u32, |
| 214 | 216 | /// The value is a threadlocal variable. |
| 215 | 217 | /// Payload is a symbol index. |
| 216 | 218 | load_tlv: u32, |
| ... | ... | @@ -299,7 +301,7 @@ pub const MCValue = union(enum) { |
| 299 | 301 | .register_overflow, |
| 300 | 302 | .lea_direct, |
| 301 | 303 | .lea_got, |
| 302 | | .lea_actual_got, |
| 304 | .lea_extern_got, |
| 303 | 305 | .lea_tlv, |
| 304 | 306 | .lea_frame, |
| 305 | 307 | .reserved_frame, |
| ... | ... | @@ -313,7 +315,7 @@ pub const MCValue = union(enum) { |
| 313 | 315 | .load_direct => |sym_index| .{ .lea_direct = sym_index }, |
| 314 | 316 | .load_got => |sym_index| .{ .lea_got = sym_index }, |
| 315 | 317 | .load_tlv => |sym_index| .{ .lea_tlv = sym_index }, |
| 316 | | .load_actual_got => |sym_index| .{ .lea_actual_got = sym_index }, |
| 318 | .load_extern_got => |sym_index| .{ .lea_extern_got = sym_index }, |
| 317 | 319 | .load_frame => |frame_addr| .{ .lea_frame = frame_addr }, |
| 318 | 320 | }; |
| 319 | 321 | } |
| ... | ... | @@ -331,7 +333,7 @@ pub const MCValue = union(enum) { |
| 331 | 333 | .indirect, |
| 332 | 334 | .load_direct, |
| 333 | 335 | .load_got, |
| 334 | | .load_actual_got, |
| 336 | .load_extern_got, |
| 335 | 337 | .load_tlv, |
| 336 | 338 | .load_frame, |
| 337 | 339 | .reserved_frame, |
| ... | ... | @@ -342,7 +344,7 @@ pub const MCValue = union(enum) { |
| 342 | 344 | .register_offset => |reg_off| .{ .indirect = reg_off }, |
| 343 | 345 | .lea_direct => |sym_index| .{ .load_direct = sym_index }, |
| 344 | 346 | .lea_got => |sym_index| .{ .load_got = sym_index }, |
| 345 | | .lea_actual_got => |sym_index| .{ .load_actual_got = sym_index }, |
| 347 | .lea_extern_got => |sym_index| .{ .load_extern_got = sym_index }, |
| 346 | 348 | .lea_tlv => |sym_index| .{ .load_tlv = sym_index }, |
| 347 | 349 | .lea_frame => |frame_addr| .{ .load_frame = frame_addr }, |
| 348 | 350 | }; |
| ... | ... | @@ -366,8 +368,8 @@ pub const MCValue = union(enum) { |
| 366 | 368 | .lea_direct, |
| 367 | 369 | .load_got, |
| 368 | 370 | .lea_got, |
| 369 | | .load_actual_got, |
| 370 | | .lea_actual_got, |
| 371 | .load_extern_got, |
| 372 | .lea_extern_got, |
| 371 | 373 | .load_tlv, |
| 372 | 374 | .lea_tlv, |
| 373 | 375 | .load_frame, |
| ... | ... | @@ -402,8 +404,8 @@ pub const MCValue = union(enum) { |
| 402 | 404 | .lea_direct, |
| 403 | 405 | .load_got, |
| 404 | 406 | .lea_got, |
| 405 | | .load_actual_got, |
| 406 | | .lea_actual_got, |
| 407 | .load_extern_got, |
| 408 | .lea_extern_got, |
| 407 | 409 | .load_tlv, |
| 408 | 410 | .lea_tlv, |
| 409 | 411 | .lea_frame, |
| ... | ... | @@ -446,8 +448,8 @@ pub const MCValue = union(enum) { |
| 446 | 448 | .lea_direct => |pl| try writer.print("direct:{d}", .{pl}), |
| 447 | 449 | .load_got => |pl| try writer.print("[got:{d}]", .{pl}), |
| 448 | 450 | .lea_got => |pl| try writer.print("got:{d}", .{pl}), |
| 449 | | .load_actual_got => |pl| try writer.print("[actual_got:{d}]", .{pl}), |
| 450 | | .lea_actual_got => |pl| try writer.print("actual_got:{d}", .{pl}), |
| 451 | .load_extern_got => |pl| try writer.print("[extern_got:{d}]", .{pl}), |
| 452 | .lea_extern_got => |pl| try writer.print("extern_got:{d}", .{pl}), |
| 451 | 453 | .load_tlv => |pl| try writer.print("[tlv:{d}]", .{pl}), |
| 452 | 454 | .lea_tlv => |pl| try writer.print("tlv:{d}", .{pl}), |
| 453 | 455 | .load_frame => |pl| try writer.print("[{} + 0x{x}]", .{ pl.index, pl.off }), |
| ... | ... | @@ -475,8 +477,8 @@ const InstTracking = struct { |
| 475 | 477 | .lea_direct, |
| 476 | 478 | .load_got, |
| 477 | 479 | .lea_got, |
| 478 | | .load_actual_got, |
| 479 | | .lea_actual_got, |
| 480 | .load_extern_got, |
| 481 | .lea_extern_got, |
| 480 | 482 | .load_tlv, |
| 481 | 483 | .lea_tlv, |
| 482 | 484 | .load_frame, |
| ... | ... | @@ -536,8 +538,8 @@ const InstTracking = struct { |
| 536 | 538 | .lea_direct, |
| 537 | 539 | .load_got, |
| 538 | 540 | .lea_got, |
| 539 | | .load_actual_got, |
| 540 | | .lea_actual_got, |
| 541 | .load_extern_got, |
| 542 | .lea_extern_got, |
| 541 | 543 | .load_tlv, |
| 542 | 544 | .lea_tlv, |
| 543 | 545 | .load_frame, |
| ... | ... | @@ -573,8 +575,8 @@ const InstTracking = struct { |
| 573 | 575 | .lea_direct, |
| 574 | 576 | .load_got, |
| 575 | 577 | .lea_got, |
| 576 | | .load_actual_got, |
| 577 | | .lea_actual_got, |
| 578 | .load_extern_got, |
| 579 | .lea_extern_got, |
| 578 | 580 | .load_tlv, |
| 579 | 581 | .lea_tlv, |
| 580 | 582 | .lea_frame, |
| ... | ... | @@ -4391,7 +4393,7 @@ fn airArrayElemVal(self: *Self, inst: Air.Inst.Index) !void { |
| 4391 | 4393 | .memory, |
| 4392 | 4394 | .load_direct, |
| 4393 | 4395 | .load_got, |
| 4394 | | .load_actual_got, |
| 4396 | .load_extern_got, |
| 4395 | 4397 | .load_tlv, |
| 4396 | 4398 | => try self.genSetReg(addr_reg, Type.usize, array.address()), |
| 4397 | 4399 | .lea_direct, .lea_tlv => unreachable, |
| ... | ... | @@ -5872,7 +5874,7 @@ fn load(self: *Self, dst_mcv: MCValue, ptr_ty: Type, ptr_mcv: MCValue) InnerErro |
| 5872 | 5874 | .register_offset, |
| 5873 | 5875 | .lea_direct, |
| 5874 | 5876 | .lea_got, |
| 5875 | | .lea_actual_got, |
| 5877 | .lea_extern_got, |
| 5876 | 5878 | .lea_tlv, |
| 5877 | 5879 | .lea_frame, |
| 5878 | 5880 | => try self.genCopy(dst_ty, dst_mcv, ptr_mcv.deref()), |
| ... | ... | @@ -5880,7 +5882,7 @@ fn load(self: *Self, dst_mcv: MCValue, ptr_ty: Type, ptr_mcv: MCValue) InnerErro |
| 5880 | 5882 | .indirect, |
| 5881 | 5883 | .load_direct, |
| 5882 | 5884 | .load_got, |
| 5883 | | .load_actual_got, |
| 5885 | .load_extern_got, |
| 5884 | 5886 | .load_tlv, |
| 5885 | 5887 | .load_frame, |
| 5886 | 5888 | => { |
| ... | ... | @@ -6019,7 +6021,7 @@ fn store(self: *Self, ptr_ty: Type, ptr_mcv: MCValue, src_mcv: MCValue) InnerErr |
| 6019 | 6021 | .register_offset, |
| 6020 | 6022 | .lea_direct, |
| 6021 | 6023 | .lea_got, |
| 6022 | | .lea_actual_got, |
| 6024 | .lea_extern_got, |
| 6023 | 6025 | .lea_tlv, |
| 6024 | 6026 | .lea_frame, |
| 6025 | 6027 | => try self.genCopy(src_ty, ptr_mcv.deref(), src_mcv), |
| ... | ... | @@ -6027,7 +6029,7 @@ fn store(self: *Self, ptr_ty: Type, ptr_mcv: MCValue, src_mcv: MCValue) InnerErr |
| 6027 | 6029 | .indirect, |
| 6028 | 6030 | .load_direct, |
| 6029 | 6031 | .load_got, |
| 6030 | | .load_actual_got, |
| 6032 | .load_extern_got, |
| 6031 | 6033 | .load_tlv, |
| 6032 | 6034 | .load_frame, |
| 6033 | 6035 | => { |
| ... | ... | @@ -6449,7 +6451,7 @@ fn genUnOpMir(self: *Self, mir_tag: Mir.Inst.FixedTag, dst_ty: Type, dst_mcv: MC |
| 6449 | 6451 | .register_overflow, |
| 6450 | 6452 | .lea_direct, |
| 6451 | 6453 | .lea_got, |
| 6452 | | .lea_actual_got, |
| 6454 | .lea_extern_got, |
| 6453 | 6455 | .lea_tlv, |
| 6454 | 6456 | .lea_frame, |
| 6455 | 6457 | .reserved_frame, |
| ... | ... | @@ -6457,7 +6459,7 @@ fn genUnOpMir(self: *Self, mir_tag: Mir.Inst.FixedTag, dst_ty: Type, dst_mcv: MC |
| 6457 | 6459 | => unreachable, // unmodifiable destination |
| 6458 | 6460 | .register => |dst_reg| try self.asmRegister(mir_tag, registerAlias(dst_reg, abi_size)), |
| 6459 | 6461 | .register_pair => unreachable, // unimplemented |
| 6460 | | .memory, .load_got, .load_actual_got, .load_direct, .load_tlv => { |
| 6462 | .memory, .load_got, .load_extern_got, .load_direct, .load_tlv => { |
| 6461 | 6463 | const addr_reg = try self.register_manager.allocReg(null, abi.RegisterClass.gp); |
| 6462 | 6464 | const addr_reg_lock = self.register_manager.lockRegAssumeUnused(addr_reg); |
| 6463 | 6465 | defer self.register_manager.unlockReg(addr_reg_lock); |
| ... | ... | @@ -7415,8 +7417,8 @@ fn genBinOp( |
| 7415 | 7417 | .lea_direct, |
| 7416 | 7418 | .load_got, |
| 7417 | 7419 | .lea_got, |
| 7418 | | .load_actual_got, |
| 7419 | | .lea_actual_got, |
| 7420 | .load_extern_got, |
| 7421 | .lea_extern_got, |
| 7420 | 7422 | .load_tlv, |
| 7421 | 7423 | .lea_tlv, |
| 7422 | 7424 | .lea_frame, |
| ... | ... | @@ -7473,8 +7475,8 @@ fn genBinOp( |
| 7473 | 7475 | .lea_direct, |
| 7474 | 7476 | .load_got, |
| 7475 | 7477 | .lea_got, |
| 7476 | | .load_actual_got, |
| 7477 | | .lea_actual_got, |
| 7478 | .load_extern_got, |
| 7479 | .lea_extern_got, |
| 7478 | 7480 | .load_tlv, |
| 7479 | 7481 | .lea_tlv, |
| 7480 | 7482 | .lea_frame, |
| ... | ... | @@ -8427,7 +8429,7 @@ fn genBinOpMir( |
| 8427 | 8429 | .register_overflow, |
| 8428 | 8430 | .lea_direct, |
| 8429 | 8431 | .lea_got, |
| 8430 | | .lea_actual_got, |
| 8432 | .lea_extern_got, |
| 8431 | 8433 | .lea_tlv, |
| 8432 | 8434 | .lea_frame, |
| 8433 | 8435 | .reserved_frame, |
| ... | ... | @@ -8516,8 +8518,8 @@ fn genBinOpMir( |
| 8516 | 8518 | .lea_direct, |
| 8517 | 8519 | .load_got, |
| 8518 | 8520 | .lea_got, |
| 8519 | | .load_actual_got, |
| 8520 | | .lea_actual_got, |
| 8521 | .load_extern_got, |
| 8522 | .lea_extern_got, |
| 8521 | 8523 | .load_tlv, |
| 8522 | 8524 | .lea_tlv, |
| 8523 | 8525 | .load_frame, |
| ... | ... | @@ -8550,7 +8552,7 @@ fn genBinOpMir( |
| 8550 | 8552 | .register_offset, |
| 8551 | 8553 | .lea_direct, |
| 8552 | 8554 | .lea_got, |
| 8553 | | .lea_actual_got, |
| 8555 | .lea_extern_got, |
| 8554 | 8556 | .lea_tlv, |
| 8555 | 8557 | .lea_frame, |
| 8556 | 8558 | => { |
| ... | ... | @@ -8566,7 +8568,7 @@ fn genBinOpMir( |
| 8566 | 8568 | .memory, |
| 8567 | 8569 | .load_direct, |
| 8568 | 8570 | .load_got, |
| 8569 | | .load_actual_got, |
| 8571 | .load_extern_got, |
| 8570 | 8572 | .load_tlv, |
| 8571 | 8573 | => { |
| 8572 | 8574 | const ptr_ty = try mod.singleConstPtrType(ty); |
| ... | ... | @@ -8587,13 +8589,13 @@ fn genBinOpMir( |
| 8587 | 8589 | } |
| 8588 | 8590 | } |
| 8589 | 8591 | }, |
| 8590 | | .memory, .indirect, .load_got, .load_actual_got, .load_direct, .load_tlv, .load_frame => { |
| 8592 | .memory, .indirect, .load_got, .load_extern_got, .load_direct, .load_tlv, .load_frame => { |
| 8591 | 8593 | const OpInfo = ?struct { addr_reg: Register, addr_lock: RegisterLock }; |
| 8592 | 8594 | const limb_abi_size: u32 = @min(abi_size, 8); |
| 8593 | 8595 | |
| 8594 | 8596 | const dst_info: OpInfo = switch (dst_mcv) { |
| 8595 | 8597 | else => unreachable, |
| 8596 | | .memory, .load_got, .load_actual_got, .load_direct, .load_tlv => dst: { |
| 8598 | .memory, .load_got, .load_extern_got, .load_direct, .load_tlv => dst: { |
| 8597 | 8599 | const dst_addr_reg = |
| 8598 | 8600 | (try self.register_manager.allocReg(null, abi.RegisterClass.gp)).to64(); |
| 8599 | 8601 | const dst_addr_lock = self.register_manager.lockRegAssumeUnused(dst_addr_reg); |
| ... | ... | @@ -8627,17 +8629,17 @@ fn genBinOpMir( |
| 8627 | 8629 | .indirect, |
| 8628 | 8630 | .lea_direct, |
| 8629 | 8631 | .lea_got, |
| 8630 | | .lea_actual_got, |
| 8632 | .lea_extern_got, |
| 8631 | 8633 | .lea_tlv, |
| 8632 | 8634 | .load_frame, |
| 8633 | 8635 | .lea_frame, |
| 8634 | 8636 | => null, |
| 8635 | | .memory, .load_got, .load_actual_got, .load_direct, .load_tlv => src: { |
| 8637 | .memory, .load_got, .load_extern_got, .load_direct, .load_tlv => src: { |
| 8636 | 8638 | switch (resolved_src_mcv) { |
| 8637 | 8639 | .memory => |addr| if (math.cast(i32, @as(i64, @bitCast(addr))) != null and |
| 8638 | 8640 | math.cast(i32, @as(i64, @bitCast(addr)) + abi_size - limb_abi_size) != null) |
| 8639 | 8641 | break :src null, |
| 8640 | | .load_got, .load_actual_got, .load_direct, .load_tlv => {}, |
| 8642 | .load_got, .load_extern_got, .load_direct, .load_tlv => {}, |
| 8641 | 8643 | else => unreachable, |
| 8642 | 8644 | } |
| 8643 | 8645 | |
| ... | ... | @@ -8680,7 +8682,7 @@ fn genBinOpMir( |
| 8680 | 8682 | switch (dst_mcv) { |
| 8681 | 8683 | .memory, |
| 8682 | 8684 | .load_got, |
| 8683 | | .load_actual_got, |
| 8685 | .load_extern_got, |
| 8684 | 8686 | .load_direct, |
| 8685 | 8687 | .load_tlv, |
| 8686 | 8688 | => .{ .base = .{ .reg = dst_info.?.addr_reg }, .disp = off }, |
| ... | ... | @@ -8765,8 +8767,8 @@ fn genBinOpMir( |
| 8765 | 8767 | .lea_direct, |
| 8766 | 8768 | .load_got, |
| 8767 | 8769 | .lea_got, |
| 8768 | | .load_actual_got, |
| 8769 | | .lea_actual_got, |
| 8770 | .load_extern_got, |
| 8771 | .lea_extern_got, |
| 8770 | 8772 | .load_tlv, |
| 8771 | 8773 | .lea_tlv, |
| 8772 | 8774 | .load_frame, |
| ... | ... | @@ -8782,7 +8784,7 @@ fn genBinOpMir( |
| 8782 | 8784 | .register_offset, |
| 8783 | 8785 | .lea_direct, |
| 8784 | 8786 | .lea_got, |
| 8785 | | .lea_actual_got, |
| 8787 | .lea_extern_got, |
| 8786 | 8788 | .lea_tlv, |
| 8787 | 8789 | .lea_frame, |
| 8788 | 8790 | => switch (limb_i) { |
| ... | ... | @@ -8832,7 +8834,7 @@ fn genIntMulComplexOpMir(self: *Self, dst_ty: Type, dst_mcv: MCValue, src_mcv: M |
| 8832 | 8834 | .register_overflow, |
| 8833 | 8835 | .lea_direct, |
| 8834 | 8836 | .lea_got, |
| 8835 | | .lea_actual_got, |
| 8837 | .lea_extern_got, |
| 8836 | 8838 | .lea_tlv, |
| 8837 | 8839 | .lea_frame, |
| 8838 | 8840 | .reserved_frame, |
| ... | ... | @@ -8881,8 +8883,8 @@ fn genIntMulComplexOpMir(self: *Self, dst_ty: Type, dst_mcv: MCValue, src_mcv: M |
| 8881 | 8883 | .lea_direct, |
| 8882 | 8884 | .load_got, |
| 8883 | 8885 | .lea_got, |
| 8884 | | .load_actual_got, |
| 8885 | | .lea_actual_got, |
| 8886 | .load_extern_got, |
| 8887 | .lea_extern_got, |
| 8886 | 8888 | .load_tlv, |
| 8887 | 8889 | .lea_tlv, |
| 8888 | 8890 | .lea_frame, |
| ... | ... | @@ -8921,7 +8923,7 @@ fn genIntMulComplexOpMir(self: *Self, dst_ty: Type, dst_mcv: MCValue, src_mcv: M |
| 8921 | 8923 | } |
| 8922 | 8924 | }, |
| 8923 | 8925 | .register_pair => unreachable, // unimplemented |
| 8924 | | .memory, .indirect, .load_direct, .load_got, .load_actual_got, .load_tlv, .load_frame => { |
| 8926 | .memory, .indirect, .load_direct, .load_got, .load_extern_got, .load_tlv, .load_frame => { |
| 8925 | 8927 | const tmp_reg = try self.copyToTmpRegister(dst_ty, dst_mcv); |
| 8926 | 8928 | const tmp_mcv = MCValue{ .register = tmp_reg }; |
| 8927 | 8929 | const tmp_lock = self.register_manager.lockRegAssumeUnused(tmp_reg); |
| ... | ... | @@ -9014,7 +9016,7 @@ fn genVarDbgInfo( |
| 9014 | 9016 | //} }, |
| 9015 | 9017 | .memory => |address| .{ .memory = address }, |
| 9016 | 9018 | .load_got => |sym_index| .{ .linker_load = .{ .type = .got, .sym_index = sym_index } }, |
| 9017 | | .load_actual_got => |sym_index| .{ .linker_load = .{ .type = .actual_got, .sym_index = sym_index } }, |
| 9019 | .load_extern_got => |sym_index| .{ .linker_load = .{ .type = .extern_got, .sym_index = sym_index } }, |
| 9018 | 9020 | .load_direct => |sym_index| .{ .linker_load = .{ .type = .direct, .sym_index = sym_index } }, |
| 9019 | 9021 | .immediate => |x| .{ .immediate = x }, |
| 9020 | 9022 | .undef => .undef, |
| ... | ... | @@ -9454,14 +9456,14 @@ fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void { |
| 9454 | 9456 | .indirect, |
| 9455 | 9457 | .lea_direct, |
| 9456 | 9458 | .lea_got, |
| 9457 | | .lea_actual_got, |
| 9459 | .lea_extern_got, |
| 9458 | 9460 | .lea_tlv, |
| 9459 | 9461 | .lea_frame, |
| 9460 | 9462 | .reserved_frame, |
| 9461 | 9463 | .air_ref, |
| 9462 | 9464 | => unreachable, |
| 9463 | 9465 | .register_pair, .load_frame => null, |
| 9464 | | .memory, .load_got, .load_actual_got, .load_direct, .load_tlv => dst: { |
| 9466 | .memory, .load_got, .load_extern_got, .load_direct, .load_tlv => dst: { |
| 9465 | 9467 | switch (resolved_dst_mcv) { |
| 9466 | 9468 | .memory => |addr| if (math.cast( |
| 9467 | 9469 | i32, |
| ... | ... | @@ -9470,7 +9472,7 @@ fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void { |
| 9470 | 9472 | i32, |
| 9471 | 9473 | @as(i64, @bitCast(addr)) + abi_size - 8, |
| 9472 | 9474 | ) != null) break :dst null, |
| 9473 | | .load_got, .load_actual_got, .load_direct, .load_tlv => {}, |
| 9475 | .load_got, .load_extern_got, .load_direct, .load_tlv => {}, |
| 9474 | 9476 | else => unreachable, |
| 9475 | 9477 | } |
| 9476 | 9478 | |
| ... | ... | @@ -9513,14 +9515,14 @@ fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void { |
| 9513 | 9515 | .indirect, |
| 9514 | 9516 | .lea_direct, |
| 9515 | 9517 | .lea_got, |
| 9516 | | .lea_actual_got, |
| 9518 | .lea_extern_got, |
| 9517 | 9519 | .lea_tlv, |
| 9518 | 9520 | .lea_frame, |
| 9519 | 9521 | .reserved_frame, |
| 9520 | 9522 | .air_ref, |
| 9521 | 9523 | => unreachable, |
| 9522 | 9524 | .register_pair, .load_frame => null, |
| 9523 | | .memory, .load_got, .load_actual_got, .load_direct, .load_tlv => src: { |
| 9525 | .memory, .load_got, .load_extern_got, .load_direct, .load_tlv => src: { |
| 9524 | 9526 | switch (resolved_src_mcv) { |
| 9525 | 9527 | .memory => |addr| if (math.cast( |
| 9526 | 9528 | i32, |
| ... | ... | @@ -9529,7 +9531,7 @@ fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void { |
| 9529 | 9531 | i32, |
| 9530 | 9532 | @as(i64, @bitCast(addr)) + abi_size - 8, |
| 9531 | 9533 | ) != null) break :src null, |
| 9532 | | .load_got, .load_actual_got, .load_direct, .load_tlv => {}, |
| 9534 | .load_got, .load_extern_got, .load_direct, .load_tlv => {}, |
| 9533 | 9535 | else => unreachable, |
| 9534 | 9536 | } |
| 9535 | 9537 | |
| ... | ... | @@ -9948,7 +9950,7 @@ fn isNull(self: *Self, inst: Air.Inst.Index, opt_ty: Type, opt_mcv: MCValue) !MC |
| 9948 | 9950 | .register_overflow, |
| 9949 | 9951 | .lea_direct, |
| 9950 | 9952 | .lea_got, |
| 9951 | | .lea_actual_got, |
| 9953 | .lea_extern_got, |
| 9952 | 9954 | .lea_tlv, |
| 9953 | 9955 | .lea_frame, |
| 9954 | 9956 | .reserved_frame, |
| ... | ... | @@ -9975,7 +9977,7 @@ fn isNull(self: *Self, inst: Air.Inst.Index, opt_ty: Type, opt_mcv: MCValue) !MC |
| 9975 | 9977 | |
| 9976 | 9978 | .memory, |
| 9977 | 9979 | .load_got, |
| 9978 | | .load_actual_got, |
| 9980 | .load_extern_got, |
| 9979 | 9981 | .load_direct, |
| 9980 | 9982 | .load_tlv, |
| 9981 | 9983 | => { |
| ... | ... | @@ -10533,7 +10535,7 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { |
| 10533 | 10535 | .memory => |addr| if (math.cast(i32, @as(i64, @bitCast(addr)))) |_| |
| 10534 | 10536 | break :arg input_mcv, |
| 10535 | 10537 | .indirect, .load_frame => break :arg input_mcv, |
| 10536 | | .load_direct, .load_got, .load_actual_got, .load_tlv => {}, |
| 10538 | .load_direct, .load_got, .load_extern_got, .load_tlv => {}, |
| 10537 | 10539 | else => { |
| 10538 | 10540 | const temp_mcv = try self.allocTempRegOrMem(ty, false); |
| 10539 | 10541 | try self.genCopy(ty, temp_mcv, input_mcv); |
| ... | ... | @@ -11194,7 +11196,7 @@ fn genCopy(self: *Self, ty: Type, dst_mcv: MCValue, src_mcv: MCValue) InnerError |
| 11194 | 11196 | .register_overflow, |
| 11195 | 11197 | .lea_direct, |
| 11196 | 11198 | .lea_got, |
| 11197 | | .lea_actual_got, |
| 11199 | .lea_extern_got, |
| 11198 | 11200 | .lea_tlv, |
| 11199 | 11201 | .lea_frame, |
| 11200 | 11202 | .reserved_frame, |
| ... | ... | @@ -11246,11 +11248,11 @@ fn genCopy(self: *Self, ty: Type, dst_mcv: MCValue, src_mcv: MCValue) InnerError |
| 11246 | 11248 | } |
| 11247 | 11249 | }, |
| 11248 | 11250 | .indirect => |reg_off| try self.genSetMem(.{ .reg = reg_off.reg }, reg_off.off, ty, src_mcv), |
| 11249 | | .memory, .load_direct, .load_got, .load_actual_got, .load_tlv => { |
| 11251 | .memory, .load_direct, .load_got, .load_extern_got, .load_tlv => { |
| 11250 | 11252 | switch (dst_mcv) { |
| 11251 | 11253 | .memory => |addr| if (math.cast(i32, @as(i64, @bitCast(addr)))) |small_addr| |
| 11252 | 11254 | return self.genSetMem(.{ .reg = .ds }, small_addr, ty, src_mcv), |
| 11253 | | .load_direct, .load_got, .load_actual_got, .load_tlv => {}, |
| 11255 | .load_direct, .load_got, .load_extern_got, .load_tlv => {}, |
| 11254 | 11256 | else => unreachable, |
| 11255 | 11257 | } |
| 11256 | 11258 | |
| ... | ... | @@ -11412,7 +11414,7 @@ fn genSetReg(self: *Self, dst_reg: Register, ty: Type, src_mcv: MCValue) InnerEr |
| 11412 | 11414 | else => unreachable, |
| 11413 | 11415 | }, |
| 11414 | 11416 | )), |
| 11415 | | .memory, .load_direct, .load_got, .load_actual_got, .load_tlv => { |
| 11417 | .memory, .load_direct, .load_got, .load_extern_got, .load_tlv => { |
| 11416 | 11418 | switch (src_mcv) { |
| 11417 | 11419 | .memory => |addr| if (math.cast(i32, @as(i64, @bitCast(addr)))) |small_addr| |
| 11418 | 11420 | return (try self.moveStrategy( |
| ... | ... | @@ -11440,7 +11442,7 @@ fn genSetReg(self: *Self, dst_reg: Register, ty: Type, src_mcv: MCValue) InnerEr |
| 11440 | 11442 | }, |
| 11441 | 11443 | .Float, .Vector => {}, |
| 11442 | 11444 | }, |
| 11443 | | .load_got, .load_actual_got, .load_tlv => {}, |
| 11445 | .load_got, .load_extern_got, .load_tlv => {}, |
| 11444 | 11446 | else => unreachable, |
| 11445 | 11447 | } |
| 11446 | 11448 | |
| ... | ... | @@ -11454,18 +11456,18 @@ fn genSetReg(self: *Self, dst_reg: Register, ty: Type, src_mcv: MCValue) InnerEr |
| 11454 | 11456 | Memory.sib(Memory.PtrSize.fromSize(abi_size), .{ .base = .{ .reg = addr_reg } }), |
| 11455 | 11457 | ); |
| 11456 | 11458 | }, |
| 11457 | | .lea_direct, .lea_got, .lea_actual_got => |sym_index| { |
| 11459 | .lea_direct, .lea_got, .lea_extern_got => |sym_index| { |
| 11458 | 11460 | const atom_index = try self.owner.getSymbolIndex(self); |
| 11459 | 11461 | _ = try self.addInst(.{ |
| 11460 | 11462 | .tag = switch (src_mcv) { |
| 11461 | 11463 | .lea_direct => .lea, |
| 11462 | | .lea_got, .lea_actual_got => .mov, |
| 11464 | .lea_got, .lea_extern_got => .mov, |
| 11463 | 11465 | else => unreachable, |
| 11464 | 11466 | }, |
| 11465 | 11467 | .ops = switch (src_mcv) { |
| 11466 | 11468 | .lea_direct => .direct_reloc, |
| 11467 | 11469 | .lea_got => .got_reloc, |
| 11468 | | .lea_actual_got => .actual_got_reloc, |
| 11470 | .lea_extern_got => .extern_got_reloc, |
| 11469 | 11471 | else => unreachable, |
| 11470 | 11472 | }, |
| 11471 | 11473 | .data = .{ .rx = .{ |
| ... | ... | @@ -11601,8 +11603,8 @@ fn genSetMem(self: *Self, base: Memory.Base, disp: i32, ty: Type, src_mcv: MCVal |
| 11601 | 11603 | .lea_direct, |
| 11602 | 11604 | .load_got, |
| 11603 | 11605 | .lea_got, |
| 11604 | | .load_actual_got, |
| 11605 | | .lea_actual_got, |
| 11606 | .load_extern_got, |
| 11607 | .lea_extern_got, |
| 11606 | 11608 | .load_tlv, |
| 11607 | 11609 | .lea_tlv, |
| 11608 | 11610 | .load_frame, |
| ... | ... | @@ -13608,7 +13610,7 @@ fn genTypedValue(self: *Self, arg_tv: TypedValue) InnerError!MCValue { |
| 13608 | 13610 | .memory => |addr| .{ .memory = addr }, |
| 13609 | 13611 | .load_direct => |sym_index| .{ .load_direct = sym_index }, |
| 13610 | 13612 | .load_got => |sym_index| .{ .lea_got = sym_index }, |
| 13611 | | .load_actual_got => |sym_index| .{ .lea_actual_got = sym_index }, |
| 13613 | .load_extern_got => |sym_index| .{ .lea_extern_got = sym_index }, |
| 13612 | 13614 | .load_tlv => |sym_index| .{ .lea_tlv = sym_index }, |
| 13613 | 13615 | }, |
| 13614 | 13616 | .fail => |msg| { |