| author | |
| committer | |
| log | 8c06a8dc8fde05e8c6619a51977862c1062756ed |
| tree | 22b1a9f93d1c0ab3d20a0870badcc73f3a5d89c5 |
| parent | 0d31d7e2fc4f66ecd8cf37dfa17534f348db83dd |
| signature | Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM |
8 files changed, 17 insertions(+), 1 deletions(-)
lib/std/Target.zig+2| ... | ... | @@ -1961,9 +1961,11 @@ pub const Cpu = struct { |
| 1961 | 1961 | => &.{.lanai}, |
| 1962 | 1962 | |
| 1963 | 1963 | .loongarch64_lp64, |
| 1964 | .loongarch64_preserve_none, | |
| 1964 | 1965 | => &.{.loongarch64}, |
| 1965 | 1966 | |
| 1966 | 1967 | .loongarch32_ilp32, |
| 1968 | .loongarch32_preserve_none, | |
| 1967 | 1969 | => &.{.loongarch32}, |
| 1968 | 1970 | |
| 1969 | 1971 | .m68k_sysv, |
lib/std/lang.zig+2| ... | ... | @@ -322,9 +322,11 @@ pub const CallingConvention = union(enum(u8)) { |
| 322 | 322 | |
| 323 | 323 | /// The standard `loongarch64` calling convention. |
| 324 | 324 | loongarch64_lp64: CommonOptions, |
| 325 | loongarch64_preserve_none: CommonOptions, | |
| 325 | 326 | |
| 326 | 327 | /// The standard `loongarch32` calling convention. |
| 327 | 328 | loongarch32_ilp32: CommonOptions, |
| 329 | loongarch32_preserve_none: CommonOptions, | |
| 328 | 330 | |
| 329 | 331 | // Calling conventions for the `m68k` architecture. |
| 330 | 332 | m68k_sysv: CommonOptions, |
src/Zcu.zig+2| ... | ... | @@ -4711,6 +4711,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum) |
| 4711 | 4711 | .avr_interrupt, |
| 4712 | 4712 | .avr_signal, |
| 4713 | 4713 | .ez80_tiflags, |
| 4714 | .loongarch32_preserve_none, | |
| 4715 | .loongarch64_preserve_none, | |
| 4714 | 4716 | .naked, |
| 4715 | 4717 | => true, // incoming stack alignment supported |
| 4716 | 4718 |
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| ... | ... | @@ -4341,6 +4341,8 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const |
| 4341 | 4341 | .amdgcn_cs => .amdgpu_cs, |
| 4342 | 4342 | .nvptx_device => .ptx_device, |
| 4343 | 4343 | .nvptx_kernel => .ptx_kernel, |
| 4344 | .loongarch32_preserve_none => .preserve_nonecc, | |
| 4345 | .loongarch64_preserve_none => .preserve_nonecc, | |
| 4344 | 4346 | |
| 4345 | 4347 | // Calling conventions which LLVM uses function attributes for. |
| 4346 | 4348 | .riscv64_interrupt, |
src/link/Dwarf.zig+3| ... | ... | @@ -4189,6 +4189,9 @@ fn updateConstInner(dwarf: *Dwarf, pt: Zcu.PerThread, debug_const_index: link.Co |
| 4189 | 4189 | .riscv32_ilp32_v, |
| 4190 | 4190 | => .LLVM_RISCVVectorCall, |
| 4191 | 4191 | |
| 4192 | .loongarch32_preserve_none => .LLVM_PreserveNone, | |
| 4193 | .loongarch64_preserve_none => .LLVM_PreserveNone, | |
| 4194 | ||
| 4192 | 4195 | .m68k_rtd => .LLVM_M68kRTD, |
| 4193 | 4196 | |
| 4194 | 4197 | .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 |