| author | |
| committer | |
| log | 5b90bb103fa81de79d64033707fe16748240a7a0 |
| tree | 3acbca0ba52a8fe25a732c0b75f6b2929631d7aa |
| parent | 3ed34b112f9e8039216ae9afdda2fc81b8eb3cb7 |
| signature |
8 files changed, 17 insertions(+), 1 deletions(-)
lib/std/Target.zig+2| ... | @@ -1952,9 +1952,11 @@ pub const Cpu = struct { | ... | @@ -1952,9 +1952,11 @@ pub const Cpu = struct { |
| 1952 | => &.{.lanai}, | 1952 | => &.{.lanai}, |
| 1953 | 1953 | ||
| 1954 | .loongarch64_lp64, | 1954 | .loongarch64_lp64, |
| 1955 | .loongarch64_preserve_none, | ||
| 1955 | => &.{.loongarch64}, | 1956 | => &.{.loongarch64}, |
| 1956 | 1957 | ||
| 1957 | .loongarch32_ilp32, | 1958 | .loongarch32_ilp32, |
| 1959 | .loongarch32_preserve_none, | ||
| 1958 | => &.{.loongarch32}, | 1960 | => &.{.loongarch32}, |
| 1959 | 1961 | ||
| 1960 | .m68k_sysv, | 1962 | .m68k_sysv, |
lib/std/lang.zig+2| ... | @@ -324,9 +324,11 @@ pub const CallingConvention = union(enum(u8)) { | ... | @@ -324,9 +324,11 @@ pub const CallingConvention = union(enum(u8)) { |
| 324 | 324 | ||
| 325 | /// The standard `loongarch64` calling convention. | 325 | /// The standard `loongarch64` calling convention. |
| 326 | loongarch64_lp64: CommonOptions, | 326 | loongarch64_lp64: CommonOptions, |
| 327 | loongarch64_preserve_none: CommonOptions, | ||
| 327 | 328 | ||
| 328 | /// The standard `loongarch32` calling convention. | 329 | /// The standard `loongarch32` calling convention. |
| 329 | loongarch32_ilp32: CommonOptions, | 330 | loongarch32_ilp32: CommonOptions, |
| 331 | loongarch32_preserve_none: CommonOptions, | ||
| 330 | 332 | ||
| 331 | // Calling conventions for the `m68k` architecture. | 333 | // Calling conventions for the `m68k` architecture. |
| 332 | m68k_sysv: CommonOptions, | 334 | m68k_sysv: CommonOptions, |
src/Zcu.zig+2| ... | @@ -4628,6 +4628,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum) | ... | @@ -4628,6 +4628,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum) |
| 4628 | .avr_interrupt, | 4628 | .avr_interrupt, |
| 4629 | .avr_signal, | 4629 | .avr_signal, |
| 4630 | .ez80_tiflags, | 4630 | .ez80_tiflags, |
| 4631 | .loongarch32_preserve_none, | ||
| 4632 | .loongarch64_preserve_none, | ||
| 4631 | .naked, | 4633 | .naked, |
| 4632 | => true, // incoming stack alignment supported | 4634 | => true, // incoming stack alignment supported |
| 4633 | 4635 |
src/codegen/c/type.zig+2| ... | @@ -142,6 +142,8 @@ pub const CType = union(enum) { | ... | @@ -142,6 +142,8 @@ pub const CType = union(enum) { |
| 142 | 142 | ||
| 143 | .x86_64_preserve_none, | 143 | .x86_64_preserve_none, |
| 144 | .aarch64_preserve_none, | 144 | .aarch64_preserve_none, |
| 145 | .loongarch32_preserve_none, | ||
| 146 | .loongarch64_preserve_none, | ||
| 145 | => .preserve_none, | 147 | => .preserve_none, |
| 146 | 148 | ||
| 147 | .aarch64_vfabi => .aarch64_vector_pcs, | 149 | .aarch64_vfabi => .aarch64_vector_pcs, |
src/codegen/llvm.zig+2| ... | @@ -4305,6 +4305,8 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const | ... | @@ -4305,6 +4305,8 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const |
| 4305 | .amdgcn_cs => .amdgpu_cs, | 4305 | .amdgcn_cs => .amdgpu_cs, |
| 4306 | .nvptx_device => .ptx_device, | 4306 | .nvptx_device => .ptx_device, |
| 4307 | .nvptx_kernel => .ptx_kernel, | 4307 | .nvptx_kernel => .ptx_kernel, |
| 4308 | .loongarch32_preserve_none => .preserve_nonecc, | ||
| 4309 | .loongarch64_preserve_none => .preserve_nonecc, | ||
| 4308 | 4310 | ||
| 4309 | // Calling conventions which LLVM uses function attributes for. | 4311 | // Calling conventions which LLVM uses function attributes for. |
| 4310 | .riscv64_interrupt, | 4312 | .riscv64_interrupt, |
src/link/Dwarf.zig+3| ... | @@ -4188,6 +4188,9 @@ fn updateConstInner(dwarf: *Dwarf, pt: Zcu.PerThread, debug_const_index: link.Co | ... | @@ -4188,6 +4188,9 @@ fn updateConstInner(dwarf: *Dwarf, pt: Zcu.PerThread, debug_const_index: link.Co |
| 4188 | .riscv32_ilp32_v, | 4188 | .riscv32_ilp32_v, |
| 4189 | => .LLVM_RISCVVectorCall, | 4189 | => .LLVM_RISCVVectorCall, |
| 4190 | 4190 | ||
| 4191 | .loongarch32_preserve_none => .LLVM_PreserveNone, | ||
| 4192 | .loongarch64_preserve_none => .LLVM_PreserveNone, | ||
| 4193 | |||
| 4191 | .m68k_rtd => .LLVM_M68kRTD, | 4194 | .m68k_rtd => .LLVM_M68kRTD, |
| 4192 | 4195 | ||
| 4193 | .sh_renesas => .GNU_renesas_sh, | 4196 | .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,7 +16624,7 @@ struct ByRef __attribute__((sysv_abi)) c_explict_sys_v(struct ByRef in) { |
| 16624 | } | 16624 | } |
| 16625 | #endif | 16625 | #endif |
| 16626 | 16626 | ||
| 16627 | #if defined __x86_64__ || defined __aarch64__ | 16627 | #if defined __x86_64__ || defined __aarch64__ || defined __loongarch__ |
| 16628 | int __attribute__((preserve_none)) c_preserve_none(int x) { | 16628 | int __attribute__((preserve_none)) c_preserve_none(int x) { |
| 16629 | return x + 1; | 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,6 +18045,9 @@ const preserve_none_cc: ?std.lang.CallingConvention = if (builtin.zig_backend != |
| 18045 | else switch (builtin.cpu.arch) { | 18045 | else switch (builtin.cpu.arch) { |
| 18046 | .x86_64 => .{ .x86_64_preserve_none = .{} }, | 18046 | .x86_64 => .{ .x86_64_preserve_none = .{} }, |
| 18047 | .aarch64, .aarch64_be => .{ .aarch64_preserve_none = .{} }, | 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 | else => null, | 18051 | else => null, |
| 18049 | }; | 18052 | }; |
| 18050 | 18053 |