| ... | @@ -394,7 +394,11 @@ fn gen(self: *Self) !void { | ... | @@ -394,7 +394,11 @@ fn gen(self: *Self) !void { |
| 394 | }, | 394 | }, |
| 395 | }); | 395 | }); |
| 396 | | 396 | |
| 397 | // TODO Find a way to fill this slot | 397 | // Branches in SPARC have a delay slot, that is, the instruction |
| | 398 | // following it will unconditionally be executed. |
| | 399 | // See: Section 3.2.3 Control Transfer in SPARCv9 manual. |
| | 400 | // See also: https://arcb.csc.ncsu.edu/~mueller/codeopt/codeopt00/notes/delaybra.html |
| | 401 | // TODO Find a way to fill this delay slot |
| 398 | // nop | 402 | // nop |
| 399 | _ = try self.addInst(.{ | 403 | _ = try self.addInst(.{ |
| 400 | .tag = .nop, | 404 | .tag = .nop, |
| ... | @@ -895,6 +899,12 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. | ... | @@ -895,6 +899,12 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 895 | }, | 899 | }, |
| 896 | }, | 900 | }, |
| 897 | }); | 901 | }); |
| | 902 | |
| | 903 | // TODO Find a way to fill this delay slot |
| | 904 | _ = try self.addInst(.{ |
| | 905 | .tag = .nop, |
| | 906 | .data = .{ .nop = {} }, |
| | 907 | }); |
| 898 | } else if (func_value.castTag(.extern_fn)) |_| { | 908 | } else if (func_value.castTag(.extern_fn)) |_| { |
| 899 | return self.fail("TODO implement calling extern functions", .{}); | 909 | return self.fail("TODO implement calling extern functions", .{}); |
| 900 | } else { | 910 | } else { |
| ... | @@ -917,6 +927,12 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. | ... | @@ -917,6 +927,12 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 917 | }, | 927 | }, |
| 918 | }, | 928 | }, |
| 919 | }); | 929 | }); |
| | 930 | |
| | 931 | // TODO Find a way to fill this delay slot |
| | 932 | _ = try self.addInst(.{ |
| | 933 | .tag = .nop, |
| | 934 | .data = .{ .nop = {} }, |
| | 935 | }); |
| 920 | } | 936 | } |
| 921 | | 937 | |
| 922 | const result = info.return_value; | 938 | const result = info.return_value; |