Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement new interrupt calling conventions in the llvm backend #21807

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Rexicon226
Copy link
Contributor

closes #20671
closes #21805

anyone know of other issues this closes?

adds support for:

  • riscv64_interrupt
  • riscv32_interrupt
  • mips_interrupt
  • mips64_interrupt
  • arm_interrupt
  • csky_interrupt

@alexrp
Copy link
Member

alexrp commented Oct 26, 2024

#16635 can maybe also be closed? Though not as a result of this PR specifically.

.value = .empty,
} }, &o.builder);
},
.csky_interrupt => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could merge this with the prong above? Doesn't really matter though.

@alexrp alexrp requested a review from mlugg October 26, 2024 09:37
std.builtin.CallingConvention.X86RegparmOptions => .{ pl.incoming_stack_alignment, pl.register_params },
else => unreachable,
else => @compileError("TODO: toLlvmCallConv" ++ @tagName(pl)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: don't try and be too fancy, comptime unreachable is fine :^)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah fair enough, I just needed to see which callconv was the one I hadn't handled yet and I'm lazy. would you like me to use comptime unreachable here instead?

Copy link
Member

@mlugg mlugg Oct 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to change it, but it's not a problem, just thought I'd mention

Comment on lines +3109 to +3118
inline .avr_interrupt, .avr_signal => |_, tag| {
try attributes.addFnAttr(.{ .string = .{
.kind = try o.builder.string(switch (tag) {
.avr_interrupt => "interrupt",
.avr_signal => "signal",
else => unreachable,
}),
.value = .empty,
} }, &o.builder);
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use inline unnecessarily:

Suggested change
inline .avr_interrupt, .avr_signal => |_, tag| {
try attributes.addFnAttr(.{ .string = .{
.kind = try o.builder.string(switch (tag) {
.avr_interrupt => "interrupt",
.avr_signal => "signal",
else => unreachable,
}),
.value = .empty,
} }, &o.builder);
},
.avr_interrupt, .avr_signal => {
try attributes.addFnAttr(.{ .string = .{
.kind = try o.builder.string(switch (fn_info.cc) {
.avr_interrupt => "interrupt",
.avr_signal => "signal",
else => unreachable,
}),
.value = .empty,
} }, &o.builder);
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants