| author | |
| committer | |
| log | 1a760bedc5acbad2cadb36f5cd8412035c64383b |
| tree | 42d2dc460343b23a3cc856ba406884ca5278f912 |
| parent | 41709c9b386178d3e85d874fd38920bb0ac80371 |
| signature |
8 files changed, 17 insertions(+), 1 deletions(-)
lib/std/Target.zig+2| ... | ... | @@ -1952,9 +1952,11 @@ pub const Cpu = struct { |
| 1952 | 1952 | => &.{.lanai}, |
| 1953 | 1953 | |
| 1954 | 1954 | .loongarch64_lp64, |
| 1955 | .loongarch64_preserve_none, | |
| 1955 | 1956 | => &.{.loongarch64}, |
| 1956 | 1957 | |
| 1957 | 1958 | .loongarch32_ilp32, |
| 1959 | .loongarch32_preserve_none, | |
| 1958 | 1960 | => &.{.loongarch32}, |
| 1959 | 1961 | |
| 1960 | 1962 | .m68k_sysv, |
lib/std/lang.zig+2| ... | ... | @@ -324,9 +324,11 @@ pub const CallingConvention = union(enum(u8)) { |
| 324 | 324 | |
| 325 | 325 | /// The standard `loongarch64` calling convention. |
| 326 | 326 | loongarch64_lp64: CommonOptions, |
| 327 | loongarch64_preserve_none: CommonOptions, | |
| 327 | 328 | |
| 328 | 329 | /// The standard `loongarch32` calling convention. |
| 329 | 330 | loongarch32_ilp32: CommonOptions, |
| 331 | loongarch32_preserve_none: CommonOptions, | |
| 330 | 332 | |
| 331 | 333 | // Calling conventions for the `m68k` architecture. |
| 332 | 334 | m68k_sysv: CommonOptions, |
src/Zcu.zig+2| ... | ... | @@ -4621,6 +4621,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum) |
| 4621 | 4621 | .avr_interrupt, |
| 4622 | 4622 | .avr_signal, |
| 4623 | 4623 | .ez80_tiflags, |
| 4624 | .loongarch32_preserve_none, | |
| 4625 | .loongarch64_preserve_none, | |
| 4624 | 4626 | .naked, |
| 4625 | 4627 | => true, // incoming stack alignment supported |
| 4626 | 4628 |
src/codegen/c/type.zig+2| ... | ... | @@ -142,6 +142,8 @@ pub const CType = union(enum) { |
| 142 | 142 | |
| 143 | 143 | .x86_64_preserve_none, |
| 144 | 144 | .aarch64_preserve_none, |
| 145 | .loongarch32_preserve_none, | |
| 146 | .loongarch64_preserve_none, | |
| 145 | 147 | => .preserve_none, |
| 146 | 148 | |
| 147 | 149 | .aarch64_vfabi => .aarch64_vector_pcs, |
src/codegen/llvm.zig+2| ... | ... | @@ -4307,6 +4307,8 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const |
| 4307 | 4307 | .amdgcn_cs => .amdgpu_cs, |
| 4308 | 4308 | .nvptx_device => .ptx_device, |
| 4309 | 4309 | .nvptx_kernel => .ptx_kernel, |
| 4310 | .loongarch32_preserve_none => .preserve_nonecc, | |
| 4311 | .loongarch64_preserve_none => .preserve_nonecc, | |
| 4310 | 4312 | |
| 4311 | 4313 | // Calling conventions which LLVM uses function attributes for. |
| 4312 | 4314 | .riscv64_interrupt, |
src/link/Dwarf.zig+3| ... | ... | @@ -4175,6 +4175,9 @@ fn updateConstInner(dwarf: *Dwarf, pt: Zcu.PerThread, debug_const_index: link.Co |
| 4175 | 4175 | .riscv32_ilp32_v, |
| 4176 | 4176 | => .LLVM_RISCVVectorCall, |
| 4177 | 4177 | |
| 4178 | .loongarch32_preserve_none => .LLVM_PreserveNone, | |
| 4179 | .loongarch64_preserve_none => .LLVM_PreserveNone, | |
| 4180 | ||
| 4178 | 4181 | .m68k_rtd => .LLVM_M68kRTD, |
| 4179 | 4182 | |
| 4180 | 4183 | .sh_renesas => .GNU_renesas_sh, |
test/c_abi/cfuncs.c+1-1| ... | ... | @@ -16624,7 +16624,7 @@ struct ByRef __attribute__((sysv_abi)) c_explict_sys_v(struct ByRef in) { |
| 16624 | 16624 | } |
| 16625 | 16625 | #endif |
| 16626 | 16626 | |
| 16627 | #if defined __x86_64__ || defined __aarch64__ | |
| 16627 | #if defined __x86_64__ || defined __aarch64__ || defined __loongarch__ | |
| 16628 | 16628 | int __attribute__((preserve_none)) c_preserve_none(int x) { |
| 16629 | 16629 | return x + 1; |
| 16630 | 16630 | } |
test/c_abi/main.zig+3| ... | ... | @@ -18045,6 +18045,9 @@ const preserve_none_cc: ?std.lang.CallingConvention = if (builtin.zig_backend != |
| 18045 | 18045 | else switch (builtin.cpu.arch) { |
| 18046 | 18046 | .x86_64 => .{ .x86_64_preserve_none = .{} }, |
| 18047 | 18047 | .aarch64, .aarch64_be => .{ .aarch64_preserve_none = .{} }, |
| 18048 | // Supported in LLVM but not yet wired up in Clang. | |
| 18049 | // .loongarch32 => .{ .loongarch32_preserve_none = .{} }, | |
| 18050 | // .loongarch64 => .{ .loongarch64_preserve_none = .{} }, | |
| 18048 | 18051 | else => null, |
| 18049 | 18052 | }; |
| 18050 | 18053 |