authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2022-10-07 21:24:44+03:30
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2022-11-04 00:09:27+03:30
logf5f1f8c66625237e4eceb3cd40597a687e9a58ac
tree913632d097ffcdeea739da3a2f9b5b023e0ba81c
parent678f3f6e65e8808520973912fb6c4d7dbca189fe

all: rename i386 to x86


67 files changed, 587 insertions(+), 587 deletions(-)

doc/langref.html.in+6-6
...@@ -5126,7 +5126,7 @@ const builtin = @import("builtin");...@@ -5126,7 +5126,7 @@ const builtin = @import("builtin");
5126const native_arch = builtin.cpu.arch;5126const native_arch = builtin.cpu.arch;
5127const expect = std.testing.expect;5127const expect = std.testing.expect;
51285128
5129const WINAPI: std.builtin.CallingConvention = if (native_arch == .i386) .Stdcall else .C;5129const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86) .Stdcall else .C;
5130extern "kernel32" fn ExitProcess(exit_code: c_uint) callconv(WINAPI) noreturn;5130extern "kernel32" fn ExitProcess(exit_code: c_uint) callconv(WINAPI) noreturn;
51315131
5132test "foo" {5132test "foo" {
...@@ -5165,7 +5165,7 @@ export fn sub(a: i8, b: i8) i8 { return a - b; }...@@ -5165,7 +5165,7 @@ export fn sub(a: i8, b: i8) i8 { return a - b; }
5165// at link time, when linking statically, or at runtime, when linking5165// at link time, when linking statically, or at runtime, when linking
5166// dynamically.5166// dynamically.
5167// The callconv specifier changes the calling convention of the function.5167// The callconv specifier changes the calling convention of the function.
5168const WINAPI: std.builtin.CallingConvention = if (native_arch == .i386) .Stdcall else .C;5168const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86) .Stdcall else .C;
5169extern "kernel32" fn ExitProcess(exit_code: u32) callconv(WINAPI) noreturn;5169extern "kernel32" fn ExitProcess(exit_code: u32) callconv(WINAPI) noreturn;
5170extern "c" fn atan2(a: f64, b: f64) f64;5170extern "c" fn atan2(a: f64, b: f64) f64;
51715171
...@@ -7487,7 +7487,7 @@ volatile (...@@ -7487,7 +7487,7 @@ volatile (
7487 : "rcx", "r11"7487 : "rcx", "r11"
7488);{#end_syntax_block#}7488);{#end_syntax_block#}
7489 <p>7489 <p>
7490 For i386 and x86_64 targets, the syntax is AT&amp;T syntax, rather than the more7490 For x86 and x86_64 targets, the syntax is AT&amp;T syntax, rather than the more
7491 popular Intel syntax. This is due to technical constraints; assembly parsing is7491 popular Intel syntax. This is due to technical constraints; assembly parsing is
7492 provided by LLVM and its support for Intel syntax is buggy and not well tested.7492 provided by LLVM and its support for Intel syntax is buggy and not well tested.
7493 </p>7493 </p>
...@@ -11608,7 +11608,7 @@ Architectures:...@@ -11608,7 +11608,7 @@ Architectures:
11608 v511608 v5
11609 v5te11609 v5te
11610 v4t11610 v4t
11611 i38611611 x86
11612 x86_64 (native)11612 x86_64 (native)
11613 xcore11613 xcore
11614 nvptx11614 nvptx
...@@ -11687,8 +11687,8 @@ Available libcs:...@@ -11687,8 +11687,8 @@ Available libcs:
11687 arm-linux-gnueabihf11687 arm-linux-gnueabihf
11688 arm-linux-musleabi11688 arm-linux-musleabi
11689 arm-linux-musleabihf11689 arm-linux-musleabihf
11690 i386-linux-gnu11690 x86-linux-gnu
11691 i386-linux-musl11691 x86-linux-musl
11692 mips64el-linux-gnuabi6411692 mips64el-linux-gnuabi64
11693 mips64el-linux-gnuabin3211693 mips64el-linux-gnuabin32
11694 mips64el-linux-musl11694 mips64el-linux-musl
lib/c.zig+1-1
...@@ -190,7 +190,7 @@ test "strncmp" {...@@ -190,7 +190,7 @@ test "strncmp" {
190// across .o file boundaries. fix comptime @ptrCast of nakedcc functions.190// across .o file boundaries. fix comptime @ptrCast of nakedcc functions.
191fn clone() callconv(.Naked) void {191fn clone() callconv(.Naked) void {
192 switch (native_arch) {192 switch (native_arch) {
193 .i386 => {193 .x86 => {
194 // __clone(func, stack, flags, arg, ptid, tls, ctid)194 // __clone(func, stack, flags, arg, ptid, tls, ctid)
195 // +8, +12, +16, +20, +24, +28, +32195 // +8, +12, +16, +20, +24, +28, +32
196 // syscall(SYS_clone, flags, stack, ptid, tls, ctid)196 // syscall(SYS_clone, flags, stack, ptid, tls, ctid)
lib/compiler_rt/aulldiv.zig+1-1
...@@ -7,7 +7,7 @@ const common = @import("common.zig");...@@ -7,7 +7,7 @@ const common = @import("common.zig");
7pub const panic = common.panic;7pub const panic = common.panic;
88
9comptime {9comptime {
10 if (arch == .i386 and abi == .msvc) {10 if (arch == .x86 and abi == .msvc) {
11 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins11 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins
12 @export(_alldiv, .{ .name = "\x01__alldiv", .linkage = common.linkage });12 @export(_alldiv, .{ .name = "\x01__alldiv", .linkage = common.linkage });
13 @export(_aulldiv, .{ .name = "\x01__aulldiv", .linkage = common.linkage });13 @export(_aulldiv, .{ .name = "\x01__aulldiv", .linkage = common.linkage });
lib/compiler_rt/aullrem.zig+1-1
...@@ -7,7 +7,7 @@ const common = @import("common.zig");...@@ -7,7 +7,7 @@ const common = @import("common.zig");
7pub const panic = common.panic;7pub const panic = common.panic;
88
9comptime {9comptime {
10 if (arch == .i386 and abi == .msvc) {10 if (arch == .x86 and abi == .msvc) {
11 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins11 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins
12 @export(_allrem, .{ .name = "\x01__allrem", .linkage = common.linkage });12 @export(_allrem, .{ .name = "\x01__allrem", .linkage = common.linkage });
13 @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = common.linkage });13 @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = common.linkage });
lib/compiler_rt/clear_cache.zig+1-1
...@@ -17,7 +17,7 @@ comptime {...@@ -17,7 +17,7 @@ comptime {
1717
18fn clear_cache(start: usize, end: usize) callconv(.C) void {18fn clear_cache(start: usize, end: usize) callconv(.C) void {
19 const x86 = switch (arch) {19 const x86 = switch (arch) {
20 .i386, .x86_64 => true,20 .x86, .x86_64 => true,
21 else => false,21 else => false,
22 };22 };
23 const arm32 = switch (arch) {23 const arm32 = switch (arch) {
lib/compiler_rt/common.zig+2-2
...@@ -48,7 +48,7 @@ pub const gnu_f16_abi = switch (builtin.cpu.arch) {...@@ -48,7 +48,7 @@ pub const gnu_f16_abi = switch (builtin.cpu.arch) {
48 .x86_64,48 .x86_64,
49 => false,49 => false,
5050
51 .i386 => true,51 .x86 => true,
5252
53 .arm, .armeb, .thumb, .thumbeb => switch (builtin.abi) {53 .arm, .armeb, .thumb, .thumbeb => switch (builtin.abi) {
54 .eabi, .eabihf => false,54 .eabi, .eabihf => false,
...@@ -79,7 +79,7 @@ pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace, _: ?...@@ -79,7 +79,7 @@ pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace, _: ?
79pub const F16T = switch (builtin.cpu.arch) {79pub const F16T = switch (builtin.cpu.arch) {
80 .aarch64, .aarch64_be, .aarch64_32 => f16,80 .aarch64, .aarch64_be, .aarch64_32 => f16,
81 .riscv64 => if (builtin.zig_backend == .stage1) u16 else f16,81 .riscv64 => if (builtin.zig_backend == .stage1) u16 else f16,
82 .i386, .x86_64 => f16,82 .x86, .x86_64 => f16,
83 else => u16,83 else => u16,
84};84};
8585
lib/compiler_rt/divti3.zig+1-1
...@@ -9,7 +9,7 @@ pub const panic = common.panic;...@@ -9,7 +9,7 @@ pub const panic = common.panic;
9comptime {9comptime {
10 if (builtin.os.tag == .windows) {10 if (builtin.os.tag == .windows) {
11 switch (arch) {11 switch (arch) {
12 .i386 => {12 .x86 => {
13 @export(__divti3, .{ .name = "__divti3", .linkage = common.linkage });13 @export(__divti3, .{ .name = "__divti3", .linkage = common.linkage });
14 },14 },
15 .x86_64 => {15 .x86_64 => {
lib/compiler_rt/extendf_test.zig+1-1
...@@ -140,7 +140,7 @@ test "extendhfsf2" {...@@ -140,7 +140,7 @@ test "extendhfsf2" {
140 try test__extendhfsf2(0x7f00, 0x7fe00000); // sNaN140 try test__extendhfsf2(0x7f00, 0x7fe00000); // sNaN
141 // On x86 the NaN becomes quiet because the return is pushed on the x87141 // On x86 the NaN becomes quiet because the return is pushed on the x87
142 // stack due to ABI requirements142 // stack due to ABI requirements
143 if (builtin.target.cpu.arch != .i386 and builtin.target.os.tag == .windows)143 if (builtin.target.cpu.arch != .x86 and builtin.target.os.tag == .windows)
144 try test__extendhfsf2(0x7c01, 0x7f802000); // sNaN144 try test__extendhfsf2(0x7c01, 0x7f802000); // sNaN
145145
146 try test__extendhfsf2(0, 0); // 0146 try test__extendhfsf2(0, 0); // 0
lib/compiler_rt/stack_probe.zig+5-5
...@@ -30,7 +30,7 @@ comptime {...@@ -30,7 +30,7 @@ comptime {
30 }30 }
3131
32 switch (arch) {32 switch (arch) {
33 .i386,33 .x86,
34 .x86_64,34 .x86_64,
35 => {35 => {
36 @export(zig_probe_stack, .{ .name = "__zig_probe_stack", .linkage = linkage });36 @export(zig_probe_stack, .{ .name = "__zig_probe_stack", .linkage = linkage });
...@@ -69,7 +69,7 @@ pub fn zig_probe_stack() callconv(.Naked) void {...@@ -69,7 +69,7 @@ pub fn zig_probe_stack() callconv(.Naked) void {
69 \\ ret69 \\ ret
70 );70 );
71 },71 },
72 .i386 => {72 .x86 => {
73 // %eax = probe length, %esp = stack pointer73 // %eax = probe length, %esp = stack pointer
74 asm volatile (74 asm volatile (
75 \\ push %%ecx75 \\ push %%ecx
...@@ -121,7 +121,7 @@ fn win_probe_stack_only() void {...@@ -121,7 +121,7 @@ fn win_probe_stack_only() void {
121 \\ ret121 \\ ret
122 );122 );
123 },123 },
124 .i386 => {124 .x86 => {
125 asm volatile (125 asm volatile (
126 \\ push %%ecx126 \\ push %%ecx
127 \\ push %%eax127 \\ push %%eax
...@@ -191,7 +191,7 @@ fn win_probe_stack_adjust_sp() void {...@@ -191,7 +191,7 @@ fn win_probe_stack_adjust_sp() void {
191 \\ ret191 \\ ret
192 );192 );
193 },193 },
194 .i386 => {194 .x86 => {
195 asm volatile (195 asm volatile (
196 \\ push %%ecx196 \\ push %%ecx
197 \\ cmp $0x1000,%%eax197 \\ cmp $0x1000,%%eax
...@@ -243,7 +243,7 @@ pub fn __chkstk() callconv(.Naked) void {...@@ -243,7 +243,7 @@ pub fn __chkstk() callconv(.Naked) void {
243 if (comptime arch.isAARCH64()) {243 if (comptime arch.isAARCH64()) {
244 @call(.{ .modifier = .always_inline }, win_probe_stack_only, .{});244 @call(.{ .modifier = .always_inline }, win_probe_stack_only, .{});
245 } else switch (arch) {245 } else switch (arch) {
246 .i386 => @call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{}),246 .x86 => @call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{}),
247 .x86_64 => @call(.{ .modifier = .always_inline }, win_probe_stack_only, .{}),247 .x86_64 => @call(.{ .modifier = .always_inline }, win_probe_stack_only, .{}),
248 else => unreachable,248 else => unreachable,
249 }249 }
lib/libc/glibc/abilists
Binary files a/lib/libc/glibc/abilists and b/lib/libc/glibc/abilists differ
lib/ssp.zig+1-1
...@@ -35,7 +35,7 @@ export fn __chk_fail() callconv(.C) noreturn {...@@ -35,7 +35,7 @@ export fn __chk_fail() callconv(.C) noreturn {
35 @panic("buffer overflow detected");35 @panic("buffer overflow detected");
36}36}
3737
38// Emitted when targeting some architectures (eg. i386)38// Emitted when targeting some architectures (eg. x86)
39// XXX: This symbol should be hidden39// XXX: This symbol should be hidden
40export fn __stack_chk_fail_local() callconv(.C) noreturn {40export fn __stack_chk_fail_local() callconv(.C) noreturn {
41 __stack_chk_fail();41 __stack_chk_fail();
lib/std/Thread.zig+4-4
...@@ -753,7 +753,7 @@ const LinuxThreadImpl = struct {...@@ -753,7 +753,7 @@ const LinuxThreadImpl = struct {
753 /// https://github.com/ifduyue/musl/search?q=__unmapself753 /// https://github.com/ifduyue/musl/search?q=__unmapself
754 fn freeAndExit(self: *ThreadCompletion) noreturn {754 fn freeAndExit(self: *ThreadCompletion) noreturn {
755 switch (target.cpu.arch) {755 switch (target.cpu.arch) {
756 .i386 => asm volatile (756 .x86 => asm volatile (
757 \\ movl $91, %%eax757 \\ movl $91, %%eax
758 \\ movl %[ptr], %%ebx758 \\ movl %[ptr], %%ebx
759 \\ movl %[len], %%ecx759 \\ movl %[len], %%ecx
...@@ -959,10 +959,10 @@ const LinuxThreadImpl = struct {...@@ -959,10 +959,10 @@ const LinuxThreadImpl = struct {
959 else => |e| return e,959 else => |e| return e,
960 };960 };
961961
962 // Prepare the TLS segment and prepare a user_desc struct when needed on i386962 // Prepare the TLS segment and prepare a user_desc struct when needed on x86
963 var tls_ptr = os.linux.tls.prepareTLS(mapped[tls_offset..]);963 var tls_ptr = os.linux.tls.prepareTLS(mapped[tls_offset..]);
964 var user_desc: if (target.cpu.arch == .i386) os.linux.user_desc else void = undefined;964 var user_desc: if (target.cpu.arch == .x86) os.linux.user_desc else void = undefined;
965 if (target.cpu.arch == .i386) {965 if (target.cpu.arch == .x86) {
966 defer tls_ptr = @ptrToInt(&user_desc);966 defer tls_ptr = @ptrToInt(&user_desc);
967 user_desc = .{967 user_desc = .{
968 .entry_number = os.linux.tls.tls_image.gdt_entry_number,968 .entry_number = os.linux.tls.tls_image.gdt_entry_number,
lib/std/atomic.zig+1-1
...@@ -44,7 +44,7 @@ pub inline fn spinLoopHint() void {...@@ -44,7 +44,7 @@ pub inline fn spinLoopHint() void {
44 // No-op instruction that can hint to save (or share with a hardware-thread)44 // No-op instruction that can hint to save (or share with a hardware-thread)
45 // pipelining/power resources45 // pipelining/power resources
46 // https://software.intel.com/content/www/us/en/develop/articles/benefitting-power-and-performance-sleep-loops.html46 // https://software.intel.com/content/www/us/en/develop/articles/benefitting-power-and-performance-sleep-loops.html
47 .i386, .x86_64 => asm volatile ("pause" ::: "memory"),47 .x86, .x86_64 => asm volatile ("pause" ::: "memory"),
4848
49 // No-op instruction that serves as a hardware-thread resource yield hint.49 // No-op instruction that serves as a hardware-thread resource yield hint.
50 // https://stackoverflow.com/a/758894150 // https://stackoverflow.com/a/7588941
lib/std/build.zig+2-2
...@@ -2978,12 +2978,12 @@ pub const LibExeObjStep = struct {...@@ -2978,12 +2978,12 @@ pub const LibExeObjStep = struct {
2978 if (glibc_dir_arg) |dir| {2978 if (glibc_dir_arg) |dir| {
2979 // TODO look into making this a call to `linuxTriple`. This2979 // TODO look into making this a call to `linuxTriple`. This
2980 // needs the directory to be called "i686" rather than2980 // needs the directory to be called "i686" rather than
2981 // "i386" which is why we do it manually here.2981 // "x86" which is why we do it manually here.
2982 const fmt_str = "{s}" ++ fs.path.sep_str ++ "{s}-{s}-{s}";2982 const fmt_str = "{s}" ++ fs.path.sep_str ++ "{s}-{s}-{s}";
2983 const cpu_arch = self.target.getCpuArch();2983 const cpu_arch = self.target.getCpuArch();
2984 const os_tag = self.target.getOsTag();2984 const os_tag = self.target.getOsTag();
2985 const abi = self.target.getAbi();2985 const abi = self.target.getAbi();
2986 const cpu_arch_name: []const u8 = if (cpu_arch == .i386)2986 const cpu_arch_name: []const u8 = if (cpu_arch == .x86)
2987 "i686"2987 "i686"
2988 else2988 else
2989 @tagName(cpu_arch);2989 @tagName(cpu_arch);
lib/std/build/EmulatableRunStep.zig+2-2
...@@ -95,12 +95,12 @@ fn make(step: *Step) !void {...@@ -95,12 +95,12 @@ fn make(step: *Step) !void {
95 if (glibc_dir_arg) |dir| {95 if (glibc_dir_arg) |dir| {
96 // TODO look into making this a call to `linuxTriple`. This96 // TODO look into making this a call to `linuxTriple`. This
97 // needs the directory to be called "i686" rather than97 // needs the directory to be called "i686" rather than
98 // "i386" which is why we do it manually here.98 // "x86" which is why we do it manually here.
99 const fmt_str = "{s}" ++ fs.path.sep_str ++ "{s}-{s}-{s}";99 const fmt_str = "{s}" ++ fs.path.sep_str ++ "{s}-{s}-{s}";
100 const cpu_arch = self.exe.target.getCpuArch();100 const cpu_arch = self.exe.target.getCpuArch();
101 const os_tag = self.exe.target.getOsTag();101 const os_tag = self.exe.target.getOsTag();
102 const abi = self.exe.target.getAbi();102 const abi = self.exe.target.getAbi();
103 const cpu_arch_name: []const u8 = if (cpu_arch == .i386)103 const cpu_arch_name: []const u8 = if (cpu_arch == .x86)
104 "i686"104 "i686"
105 else105 else
106 @tagName(cpu_arch);106 @tagName(cpu_arch);
lib/std/c/freebsd.zig+1-1
...@@ -1444,7 +1444,7 @@ pub const E = enum(u16) {...@@ -1444,7 +1444,7 @@ pub const E = enum(u16) {
1444};1444};
14451445
1446pub const MINSIGSTKSZ = switch (builtin.cpu.arch) {1446pub const MINSIGSTKSZ = switch (builtin.cpu.arch) {
1447 .i386, .x86_64 => 2048,1447 .x86, .x86_64 => 2048,
1448 .arm, .aarch64 => 4096,1448 .arm, .aarch64 => 4096,
1449 else => @compileError("MINSIGSTKSZ not defined for this architecture"),1449 else => @compileError("MINSIGSTKSZ not defined for this architecture"),
1450};1450};
lib/std/c/netbsd.zig+4-4
...@@ -80,7 +80,7 @@ pub const pthread_cond_t = extern struct {...@@ -80,7 +80,7 @@ pub const pthread_cond_t = extern struct {
80pub const pthread_rwlock_t = extern struct {80pub const pthread_rwlock_t = extern struct {
81 magic: c_uint = 0x99990009,81 magic: c_uint = 0x99990009,
82 interlock: switch (builtin.cpu.arch) {82 interlock: switch (builtin.cpu.arch) {
83 .aarch64, .sparc, .x86_64, .i386 => u8,83 .aarch64, .sparc, .x86_64, .x86 => u8,
84 .arm, .powerpc => c_int,84 .arm, .powerpc => c_int,
85 else => unreachable,85 else => unreachable,
86 } = 0,86 } = 0,
...@@ -97,7 +97,7 @@ const pthread_spin_t = switch (builtin.cpu.arch) {...@@ -97,7 +97,7 @@ const pthread_spin_t = switch (builtin.cpu.arch) {
97 .aarch64, .aarch64_be, .aarch64_32 => u8,97 .aarch64, .aarch64_be, .aarch64_32 => u8,
98 .mips, .mipsel, .mips64, .mips64el => u32,98 .mips, .mipsel, .mips64, .mips64el => u32,
99 .powerpc, .powerpc64, .powerpc64le => i32,99 .powerpc, .powerpc64, .powerpc64le => i32,
100 .i386, .x86_64 => u8,100 .x86, .x86_64 => u8,
101 .arm, .armeb, .thumb, .thumbeb => i32,101 .arm, .armeb, .thumb, .thumbeb => i32,
102 .sparc, .sparcel, .sparc64 => u8,102 .sparc, .sparcel, .sparc64 => u8,
103 .riscv32, .riscv64 => u32,103 .riscv32, .riscv64 => u32,
...@@ -105,7 +105,7 @@ const pthread_spin_t = switch (builtin.cpu.arch) {...@@ -105,7 +105,7 @@ const pthread_spin_t = switch (builtin.cpu.arch) {
105};105};
106106
107const padded_pthread_spin_t = switch (builtin.cpu.arch) {107const padded_pthread_spin_t = switch (builtin.cpu.arch) {
108 .i386, .x86_64 => u32,108 .x86, .x86_64 => u32,
109 .sparc, .sparcel, .sparc64 => u32,109 .sparc, .sparcel, .sparc64 => u32,
110 else => pthread_spin_t,110 else => pthread_spin_t,
111};111};
...@@ -1067,7 +1067,7 @@ pub const ucontext_t = extern struct {...@@ -1067,7 +1067,7 @@ pub const ucontext_t = extern struct {
1067 mcontext: mcontext_t,1067 mcontext: mcontext_t,
1068 __pad: [1068 __pad: [
1069 switch (builtin.cpu.arch) {1069 switch (builtin.cpu.arch) {
1070 .i386 => 4,1070 .x86 => 4,
1071 .mips, .mipsel, .mips64, .mips64el => 14,1071 .mips, .mipsel, .mips64, .mips64el => 14,
1072 .arm, .armeb, .thumb, .thumbeb => 1,1072 .arm, .armeb, .thumb, .thumbeb => 1,
1073 .sparc, .sparcel, .sparc64 => if (@sizeOf(usize) == 4) 43 else 8,1073 .sparc, .sparcel, .sparc64 => if (@sizeOf(usize) == 4) 43 else 8,
lib/std/c/openbsd.zig+1-1
...@@ -1247,7 +1247,7 @@ pub const E = enum(u16) {...@@ -1247,7 +1247,7 @@ pub const E = enum(u16) {
1247};1247};
12481248
1249const _MAX_PAGE_SHIFT = switch (builtin.cpu.arch) {1249const _MAX_PAGE_SHIFT = switch (builtin.cpu.arch) {
1250 .i386 => 12,1250 .x86 => 12,
1251 .sparc64 => 13,1251 .sparc64 => 13,
1252};1252};
1253pub const MINSIGSTKSZ = 1 << _MAX_PAGE_SHIFT;1253pub const MINSIGSTKSZ = 1 << _MAX_PAGE_SHIFT;
lib/std/coff.zig+2-2
...@@ -1025,7 +1025,7 @@ pub const MachineType = enum(u16) {...@@ -1025,7 +1025,7 @@ pub const MachineType = enum(u16) {
1025 .powerpc => .POWERPC,1025 .powerpc => .POWERPC,
1026 .riscv32 => .RISCV32,1026 .riscv32 => .RISCV32,
1027 .thumb => .Thumb,1027 .thumb => .Thumb,
1028 .i386 => .I386,1028 .x86 => .I386,
1029 .aarch64 => .ARM64,1029 .aarch64 => .ARM64,
1030 .riscv64 => .RISCV64,1030 .riscv64 => .RISCV64,
1031 .x86_64 => .X64,1031 .x86_64 => .X64,
...@@ -1040,7 +1040,7 @@ pub const MachineType = enum(u16) {...@@ -1040,7 +1040,7 @@ pub const MachineType = enum(u16) {
1040 .POWERPC => .powerpc,1040 .POWERPC => .powerpc,
1041 .RISCV32 => .riscv32,1041 .RISCV32 => .riscv32,
1042 .Thumb => .thumb,1042 .Thumb => .thumb,
1043 .I386 => .i386,1043 .I386 => .x86,
1044 .ARM64 => .aarch64,1044 .ARM64 => .aarch64,
1045 .RISCV64 => .riscv64,1045 .RISCV64 => .riscv64,
1046 .X64 => .x86_64,1046 .X64 => .x86_64,
lib/std/debug.zig+3-3
...@@ -182,7 +182,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void {...@@ -182,7 +182,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void {
182 // therefore, we do a check for `return_address == 0` before subtracting 1 from it to avoid182 // therefore, we do a check for `return_address == 0` before subtracting 1 from it to avoid
183 // an overflow. We do not need to signal `StackIterator` as it will correctly detect this183 // an overflow. We do not need to signal `StackIterator` as it will correctly detect this
184 // condition on the subsequent iteration and return `null` thus terminating the loop.184 // condition on the subsequent iteration and return `null` thus terminating the loop.
185 // same behaviour for i386-windows-msvc185 // same behaviour for x86-windows-msvc
186 const address = if (return_address == 0) return_address else return_address - 1;186 const address = if (return_address == 0) return_address else return_address - 1;
187 printSourceAtAddress(debug_info, stderr, address, tty_config) catch return;187 printSourceAtAddress(debug_info, stderr, address, tty_config) catch return;
188 }188 }
...@@ -568,7 +568,7 @@ pub fn writeCurrentStackTrace(...@@ -568,7 +568,7 @@ pub fn writeCurrentStackTrace(
568 // therefore, we do a check for `return_address == 0` before subtracting 1 from it to avoid568 // therefore, we do a check for `return_address == 0` before subtracting 1 from it to avoid
569 // an overflow. We do not need to signal `StackIterator` as it will correctly detect this569 // an overflow. We do not need to signal `StackIterator` as it will correctly detect this
570 // condition on the subsequent iteration and return `null` thus terminating the loop.570 // condition on the subsequent iteration and return `null` thus terminating the loop.
571 // same behaviour for i386-windows-msvc571 // same behaviour for x86-windows-msvc
572 const address = if (return_address == 0) return_address else return_address - 1;572 const address = if (return_address == 0) return_address else return_address - 1;
573 try printSourceAtAddress(debug_info, out_stream, address, tty_config);573 try printSourceAtAddress(debug_info, out_stream, address, tty_config);
574 }574 }
...@@ -1922,7 +1922,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any...@@ -1922,7 +1922,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any
1922 }1922 }
19231923
1924 switch (native_arch) {1924 switch (native_arch) {
1925 .i386 => {1925 .x86 => {
1926 const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr));1926 const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr));
1927 const ip = @intCast(usize, ctx.mcontext.gregs[os.REG.EIP]);1927 const ip = @intCast(usize, ctx.mcontext.gregs[os.REG.EIP]);
1928 const bp = @intCast(usize, ctx.mcontext.gregs[os.REG.EBP]);1928 const bp = @intCast(usize, ctx.mcontext.gregs[os.REG.EBP]);
lib/std/elf.zig+1-1
...@@ -1502,7 +1502,7 @@ pub const EM = enum(u16) {...@@ -1502,7 +1502,7 @@ pub const EM = enum(u16) {
1502 .MIPS_RS3_LE => .mipsel,1502 .MIPS_RS3_LE => .mipsel,
1503 .PPC => .powerpc,1503 .PPC => .powerpc,
1504 .SPARC => .sparc,1504 .SPARC => .sparc,
1505 .@"386" => .i386,1505 .@"386" => .x86,
1506 .XCORE => .xcore,1506 .XCORE => .xcore,
1507 .CSR_KALIMBA => .kalimba,1507 .CSR_KALIMBA => .kalimba,
1508 .LANAI => .lanai,1508 .LANAI => .lanai,
lib/std/macho.zig+2-2
...@@ -1201,7 +1201,7 @@ pub const MH_DEAD_STRIPPABLE_DYLIB = 0x400000;...@@ -1201,7 +1201,7 @@ pub const MH_DEAD_STRIPPABLE_DYLIB = 0x400000;
1201/// Contains a section of type S_THREAD_LOCAL_VARIABLES1201/// Contains a section of type S_THREAD_LOCAL_VARIABLES
1202pub const MH_HAS_TLV_DESCRIPTORS = 0x800000;1202pub const MH_HAS_TLV_DESCRIPTORS = 0x800000;
12031203
1204/// When this bit is set, the OS will run the main executable with a non-executable heap even on platforms (e.g. i386) that don't require it. Only used in MH_EXECUTE filetypes.1204/// When this bit is set, the OS will run the main executable with a non-executable heap even on platforms (e.g. x86) that don't require it. Only used in MH_EXECUTE filetypes.
1205pub const MH_NO_HEAP_EXECUTION = 0x1000000;1205pub const MH_NO_HEAP_EXECUTION = 0x1000000;
12061206
1207/// The code was linked for use in an application extension.1207/// The code was linked for use in an application extension.
...@@ -1444,7 +1444,7 @@ pub const S_ATTR_NO_DEAD_STRIP = 0x10000000;...@@ -1444,7 +1444,7 @@ pub const S_ATTR_NO_DEAD_STRIP = 0x10000000;
1444/// blocks are live if they reference live blocks1444/// blocks are live if they reference live blocks
1445pub const S_ATTR_LIVE_SUPPORT = 0x8000000;1445pub const S_ATTR_LIVE_SUPPORT = 0x8000000;
14461446
1447/// used with i386 code stubs written on by dyld1447/// used with x86 code stubs written on by dyld
1448pub const S_ATTR_SELF_MODIFYING_CODE = 0x4000000;1448pub const S_ATTR_SELF_MODIFYING_CODE = 0x4000000;
14491449
1450/// section contains some machine instructions1450/// section contains some machine instructions
lib/std/os/linux.zig+22-22
...@@ -33,7 +33,7 @@ const syscall_bits = switch (native_arch) {...@@ -33,7 +33,7 @@ const syscall_bits = switch (native_arch) {
33};33};
3434
35const arch_bits = switch (native_arch) {35const arch_bits = switch (native_arch) {
36 .i386 => @import("linux/i386.zig"),36 .x86 => @import("linux/x86.zig"),
37 .x86_64 => @import("linux/x86_64.zig"),37 .x86_64 => @import("linux/x86_64.zig"),
38 .aarch64 => @import("linux/arm64.zig"),38 .aarch64 => @import("linux/arm64.zig"),
39 .arm, .thumb => @import("linux/arm-eabi.zig"),39 .arm, .thumb => @import("linux/arm-eabi.zig"),
...@@ -94,7 +94,7 @@ pub const SECCOMP = @import("linux/seccomp.zig");...@@ -94,7 +94,7 @@ pub const SECCOMP = @import("linux/seccomp.zig");
9494
95pub const syscalls = @import("linux/syscalls.zig");95pub const syscalls = @import("linux/syscalls.zig");
96pub const SYS = switch (@import("builtin").cpu.arch) {96pub const SYS = switch (@import("builtin").cpu.arch) {
97 .i386 => syscalls.X86,97 .x86 => syscalls.X86,
98 .x86_64 => syscalls.X64,98 .x86_64 => syscalls.X64,
99 .aarch64 => syscalls.Arm64,99 .aarch64 => syscalls.Arm64,
100 .arm, .thumb => syscalls.Arm,100 .arm, .thumb => syscalls.Arm,
...@@ -1198,42 +1198,42 @@ pub fn sigismember(set: *const sigset_t, sig: u6) bool {...@@ -1198,42 +1198,42 @@ pub fn sigismember(set: *const sigset_t, sig: u6) bool {
1198}1198}
11991199
1200pub fn getsockname(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {1200pub fn getsockname(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {
1201 if (native_arch == .i386) {1201 if (native_arch == .x86) {
1202 return socketcall(SC.getsockname, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });1202 return socketcall(SC.getsockname, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });
1203 }1203 }
1204 return syscall3(.getsockname, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));1204 return syscall3(.getsockname, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));
1205}1205}
12061206
1207pub fn getpeername(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {1207pub fn getpeername(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {
1208 if (native_arch == .i386) {1208 if (native_arch == .x86) {
1209 return socketcall(SC.getpeername, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });1209 return socketcall(SC.getpeername, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });
1210 }1210 }
1211 return syscall3(.getpeername, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));1211 return syscall3(.getpeername, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));
1212}1212}
12131213
1214pub fn socket(domain: u32, socket_type: u32, protocol: u32) usize {1214pub fn socket(domain: u32, socket_type: u32, protocol: u32) usize {
1215 if (native_arch == .i386) {1215 if (native_arch == .x86) {
1216 return socketcall(SC.socket, &[3]usize{ domain, socket_type, protocol });1216 return socketcall(SC.socket, &[3]usize{ domain, socket_type, protocol });
1217 }1217 }
1218 return syscall3(.socket, domain, socket_type, protocol);1218 return syscall3(.socket, domain, socket_type, protocol);
1219}1219}
12201220
1221pub fn setsockopt(fd: i32, level: u32, optname: u32, optval: [*]const u8, optlen: socklen_t) usize {1221pub fn setsockopt(fd: i32, level: u32, optname: u32, optval: [*]const u8, optlen: socklen_t) usize {
1222 if (native_arch == .i386) {1222 if (native_arch == .x86) {
1223 return socketcall(SC.setsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen) });1223 return socketcall(SC.setsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen) });
1224 }1224 }
1225 return syscall5(.setsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen));1225 return syscall5(.setsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen));
1226}1226}
12271227
1228pub fn getsockopt(fd: i32, level: u32, optname: u32, noalias optval: [*]u8, noalias optlen: *socklen_t) usize {1228pub fn getsockopt(fd: i32, level: u32, optname: u32, noalias optval: [*]u8, noalias optlen: *socklen_t) usize {
1229 if (native_arch == .i386) {1229 if (native_arch == .x86) {
1230 return socketcall(SC.getsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen) });1230 return socketcall(SC.getsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen) });
1231 }1231 }
1232 return syscall5(.getsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen));1232 return syscall5(.getsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen));
1233}1233}
12341234
1235pub fn sendmsg(fd: i32, msg: *const std.x.os.Socket.Message, flags: c_int) usize {1235pub fn sendmsg(fd: i32, msg: *const std.x.os.Socket.Message, flags: c_int) usize {
1236 if (native_arch == .i386) {1236 if (native_arch == .x86) {
1237 return socketcall(SC.sendmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)) });1237 return socketcall(SC.sendmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)) });
1238 }1238 }
1239 return syscall3(.sendmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)));1239 return syscall3(.sendmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)));
...@@ -1280,49 +1280,49 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize...@@ -1280,49 +1280,49 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize
1280}1280}
12811281
1282pub fn connect(fd: i32, addr: *const anyopaque, len: socklen_t) usize {1282pub fn connect(fd: i32, addr: *const anyopaque, len: socklen_t) usize {
1283 if (native_arch == .i386) {1283 if (native_arch == .x86) {
1284 return socketcall(SC.connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len });1284 return socketcall(SC.connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len });
1285 }1285 }
1286 return syscall3(.connect, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len);1286 return syscall3(.connect, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len);
1287}1287}
12881288
1289pub fn recvmsg(fd: i32, msg: *std.x.os.Socket.Message, flags: c_int) usize {1289pub fn recvmsg(fd: i32, msg: *std.x.os.Socket.Message, flags: c_int) usize {
1290 if (native_arch == .i386) {1290 if (native_arch == .x86) {
1291 return socketcall(SC.recvmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)) });1291 return socketcall(SC.recvmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)) });
1292 }1292 }
1293 return syscall3(.recvmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)));1293 return syscall3(.recvmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), @bitCast(usize, @as(isize, flags)));
1294}1294}
12951295
1296pub fn recvfrom(fd: i32, noalias buf: [*]u8, len: usize, flags: u32, noalias addr: ?*sockaddr, noalias alen: ?*socklen_t) usize {1296pub fn recvfrom(fd: i32, noalias buf: [*]u8, len: usize, flags: u32, noalias addr: ?*sockaddr, noalias alen: ?*socklen_t) usize {
1297 if (native_arch == .i386) {1297 if (native_arch == .x86) {
1298 return socketcall(SC.recvfrom, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen) });1298 return socketcall(SC.recvfrom, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen) });
1299 }1299 }
1300 return syscall6(.recvfrom, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen));1300 return syscall6(.recvfrom, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen));
1301}1301}
13021302
1303pub fn shutdown(fd: i32, how: i32) usize {1303pub fn shutdown(fd: i32, how: i32) usize {
1304 if (native_arch == .i386) {1304 if (native_arch == .x86) {
1305 return socketcall(SC.shutdown, &[2]usize{ @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)) });1305 return socketcall(SC.shutdown, &[2]usize{ @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)) });
1306 }1306 }
1307 return syscall2(.shutdown, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)));1307 return syscall2(.shutdown, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)));
1308}1308}
13091309
1310pub fn bind(fd: i32, addr: *const sockaddr, len: socklen_t) usize {1310pub fn bind(fd: i32, addr: *const sockaddr, len: socklen_t) usize {
1311 if (native_arch == .i386) {1311 if (native_arch == .x86) {
1312 return socketcall(SC.bind, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len) });1312 return socketcall(SC.bind, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len) });
1313 }1313 }
1314 return syscall3(.bind, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len));1314 return syscall3(.bind, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len));
1315}1315}
13161316
1317pub fn listen(fd: i32, backlog: u32) usize {1317pub fn listen(fd: i32, backlog: u32) usize {
1318 if (native_arch == .i386) {1318 if (native_arch == .x86) {
1319 return socketcall(SC.listen, &[2]usize{ @bitCast(usize, @as(isize, fd)), backlog });1319 return socketcall(SC.listen, &[2]usize{ @bitCast(usize, @as(isize, fd)), backlog });
1320 }1320 }
1321 return syscall2(.listen, @bitCast(usize, @as(isize, fd)), backlog);1321 return syscall2(.listen, @bitCast(usize, @as(isize, fd)), backlog);
1322}1322}
13231323
1324pub fn sendto(fd: i32, buf: [*]const u8, len: usize, flags: u32, addr: ?*const sockaddr, alen: socklen_t) usize {1324pub fn sendto(fd: i32, buf: [*]const u8, len: usize, flags: u32, addr: ?*const sockaddr, alen: socklen_t) usize {
1325 if (native_arch == .i386) {1325 if (native_arch == .x86) {
1326 return socketcall(SC.sendto, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen) });1326 return socketcall(SC.sendto, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen) });
1327 }1327 }
1328 return syscall6(.sendto, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen));1328 return syscall6(.sendto, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen));
...@@ -1349,21 +1349,21 @@ pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {...@@ -1349,21 +1349,21 @@ pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {
1349}1349}
13501350
1351pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: *[2]i32) usize {1351pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: *[2]i32) usize {
1352 if (native_arch == .i386) {1352 if (native_arch == .x86) {
1353 return socketcall(SC.socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(fd) });1353 return socketcall(SC.socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(fd) });
1354 }1354 }
1355 return syscall4(.socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(fd));1355 return syscall4(.socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(fd));
1356}1356}
13571357
1358pub fn accept(fd: i32, noalias addr: ?*sockaddr, noalias len: ?*socklen_t) usize {1358pub fn accept(fd: i32, noalias addr: ?*sockaddr, noalias len: ?*socklen_t) usize {
1359 if (native_arch == .i386) {1359 if (native_arch == .x86) {
1360 return socketcall(SC.accept, &[4]usize{ fd, addr, len, 0 });1360 return socketcall(SC.accept, &[4]usize{ fd, addr, len, 0 });
1361 }1361 }
1362 return accept4(fd, addr, len, 0);1362 return accept4(fd, addr, len, 0);
1363}1363}
13641364
1365pub fn accept4(fd: i32, noalias addr: ?*sockaddr, noalias len: ?*socklen_t, flags: u32) usize {1365pub fn accept4(fd: i32, noalias addr: ?*sockaddr, noalias len: ?*socklen_t, flags: u32) usize {
1366 if (native_arch == .i386) {1366 if (native_arch == .x86) {
1367 return socketcall(SC.accept4, &[4]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags });1367 return socketcall(SC.accept4, &[4]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags });
1368 }1368 }
1369 return syscall4(.accept4, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags);1369 return syscall4(.accept4, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags);
...@@ -3459,12 +3459,12 @@ pub fn CPU_COUNT(set: cpu_set_t) cpu_count_t {...@@ -3459,12 +3459,12 @@ pub fn CPU_COUNT(set: cpu_set_t) cpu_count_t {
3459}3459}
34603460
3461pub const MINSIGSTKSZ = switch (native_arch) {3461pub const MINSIGSTKSZ = switch (native_arch) {
3462 .i386, .x86_64, .arm, .mipsel => 2048,3462 .x86, .x86_64, .arm, .mipsel => 2048,
3463 .aarch64 => 5120,3463 .aarch64 => 5120,
3464 else => @compileError("MINSIGSTKSZ not defined for this architecture"),3464 else => @compileError("MINSIGSTKSZ not defined for this architecture"),
3465};3465};
3466pub const SIGSTKSZ = switch (native_arch) {3466pub const SIGSTKSZ = switch (native_arch) {
3467 .i386, .x86_64, .arm, .mipsel => 8192,3467 .x86, .x86_64, .arm, .mipsel => 8192,
3468 .aarch64 => 16384,3468 .aarch64 => 16384,
3469 else => @compileError("SIGSTKSZ not defined for this architecture"),3469 else => @compileError("SIGSTKSZ not defined for this architecture"),
3470};3470};
...@@ -5631,7 +5631,7 @@ pub const AUDIT = struct {...@@ -5631,7 +5631,7 @@ pub const AUDIT = struct {
5631 const LE = 0x40000000;5631 const LE = 0x40000000;
56325632
5633 pub const current: AUDIT.ARCH = switch (native_arch) {5633 pub const current: AUDIT.ARCH = switch (native_arch) {
5634 .i386 => .I386,5634 .x86 => .X86,
5635 .x86_64 => .X86_64,5635 .x86_64 => .X86_64,
5636 .aarch64 => .AARCH64,5636 .aarch64 => .AARCH64,
5637 .arm, .thumb => .ARM,5637 .arm, .thumb => .ARM,
...@@ -5650,7 +5650,7 @@ pub const AUDIT = struct {...@@ -5650,7 +5650,7 @@ pub const AUDIT = struct {
5650 ARMEB = toAudit(.armeb),5650 ARMEB = toAudit(.armeb),
5651 CSKY = toAudit(.csky),5651 CSKY = toAudit(.csky),
5652 HEXAGON = @enumToInt(std.elf.EM.HEXAGON),5652 HEXAGON = @enumToInt(std.elf.EM.HEXAGON),
5653 I386 = toAudit(.i386),5653 X86 = toAudit(.x86),
5654 M68K = toAudit(.m68k),5654 M68K = toAudit(.m68k),
5655 MIPS = toAudit(.mips),5655 MIPS = toAudit(.mips),
5656 MIPSEL = toAudit(.mips) | LE,5656 MIPSEL = toAudit(.mips) | LE,
lib/std/os/linux/i386.zig deleted-383
...@@ -1,383 +0,0 @@
1const std = @import("../../std.zig");
2const maxInt = std.math.maxInt;
3const linux = std.os.linux;
4const SYS = linux.SYS;
5const socklen_t = linux.socklen_t;
6const iovec = std.os.iovec;
7const iovec_const = std.os.iovec_const;
8const uid_t = linux.uid_t;
9const gid_t = linux.gid_t;
10const pid_t = linux.pid_t;
11const stack_t = linux.stack_t;
12const sigset_t = linux.sigset_t;
13const sockaddr = linux.sockaddr;
14const timespec = linux.timespec;
15
16pub fn syscall0(number: SYS) usize {
17 return asm volatile ("int $0x80"
18 : [ret] "={eax}" (-> usize),
19 : [number] "{eax}" (@enumToInt(number)),
20 : "memory"
21 );
22}
23
24pub fn syscall1(number: SYS, arg1: usize) usize {
25 return asm volatile ("int $0x80"
26 : [ret] "={eax}" (-> usize),
27 : [number] "{eax}" (@enumToInt(number)),
28 [arg1] "{ebx}" (arg1),
29 : "memory"
30 );
31}
32
33pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
34 return asm volatile ("int $0x80"
35 : [ret] "={eax}" (-> usize),
36 : [number] "{eax}" (@enumToInt(number)),
37 [arg1] "{ebx}" (arg1),
38 [arg2] "{ecx}" (arg2),
39 : "memory"
40 );
41}
42
43pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
44 return asm volatile ("int $0x80"
45 : [ret] "={eax}" (-> usize),
46 : [number] "{eax}" (@enumToInt(number)),
47 [arg1] "{ebx}" (arg1),
48 [arg2] "{ecx}" (arg2),
49 [arg3] "{edx}" (arg3),
50 : "memory"
51 );
52}
53
54pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
55 return asm volatile ("int $0x80"
56 : [ret] "={eax}" (-> usize),
57 : [number] "{eax}" (@enumToInt(number)),
58 [arg1] "{ebx}" (arg1),
59 [arg2] "{ecx}" (arg2),
60 [arg3] "{edx}" (arg3),
61 [arg4] "{esi}" (arg4),
62 : "memory"
63 );
64}
65
66pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
67 return asm volatile ("int $0x80"
68 : [ret] "={eax}" (-> usize),
69 : [number] "{eax}" (@enumToInt(number)),
70 [arg1] "{ebx}" (arg1),
71 [arg2] "{ecx}" (arg2),
72 [arg3] "{edx}" (arg3),
73 [arg4] "{esi}" (arg4),
74 [arg5] "{edi}" (arg5),
75 : "memory"
76 );
77}
78
79pub fn syscall6(
80 number: SYS,
81 arg1: usize,
82 arg2: usize,
83 arg3: usize,
84 arg4: usize,
85 arg5: usize,
86 arg6: usize,
87) usize {
88 // The 6th argument is passed via memory as we're out of registers if ebp is
89 // used as frame pointer. We push arg6 value on the stack before changing
90 // ebp or esp as the compiler may reference it as an offset relative to one
91 // of those two registers.
92 return asm volatile (
93 \\ push %[arg6]
94 \\ push %%ebp
95 \\ mov 4(%%esp), %%ebp
96 \\ int $0x80
97 \\ pop %%ebp
98 \\ add $4, %%esp
99 : [ret] "={eax}" (-> usize),
100 : [number] "{eax}" (@enumToInt(number)),
101 [arg1] "{ebx}" (arg1),
102 [arg2] "{ecx}" (arg2),
103 [arg3] "{edx}" (arg3),
104 [arg4] "{esi}" (arg4),
105 [arg5] "{edi}" (arg5),
106 [arg6] "rm" (arg6),
107 : "memory"
108 );
109}
110
111pub fn socketcall(call: usize, args: [*]usize) usize {
112 return asm volatile ("int $0x80"
113 : [ret] "={eax}" (-> usize),
114 : [number] "{eax}" (@enumToInt(SYS.socketcall)),
115 [arg1] "{ebx}" (call),
116 [arg2] "{ecx}" (@ptrToInt(args)),
117 : "memory"
118 );
119}
120
121const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
122
123/// This matches the libc clone function.
124pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
125
126pub fn restore() callconv(.Naked) void {
127 switch (@import("builtin").zig_backend) {
128 .stage2_c => return asm volatile (
129 \\ movl %[number], %%eax
130 \\ int $0x80
131 :
132 : [number] "i" (@enumToInt(SYS.sigreturn)),
133 : "memory"
134 ),
135 else => return asm volatile ("int $0x80"
136 :
137 : [number] "{eax}" (@enumToInt(SYS.sigreturn)),
138 : "memory"
139 ),
140 }
141}
142
143pub fn restore_rt() callconv(.Naked) void {
144 switch (@import("builtin").zig_backend) {
145 .stage2_c => return asm volatile (
146 \\ movl %[number], %%eax
147 \\ int $0x80
148 :
149 : [number] "i" (@enumToInt(SYS.rt_sigreturn)),
150 : "memory"
151 ),
152 else => return asm volatile ("int $0x80"
153 :
154 : [number] "{eax}" (@enumToInt(SYS.rt_sigreturn)),
155 : "memory"
156 ),
157 }
158}
159
160pub const O = struct {
161 pub const CREAT = 0o100;
162 pub const EXCL = 0o200;
163 pub const NOCTTY = 0o400;
164 pub const TRUNC = 0o1000;
165 pub const APPEND = 0o2000;
166 pub const NONBLOCK = 0o4000;
167 pub const DSYNC = 0o10000;
168 pub const SYNC = 0o4010000;
169 pub const RSYNC = 0o4010000;
170 pub const DIRECTORY = 0o200000;
171 pub const NOFOLLOW = 0o400000;
172 pub const CLOEXEC = 0o2000000;
173
174 pub const ASYNC = 0o20000;
175 pub const DIRECT = 0o40000;
176 pub const LARGEFILE = 0o100000;
177 pub const NOATIME = 0o1000000;
178 pub const PATH = 0o10000000;
179 pub const TMPFILE = 0o20200000;
180 pub const NDELAY = NONBLOCK;
181};
182
183pub const F = struct {
184 pub const DUPFD = 0;
185 pub const GETFD = 1;
186 pub const SETFD = 2;
187 pub const GETFL = 3;
188 pub const SETFL = 4;
189 pub const SETOWN = 8;
190 pub const GETOWN = 9;
191 pub const SETSIG = 10;
192 pub const GETSIG = 11;
193 pub const GETLK = 12;
194 pub const SETLK = 13;
195 pub const SETLKW = 14;
196 pub const SETOWN_EX = 15;
197 pub const GETOWN_EX = 16;
198 pub const GETOWNER_UIDS = 17;
199
200 pub const RDLCK = 0;
201 pub const WRLCK = 1;
202 pub const UNLCK = 2;
203};
204
205pub const LOCK = struct {
206 pub const SH = 1;
207 pub const EX = 2;
208 pub const NB = 4;
209 pub const UN = 8;
210};
211
212pub const MAP = struct {
213 pub const NORESERVE = 0x4000;
214 pub const GROWSDOWN = 0x0100;
215 pub const DENYWRITE = 0x0800;
216 pub const EXECUTABLE = 0x1000;
217 pub const LOCKED = 0x2000;
218 pub const @"32BIT" = 0x40;
219};
220
221pub const MMAP2_UNIT = 4096;
222
223pub const VDSO = struct {
224 pub const CGT_SYM = "__vdso_clock_gettime";
225 pub const CGT_VER = "LINUX_2.6";
226};
227
228pub const ARCH = struct {};
229
230pub const Flock = extern struct {
231 type: i16,
232 whence: i16,
233 start: off_t,
234 len: off_t,
235 pid: pid_t,
236};
237
238pub const msghdr = extern struct {
239 name: ?*sockaddr,
240 namelen: socklen_t,
241 iov: [*]iovec,
242 iovlen: i32,
243 control: ?*anyopaque,
244 controllen: socklen_t,
245 flags: i32,
246};
247
248pub const msghdr_const = extern struct {
249 name: ?*const sockaddr,
250 namelen: socklen_t,
251 iov: [*]const iovec_const,
252 iovlen: i32,
253 control: ?*const anyopaque,
254 controllen: socklen_t,
255 flags: i32,
256};
257
258pub const blksize_t = i32;
259pub const nlink_t = u32;
260pub const time_t = isize;
261pub const mode_t = u32;
262pub const off_t = i64;
263pub const ino_t = u64;
264pub const dev_t = u64;
265pub const blkcnt_t = i64;
266
267// The `stat` definition used by the Linux kernel.
268pub const Stat = extern struct {
269 dev: dev_t,
270 __dev_padding: u32,
271 __ino_truncated: u32,
272 mode: mode_t,
273 nlink: nlink_t,
274 uid: uid_t,
275 gid: gid_t,
276 rdev: dev_t,
277 __rdev_padding: u32,
278 size: off_t,
279 blksize: blksize_t,
280 blocks: blkcnt_t,
281 atim: timespec,
282 mtim: timespec,
283 ctim: timespec,
284 ino: ino_t,
285
286 pub fn atime(self: @This()) timespec {
287 return self.atim;
288 }
289
290 pub fn mtime(self: @This()) timespec {
291 return self.mtim;
292 }
293
294 pub fn ctime(self: @This()) timespec {
295 return self.ctim;
296 }
297};
298
299pub const timeval = extern struct {
300 tv_sec: i32,
301 tv_usec: i32,
302};
303
304pub const timezone = extern struct {
305 tz_minuteswest: i32,
306 tz_dsttime: i32,
307};
308
309pub const mcontext_t = extern struct {
310 gregs: [19]usize,
311 fpregs: [*]u8,
312 oldmask: usize,
313 cr2: usize,
314};
315
316pub const REG = struct {
317 pub const GS = 0;
318 pub const FS = 1;
319 pub const ES = 2;
320 pub const DS = 3;
321 pub const EDI = 4;
322 pub const ESI = 5;
323 pub const EBP = 6;
324 pub const ESP = 7;
325 pub const EBX = 8;
326 pub const EDX = 9;
327 pub const ECX = 10;
328 pub const EAX = 11;
329 pub const TRAPNO = 12;
330 pub const ERR = 13;
331 pub const EIP = 14;
332 pub const CS = 15;
333 pub const EFL = 16;
334 pub const UESP = 17;
335 pub const SS = 18;
336};
337
338pub const ucontext_t = extern struct {
339 flags: usize,
340 link: ?*ucontext_t,
341 stack: stack_t,
342 mcontext: mcontext_t,
343 sigmask: sigset_t,
344 regspace: [64]u64,
345};
346
347pub const Elf_Symndx = u32;
348
349pub const user_desc = packed struct {
350 entry_number: u32,
351 base_addr: u32,
352 limit: u32,
353 seg_32bit: u1,
354 contents: u2,
355 read_exec_only: u1,
356 limit_in_pages: u1,
357 seg_not_present: u1,
358 useable: u1,
359};
360
361/// socketcall() call numbers
362pub const SC = struct {
363 pub const socket = 1;
364 pub const bind = 2;
365 pub const connect = 3;
366 pub const listen = 4;
367 pub const accept = 5;
368 pub const getsockname = 6;
369 pub const getpeername = 7;
370 pub const socketpair = 8;
371 pub const send = 9;
372 pub const recv = 10;
373 pub const sendto = 11;
374 pub const recvfrom = 12;
375 pub const shutdown = 13;
376 pub const setsockopt = 14;
377 pub const getsockopt = 15;
378 pub const sendmsg = 16;
379 pub const recvmsg = 17;
380 pub const accept4 = 18;
381 pub const recvmmsg = 19;
382 pub const sendmmsg = 20;
383};
lib/std/os/linux/start_pie.zig+2-2
...@@ -11,7 +11,7 @@ const R_RISCV_RELATIVE = 3;...@@ -11,7 +11,7 @@ const R_RISCV_RELATIVE = 3;
11const R_SPARC_RELATIVE = 22;11const R_SPARC_RELATIVE = 22;
1212
13const R_RELATIVE = switch (builtin.cpu.arch) {13const R_RELATIVE = switch (builtin.cpu.arch) {
14 .i386 => R_386_RELATIVE,14 .x86 => R_386_RELATIVE,
15 .x86_64 => R_AMD64_RELATIVE,15 .x86_64 => R_AMD64_RELATIVE,
16 .arm => R_ARM_RELATIVE,16 .arm => R_ARM_RELATIVE,
17 .aarch64 => R_AARCH64_RELATIVE,17 .aarch64 => R_AARCH64_RELATIVE,
...@@ -24,7 +24,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) {...@@ -24,7 +24,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) {
24// relocation that, at this point, is not yet applied.24// relocation that, at this point, is not yet applied.
25fn getDynamicSymbol() [*]elf.Dyn {25fn getDynamicSymbol() [*]elf.Dyn {
26 return switch (builtin.cpu.arch) {26 return switch (builtin.cpu.arch) {
27 .i386 => asm volatile (27 .x86 => asm volatile (
28 \\ .weak _DYNAMIC28 \\ .weak _DYNAMIC
29 \\ .hidden _DYNAMIC29 \\ .hidden _DYNAMIC
30 \\ call 1f30 \\ call 1f
lib/std/os/linux/tls.zig+4-4
...@@ -30,7 +30,7 @@ const native_arch = @import("builtin").cpu.arch;...@@ -30,7 +30,7 @@ const native_arch = @import("builtin").cpu.arch;
30// `-- The thread pointer register points here30// `-- The thread pointer register points here
31//31//
32// The structure of the TCB is not defined by the ABI so we reserve enough space32// The structure of the TCB is not defined by the ABI so we reserve enough space
33// for a single pointer as some architectures such as i386 and x86_64 need a33// for a single pointer as some architectures such as x86 and x86_64 need a
34// pointer to the TCB block itself at the address pointed by the tp.34// pointer to the TCB block itself at the address pointed by the tp.
35//35//
36// In this case the control structure and DTV are placed one after another right36// In this case the control structure and DTV are placed one after another right
...@@ -49,7 +49,7 @@ const TLSVariant = enum {...@@ -49,7 +49,7 @@ const TLSVariant = enum {
4949
50const tls_variant = switch (native_arch) {50const tls_variant = switch (native_arch) {
51 .arm, .armeb, .thumb, .aarch64, .aarch64_be, .riscv32, .riscv64, .mips, .mipsel, .powerpc, .powerpc64, .powerpc64le => TLSVariant.VariantI,51 .arm, .armeb, .thumb, .aarch64, .aarch64_be, .riscv32, .riscv64, .mips, .mipsel, .powerpc, .powerpc64, .powerpc64le => TLSVariant.VariantI,
52 .x86_64, .i386, .sparc64 => TLSVariant.VariantII,52 .x86_64, .x86, .sparc64 => TLSVariant.VariantII,
53 else => @compileError("undefined tls_variant for this architecture"),53 else => @compileError("undefined tls_variant for this architecture"),
54};54};
5555
...@@ -102,7 +102,7 @@ const TLSImage = struct {...@@ -102,7 +102,7 @@ const TLSImage = struct {
102 dtv_offset: usize,102 dtv_offset: usize,
103 data_offset: usize,103 data_offset: usize,
104 data_size: usize,104 data_size: usize,
105 // Only used on the i386 architecture105 // Only used on the x86 architecture
106 gdt_entry_number: usize,106 gdt_entry_number: usize,
107};107};
108108
...@@ -110,7 +110,7 @@ pub var tls_image: TLSImage = undefined;...@@ -110,7 +110,7 @@ pub var tls_image: TLSImage = undefined;
110110
111pub fn setThreadPointer(addr: usize) void {111pub fn setThreadPointer(addr: usize) void {
112 switch (native_arch) {112 switch (native_arch) {
113 .i386 => {113 .x86 => {
114 var user_desc = std.os.linux.user_desc{114 var user_desc = std.os.linux.user_desc{
115 .entry_number = tls_image.gdt_entry_number,115 .entry_number = tls_image.gdt_entry_number,
116 .base_addr = addr,116 .base_addr = addr,
lib/std/os/linux/x86.zig created+383
...@@ -0,0 +1,383 @@
1const std = @import("../../std.zig");
2const maxInt = std.math.maxInt;
3const linux = std.os.linux;
4const SYS = linux.SYS;
5const socklen_t = linux.socklen_t;
6const iovec = std.os.iovec;
7const iovec_const = std.os.iovec_const;
8const uid_t = linux.uid_t;
9const gid_t = linux.gid_t;
10const pid_t = linux.pid_t;
11const stack_t = linux.stack_t;
12const sigset_t = linux.sigset_t;
13const sockaddr = linux.sockaddr;
14const timespec = linux.timespec;
15
16pub fn syscall0(number: SYS) usize {
17 return asm volatile ("int $0x80"
18 : [ret] "={eax}" (-> usize),
19 : [number] "{eax}" (@enumToInt(number)),
20 : "memory"
21 );
22}
23
24pub fn syscall1(number: SYS, arg1: usize) usize {
25 return asm volatile ("int $0x80"
26 : [ret] "={eax}" (-> usize),
27 : [number] "{eax}" (@enumToInt(number)),
28 [arg1] "{ebx}" (arg1),
29 : "memory"
30 );
31}
32
33pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
34 return asm volatile ("int $0x80"
35 : [ret] "={eax}" (-> usize),
36 : [number] "{eax}" (@enumToInt(number)),
37 [arg1] "{ebx}" (arg1),
38 [arg2] "{ecx}" (arg2),
39 : "memory"
40 );
41}
42
43pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
44 return asm volatile ("int $0x80"
45 : [ret] "={eax}" (-> usize),
46 : [number] "{eax}" (@enumToInt(number)),
47 [arg1] "{ebx}" (arg1),
48 [arg2] "{ecx}" (arg2),
49 [arg3] "{edx}" (arg3),
50 : "memory"
51 );
52}
53
54pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
55 return asm volatile ("int $0x80"
56 : [ret] "={eax}" (-> usize),
57 : [number] "{eax}" (@enumToInt(number)),
58 [arg1] "{ebx}" (arg1),
59 [arg2] "{ecx}" (arg2),
60 [arg3] "{edx}" (arg3),
61 [arg4] "{esi}" (arg4),
62 : "memory"
63 );
64}
65
66pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
67 return asm volatile ("int $0x80"
68 : [ret] "={eax}" (-> usize),
69 : [number] "{eax}" (@enumToInt(number)),
70 [arg1] "{ebx}" (arg1),
71 [arg2] "{ecx}" (arg2),
72 [arg3] "{edx}" (arg3),
73 [arg4] "{esi}" (arg4),
74 [arg5] "{edi}" (arg5),
75 : "memory"
76 );
77}
78
79pub fn syscall6(
80 number: SYS,
81 arg1: usize,
82 arg2: usize,
83 arg3: usize,
84 arg4: usize,
85 arg5: usize,
86 arg6: usize,
87) usize {
88 // The 6th argument is passed via memory as we're out of registers if ebp is
89 // used as frame pointer. We push arg6 value on the stack before changing
90 // ebp or esp as the compiler may reference it as an offset relative to one
91 // of those two registers.
92 return asm volatile (
93 \\ push %[arg6]
94 \\ push %%ebp
95 \\ mov 4(%%esp), %%ebp
96 \\ int $0x80
97 \\ pop %%ebp
98 \\ add $4, %%esp
99 : [ret] "={eax}" (-> usize),
100 : [number] "{eax}" (@enumToInt(number)),
101 [arg1] "{ebx}" (arg1),
102 [arg2] "{ecx}" (arg2),
103 [arg3] "{edx}" (arg3),
104 [arg4] "{esi}" (arg4),
105 [arg5] "{edi}" (arg5),
106 [arg6] "rm" (arg6),
107 : "memory"
108 );
109}
110
111pub fn socketcall(call: usize, args: [*]usize) usize {
112 return asm volatile ("int $0x80"
113 : [ret] "={eax}" (-> usize),
114 : [number] "{eax}" (@enumToInt(SYS.socketcall)),
115 [arg1] "{ebx}" (call),
116 [arg2] "{ecx}" (@ptrToInt(args)),
117 : "memory"
118 );
119}
120
121const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
122
123/// This matches the libc clone function.
124pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
125
126pub fn restore() callconv(.Naked) void {
127 switch (@import("builtin").zig_backend) {
128 .stage2_c => return asm volatile (
129 \\ movl %[number], %%eax
130 \\ int $0x80
131 :
132 : [number] "i" (@enumToInt(SYS.sigreturn)),
133 : "memory"
134 ),
135 else => return asm volatile ("int $0x80"
136 :
137 : [number] "{eax}" (@enumToInt(SYS.sigreturn)),
138 : "memory"
139 ),
140 }
141}
142
143pub fn restore_rt() callconv(.Naked) void {
144 switch (@import("builtin").zig_backend) {
145 .stage2_c => return asm volatile (
146 \\ movl %[number], %%eax
147 \\ int $0x80
148 :
149 : [number] "i" (@enumToInt(SYS.rt_sigreturn)),
150 : "memory"
151 ),
152 else => return asm volatile ("int $0x80"
153 :
154 : [number] "{eax}" (@enumToInt(SYS.rt_sigreturn)),
155 : "memory"
156 ),
157 }
158}
159
160pub const O = struct {
161 pub const CREAT = 0o100;
162 pub const EXCL = 0o200;
163 pub const NOCTTY = 0o400;
164 pub const TRUNC = 0o1000;
165 pub const APPEND = 0o2000;
166 pub const NONBLOCK = 0o4000;
167 pub const DSYNC = 0o10000;
168 pub const SYNC = 0o4010000;
169 pub const RSYNC = 0o4010000;
170 pub const DIRECTORY = 0o200000;
171 pub const NOFOLLOW = 0o400000;
172 pub const CLOEXEC = 0o2000000;
173
174 pub const ASYNC = 0o20000;
175 pub const DIRECT = 0o40000;
176 pub const LARGEFILE = 0o100000;
177 pub const NOATIME = 0o1000000;
178 pub const PATH = 0o10000000;
179 pub const TMPFILE = 0o20200000;
180 pub const NDELAY = NONBLOCK;
181};
182
183pub const F = struct {
184 pub const DUPFD = 0;
185 pub const GETFD = 1;
186 pub const SETFD = 2;
187 pub const GETFL = 3;
188 pub const SETFL = 4;
189 pub const SETOWN = 8;
190 pub const GETOWN = 9;
191 pub const SETSIG = 10;
192 pub const GETSIG = 11;
193 pub const GETLK = 12;
194 pub const SETLK = 13;
195 pub const SETLKW = 14;
196 pub const SETOWN_EX = 15;
197 pub const GETOWN_EX = 16;
198 pub const GETOWNER_UIDS = 17;
199
200 pub const RDLCK = 0;
201 pub const WRLCK = 1;
202 pub const UNLCK = 2;
203};
204
205pub const LOCK = struct {
206 pub const SH = 1;
207 pub const EX = 2;
208 pub const NB = 4;
209 pub const UN = 8;
210};
211
212pub const MAP = struct {
213 pub const NORESERVE = 0x4000;
214 pub const GROWSDOWN = 0x0100;
215 pub const DENYWRITE = 0x0800;
216 pub const EXECUTABLE = 0x1000;
217 pub const LOCKED = 0x2000;
218 pub const @"32BIT" = 0x40;
219};
220
221pub const MMAP2_UNIT = 4096;
222
223pub const VDSO = struct {
224 pub const CGT_SYM = "__vdso_clock_gettime";
225 pub const CGT_VER = "LINUX_2.6";
226};
227
228pub const ARCH = struct {};
229
230pub const Flock = extern struct {
231 type: i16,
232 whence: i16,
233 start: off_t,
234 len: off_t,
235 pid: pid_t,
236};
237
238pub const msghdr = extern struct {
239 name: ?*sockaddr,
240 namelen: socklen_t,
241 iov: [*]iovec,
242 iovlen: i32,
243 control: ?*anyopaque,
244 controllen: socklen_t,
245 flags: i32,
246};
247
248pub const msghdr_const = extern struct {
249 name: ?*const sockaddr,
250 namelen: socklen_t,
251 iov: [*]const iovec_const,
252 iovlen: i32,
253 control: ?*const anyopaque,
254 controllen: socklen_t,
255 flags: i32,
256};
257
258pub const blksize_t = i32;
259pub const nlink_t = u32;
260pub const time_t = isize;
261pub const mode_t = u32;
262pub const off_t = i64;
263pub const ino_t = u64;
264pub const dev_t = u64;
265pub const blkcnt_t = i64;
266
267// The `stat` definition used by the Linux kernel.
268pub const Stat = extern struct {
269 dev: dev_t,
270 __dev_padding: u32,
271 __ino_truncated: u32,
272 mode: mode_t,
273 nlink: nlink_t,
274 uid: uid_t,
275 gid: gid_t,
276 rdev: dev_t,
277 __rdev_padding: u32,
278 size: off_t,
279 blksize: blksize_t,
280 blocks: blkcnt_t,
281 atim: timespec,
282 mtim: timespec,
283 ctim: timespec,
284 ino: ino_t,
285
286 pub fn atime(self: @This()) timespec {
287 return self.atim;
288 }
289
290 pub fn mtime(self: @This()) timespec {
291 return self.mtim;
292 }
293
294 pub fn ctime(self: @This()) timespec {
295 return self.ctim;
296 }
297};
298
299pub const timeval = extern struct {
300 tv_sec: i32,
301 tv_usec: i32,
302};
303
304pub const timezone = extern struct {
305 tz_minuteswest: i32,
306 tz_dsttime: i32,
307};
308
309pub const mcontext_t = extern struct {
310 gregs: [19]usize,
311 fpregs: [*]u8,
312 oldmask: usize,
313 cr2: usize,
314};
315
316pub const REG = struct {
317 pub const GS = 0;
318 pub const FS = 1;
319 pub const ES = 2;
320 pub const DS = 3;
321 pub const EDI = 4;
322 pub const ESI = 5;
323 pub const EBP = 6;
324 pub const ESP = 7;
325 pub const EBX = 8;
326 pub const EDX = 9;
327 pub const ECX = 10;
328 pub const EAX = 11;
329 pub const TRAPNO = 12;
330 pub const ERR = 13;
331 pub const EIP = 14;
332 pub const CS = 15;
333 pub const EFL = 16;
334 pub const UESP = 17;
335 pub const SS = 18;
336};
337
338pub const ucontext_t = extern struct {
339 flags: usize,
340 link: ?*ucontext_t,
341 stack: stack_t,
342 mcontext: mcontext_t,
343 sigmask: sigset_t,
344 regspace: [64]u64,
345};
346
347pub const Elf_Symndx = u32;
348
349pub const user_desc = packed struct {
350 entry_number: u32,
351 base_addr: u32,
352 limit: u32,
353 seg_32bit: u1,
354 contents: u2,
355 read_exec_only: u1,
356 limit_in_pages: u1,
357 seg_not_present: u1,
358 useable: u1,
359};
360
361/// socketcall() call numbers
362pub const SC = struct {
363 pub const socket = 1;
364 pub const bind = 2;
365 pub const connect = 3;
366 pub const listen = 4;
367 pub const accept = 5;
368 pub const getsockname = 6;
369 pub const getpeername = 7;
370 pub const socketpair = 8;
371 pub const send = 9;
372 pub const recv = 10;
373 pub const sendto = 11;
374 pub const recvfrom = 12;
375 pub const shutdown = 13;
376 pub const setsockopt = 14;
377 pub const getsockopt = 15;
378 pub const sendmsg = 16;
379 pub const recvmsg = 17;
380 pub const accept4 = 18;
381 pub const recvmmsg = 19;
382 pub const sendmmsg = 20;
383};
lib/std/os/test.zig+1-1
...@@ -746,7 +746,7 @@ test "sigaction" {...@@ -746,7 +746,7 @@ test "sigaction" {
746 return error.SkipZigTest;746 return error.SkipZigTest;
747747
748 // https://github.com/ziglang/zig/issues/7427748 // https://github.com/ziglang/zig/issues/7427
749 if (native_os == .linux and builtin.target.cpu.arch == .i386)749 if (native_os == .linux and builtin.target.cpu.arch == .x86)
750 return error.SkipZigTest;750 return error.SkipZigTest;
751751
752 const S = struct {752 const S = struct {
lib/std/os/windows.zig+3-3
...@@ -1750,7 +1750,7 @@ pub fn UnlockFile(...@@ -1750,7 +1750,7 @@ pub fn UnlockFile(
17501750
1751pub fn teb() *TEB {1751pub fn teb() *TEB {
1752 return switch (native_arch) {1752 return switch (native_arch) {
1753 .i386 => asm volatile (1753 .x86 => asm volatile (
1754 \\ movl %%fs:0x18, %[ptr]1754 \\ movl %%fs:0x18, %[ptr]
1755 : [ptr] "=r" (-> *TEB),1755 : [ptr] "=r" (-> *TEB),
1756 ),1756 ),
...@@ -2053,7 +2053,7 @@ pub const STD_OUTPUT_HANDLE = maxInt(DWORD) - 11 + 1;...@@ -2053,7 +2053,7 @@ pub const STD_OUTPUT_HANDLE = maxInt(DWORD) - 11 + 1;
2053/// The standard error device. Initially, this is the active console screen buffer, CONOUT$.2053/// The standard error device. Initially, this is the active console screen buffer, CONOUT$.
2054pub const STD_ERROR_HANDLE = maxInt(DWORD) - 12 + 1;2054pub const STD_ERROR_HANDLE = maxInt(DWORD) - 12 + 1;
20552055
2056pub const WINAPI: std.builtin.CallingConvention = if (native_arch == .i386)2056pub const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86)
2057 .Stdcall2057 .Stdcall
2058else2058else
2059 .C;2059 .C;
...@@ -3019,7 +3019,7 @@ pub const EXCEPTION_RECORD = extern struct {...@@ -3019,7 +3019,7 @@ pub const EXCEPTION_RECORD = extern struct {
3019};3019};
30203020
3021pub usingnamespace switch (native_arch) {3021pub usingnamespace switch (native_arch) {
3022 .i386 => struct {3022 .x86 => struct {
3023 pub const FLOATING_SAVE_AREA = extern struct {3023 pub const FLOATING_SAVE_AREA = extern struct {
3024 ControlWord: DWORD,3024 ControlWord: DWORD,
3025 StatusWord: DWORD,3025 StatusWord: DWORD,
lib/std/start.zig+2-2
...@@ -275,7 +275,7 @@ fn _start() callconv(.Naked) noreturn {...@@ -275,7 +275,7 @@ fn _start() callconv(.Naked) noreturn {
275 \\ andq $-16, %%rsp275 \\ andq $-16, %%rsp
276 \\ call _posixCallMainAndExit276 \\ call _posixCallMainAndExit
277 ),277 ),
278 .i386 => asm volatile (278 .x86 => asm volatile (
279 \\ xorl %%ebp, %%ebp279 \\ xorl %%ebp, %%ebp
280 \\ movl %%esp, argc_argv_ptr280 \\ movl %%esp, argc_argv_ptr
281 \\ andl $-16, %%esp281 \\ andl $-16, %%esp
...@@ -307,7 +307,7 @@ fn _start() callconv(.Naked) noreturn {...@@ -307,7 +307,7 @@ fn _start() callconv(.Naked) noreturn {
307 : [argc] "={rsp}" (-> [*]usize),307 : [argc] "={rsp}" (-> [*]usize),
308 );308 );
309 },309 },
310 .i386 => {310 .x86 => {
311 argc_argv_ptr = asm volatile (311 argc_argv_ptr = asm volatile (
312 \\ xor %%ebp, %%ebp312 \\ xor %%ebp, %%ebp
313 : [argc] "={esp}" (-> [*]usize),313 : [argc] "={esp}" (-> [*]usize),
lib/std/start_windows_tls.zig+1-1
...@@ -8,7 +8,7 @@ export var __xl_a: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLA") =...@@ -8,7 +8,7 @@ export var __xl_a: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLA") =
8export var __xl_z: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLZ") = null;8export var __xl_z: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLZ") = null;
99
10comptime {10comptime {
11 if (builtin.target.cpu.arch == .i386) {11 if (builtin.target.cpu.arch == .x86) {
12 // The __tls_array is the offset of the ThreadLocalStoragePointer field12 // The __tls_array is the offset of the ThreadLocalStoragePointer field
13 // in the TEB block whose base address held in the %fs segment.13 // in the TEB block whose base address held in the %fs segment.
14 asm (14 asm (
lib/std/target.zig+16-16
...@@ -850,7 +850,7 @@ pub const Target = struct {...@@ -850,7 +850,7 @@ pub const Target = struct {
850 tcele,850 tcele,
851 thumb,851 thumb,
852 thumbeb,852 thumbeb,
853 i386,853 x86,
854 x86_64,854 x86_64,
855 xcore,855 xcore,
856 nvptx,856 nvptx,
...@@ -879,7 +879,7 @@ pub const Target = struct {...@@ -879,7 +879,7 @@ pub const Target = struct {
879879
880 pub fn isX86(arch: Arch) bool {880 pub fn isX86(arch: Arch) bool {
881 return switch (arch) {881 return switch (arch) {
882 .i386, .x86_64 => true,882 .x86, .x86_64 => true,
883 else => false,883 else => false,
884 };884 };
885 }885 }
...@@ -999,7 +999,7 @@ pub const Target = struct {...@@ -999,7 +999,7 @@ pub const Target = struct {
999 .tcele => .NONE,999 .tcele => .NONE,
1000 .thumb => .ARM,1000 .thumb => .ARM,
1001 .thumbeb => .ARM,1001 .thumbeb => .ARM,
1002 .i386 => .@"386",1002 .x86 => .@"386",
1003 .xcore => .XCORE,1003 .xcore => .XCORE,
1004 .nvptx => .NONE,1004 .nvptx => .NONE,
1005 .amdil => .NONE,1005 .amdil => .NONE,
...@@ -1063,7 +1063,7 @@ pub const Target = struct {...@@ -1063,7 +1063,7 @@ pub const Target = struct {
1063 .tcele => .Unknown,1063 .tcele => .Unknown,
1064 .thumb => .Thumb,1064 .thumb => .Thumb,
1065 .thumbeb => .Thumb,1065 .thumbeb => .Thumb,
1066 .i386 => .I386,1066 .x86 => .I386,
1067 .xcore => .Unknown,1067 .xcore => .Unknown,
1068 .nvptx => .Unknown,1068 .nvptx => .Unknown,
1069 .amdil => .Unknown,1069 .amdil => .Unknown,
...@@ -1134,7 +1134,7 @@ pub const Target = struct {...@@ -1134,7 +1134,7 @@ pub const Target = struct {
1134 .r600,1134 .r600,
1135 .riscv32,1135 .riscv32,
1136 .riscv64,1136 .riscv64,
1137 .i386,1137 .x86,
1138 .x86_64,1138 .x86_64,
1139 .wasm32,1139 .wasm32,
1140 .wasm64,1140 .wasm64,
...@@ -1179,7 +1179,7 @@ pub const Target = struct {...@@ -1179,7 +1179,7 @@ pub const Target = struct {
1179 const is_nvptx = arch == .nvptx or arch == .nvptx64;1179 const is_nvptx = arch == .nvptx or arch == .nvptx64;
1180 return switch (address_space) {1180 return switch (address_space) {
1181 .generic => true,1181 .generic => true,
1182 .fs, .gs, .ss => arch == .x86_64 or arch == .i386,1182 .fs, .gs, .ss => arch == .x86_64 or arch == .x86,
1183 .global, .constant, .local, .shared => arch == .amdgcn or is_nvptx,1183 .global, .constant, .local, .shared => arch == .amdgcn or is_nvptx,
1184 .param => is_nvptx,1184 .param => is_nvptx,
1185 };1185 };
...@@ -1211,7 +1211,7 @@ pub const Target = struct {...@@ -1211,7 +1211,7 @@ pub const Target = struct {
1211 .tcele,1211 .tcele,
1212 .thumb,1212 .thumb,
1213 .thumbeb,1213 .thumbeb,
1214 .i386,1214 .x86,
1215 .xcore,1215 .xcore,
1216 .nvptx,1216 .nvptx,
1217 .amdil,1217 .amdil,
...@@ -1267,7 +1267,7 @@ pub const Target = struct {...@@ -1267,7 +1267,7 @@ pub const Target = struct {
1267 .riscv32, .riscv64 => "riscv",1267 .riscv32, .riscv64 => "riscv",
1268 .sparc, .sparc64, .sparcel => "sparc",1268 .sparc, .sparc64, .sparcel => "sparc",
1269 .s390x => "s390x",1269 .s390x => "s390x",
1270 .i386, .x86_64 => "x86",1270 .x86, .x86_64 => "x86",
1271 .nvptx, .nvptx64 => "nvptx",1271 .nvptx, .nvptx64 => "nvptx",
1272 .wasm32, .wasm64 => "wasm",1272 .wasm32, .wasm64 => "wasm",
1273 .spirv32, .spirv64 => "spir-v",1273 .spirv32, .spirv64 => "spir-v",
...@@ -1291,7 +1291,7 @@ pub const Target = struct {...@@ -1291,7 +1291,7 @@ pub const Target = struct {
1291 .sparc, .sparc64, .sparcel => &sparc.all_features,1291 .sparc, .sparc64, .sparcel => &sparc.all_features,
1292 .spirv32, .spirv64 => &spirv.all_features,1292 .spirv32, .spirv64 => &spirv.all_features,
1293 .s390x => &s390x.all_features,1293 .s390x => &s390x.all_features,
1294 .i386, .x86_64 => &x86.all_features,1294 .x86, .x86_64 => &x86.all_features,
1295 .nvptx, .nvptx64 => &nvptx.all_features,1295 .nvptx, .nvptx64 => &nvptx.all_features,
1296 .ve => &ve.all_features,1296 .ve => &ve.all_features,
1297 .wasm32, .wasm64 => &wasm.all_features,1297 .wasm32, .wasm64 => &wasm.all_features,
...@@ -1315,7 +1315,7 @@ pub const Target = struct {...@@ -1315,7 +1315,7 @@ pub const Target = struct {
1315 .riscv32, .riscv64 => comptime allCpusFromDecls(riscv.cpu),1315 .riscv32, .riscv64 => comptime allCpusFromDecls(riscv.cpu),
1316 .sparc, .sparc64, .sparcel => comptime allCpusFromDecls(sparc.cpu),1316 .sparc, .sparc64, .sparcel => comptime allCpusFromDecls(sparc.cpu),
1317 .s390x => comptime allCpusFromDecls(s390x.cpu),1317 .s390x => comptime allCpusFromDecls(s390x.cpu),
1318 .i386, .x86_64 => comptime allCpusFromDecls(x86.cpu),1318 .x86, .x86_64 => comptime allCpusFromDecls(x86.cpu),
1319 .nvptx, .nvptx64 => comptime allCpusFromDecls(nvptx.cpu),1319 .nvptx, .nvptx64 => comptime allCpusFromDecls(nvptx.cpu),
1320 .ve => comptime allCpusFromDecls(ve.cpu),1320 .ve => comptime allCpusFromDecls(ve.cpu),
1321 .wasm32, .wasm64 => comptime allCpusFromDecls(wasm.cpu),1321 .wasm32, .wasm64 => comptime allCpusFromDecls(wasm.cpu),
...@@ -1377,7 +1377,7 @@ pub const Target = struct {...@@ -1377,7 +1377,7 @@ pub const Target = struct {
1377 .sparc, .sparcel => &sparc.cpu.generic,1377 .sparc, .sparcel => &sparc.cpu.generic,
1378 .sparc64 => &sparc.cpu.v9, // 64-bit SPARC needs v9 as the baseline1378 .sparc64 => &sparc.cpu.v9, // 64-bit SPARC needs v9 as the baseline
1379 .s390x => &s390x.cpu.generic,1379 .s390x => &s390x.cpu.generic,
1380 .i386 => &x86.cpu.i386,1380 .x86 => &x86.cpu.x86,
1381 .x86_64 => &x86.cpu.x86_64,1381 .x86_64 => &x86.cpu.x86_64,
1382 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,1382 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
1383 .ve => &ve.cpu.generic,1383 .ve => &ve.cpu.generic,
...@@ -1392,7 +1392,7 @@ pub const Target = struct {...@@ -1392,7 +1392,7 @@ pub const Target = struct {
1392 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,1392 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
1393 .riscv32 => &riscv.cpu.baseline_rv32,1393 .riscv32 => &riscv.cpu.baseline_rv32,
1394 .riscv64 => &riscv.cpu.baseline_rv64,1394 .riscv64 => &riscv.cpu.baseline_rv64,
1395 .i386 => &x86.cpu.pentium4,1395 .x86 => &x86.cpu.pentium4,
1396 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,1396 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
1397 .sparc, .sparcel => &sparc.cpu.v8,1397 .sparc, .sparcel => &sparc.cpu.v8,
13981398
...@@ -1622,7 +1622,7 @@ pub const Target = struct {...@@ -1622,7 +1622,7 @@ pub const Target = struct {
1622 .dragonfly => return copy(&result, "/libexec/ld-elf.so.2"),1622 .dragonfly => return copy(&result, "/libexec/ld-elf.so.2"),
1623 .solaris => return copy(&result, "/lib/64/ld.so.1"),1623 .solaris => return copy(&result, "/lib/64/ld.so.1"),
1624 .linux => switch (self.cpu.arch) {1624 .linux => switch (self.cpu.arch) {
1625 .i386,1625 .x86,
1626 .sparc,1626 .sparc,
1627 .sparcel,1627 .sparcel,
1628 => return copy(&result, "/lib/ld-linux.so.2"),1628 => return copy(&result, "/lib/ld-linux.so.2"),
...@@ -1771,7 +1771,7 @@ pub const Target = struct {...@@ -1771,7 +1771,7 @@ pub const Target = struct {
1771 /// 5c arm little-endian ARM1771 /// 5c arm little-endian ARM
1772 /// 6c amd64 AMD64 and compatibles (e.g., Intel EM64T)1772 /// 6c amd64 AMD64 and compatibles (e.g., Intel EM64T)
1773 /// 7c arm64 ARM64 (ARMv8)1773 /// 7c arm64 ARM64 (ARMv8)
1774 /// 8c 386 Intel i386, i486, Pentium, etc.1774 /// 8c 386 Intel x86, i486, Pentium, etc.
1775 /// kc sparc Sun SPARC1775 /// kc sparc Sun SPARC
1776 /// qc power Power PC1776 /// qc power Power PC
1777 /// vc mips big-endian MIPS 3000 family1777 /// vc mips big-endian MIPS 3000 family
...@@ -1780,7 +1780,7 @@ pub const Target = struct {...@@ -1780,7 +1780,7 @@ pub const Target = struct {
1780 .arm => ".5",1780 .arm => ".5",
1781 .x86_64 => ".6",1781 .x86_64 => ".6",
1782 .aarch64 => ".7",1782 .aarch64 => ".7",
1783 .i386 => ".8",1783 .x86 => ".8",
1784 .sparc => ".k",1784 .sparc => ".k",
1785 .powerpc, .powerpcle => ".q",1785 .powerpc, .powerpcle => ".q",
1786 .mips, .mipsel => ".v",1786 .mips, .mipsel => ".v",
...@@ -1815,7 +1815,7 @@ pub const Target = struct {...@@ -1815,7 +1815,7 @@ pub const Target = struct {
1815 .wasm64,1815 .wasm64,
1816 => 8,1816 => 8,
18171817
1818 .i386 => return switch (target.os.tag) {1818 .x86 => return switch (target.os.tag) {
1819 .windows, .uefi => 8,1819 .windows, .uefi => 8,
1820 else => 4,1820 else => 4,
1821 },1821 },
lib/std/target/x86.zig+2-2
...@@ -2040,8 +2040,8 @@ pub const cpu = struct {...@@ -2040,8 +2040,8 @@ pub const cpu = struct {
2040 .xsaveopt,2040 .xsaveopt,
2041 }),2041 }),
2042 };2042 };
2043 pub const @"i386" = CpuModel{2043 pub const x86 = CpuModel{
2044 .name = "i386",2044 .name = "x86",
2045 .llvm_name = "i386",2045 .llvm_name = "i386",
2046 .features = featureSet(&[_]Feature{2046 .features = featureSet(&[_]Feature{
2047 .slow_unaligned_mem_16,2047 .slow_unaligned_mem_16,
lib/std/valgrind.zig+1-1
...@@ -8,7 +8,7 @@ pub fn doClientRequest(default: usize, request: usize, a1: usize, a2: usize, a3:...@@ -8,7 +8,7 @@ pub fn doClientRequest(default: usize, request: usize, a1: usize, a2: usize, a3:
8 }8 }
99
10 switch (builtin.target.cpu.arch) {10 switch (builtin.target.cpu.arch) {
11 .i386 => {11 .x86 => {
12 return asm volatile (12 return asm volatile (
13 \\ roll $3, %%edi ; roll $13, %%edi13 \\ roll $3, %%edi ; roll $13, %%edi
14 \\ roll $29, %%edi ; roll $19, %%edi14 \\ roll $29, %%edi ; roll $19, %%edi
lib/std/zig/CrossTarget.zig+1-1
...@@ -592,7 +592,7 @@ pub const VcpkgLinkage = std.builtin.LinkMode;...@@ -592,7 +592,7 @@ pub const VcpkgLinkage = std.builtin.LinkMode;
592/// Returned slice must be freed by the caller.592/// Returned slice must be freed by the caller.
593pub fn vcpkgTriplet(self: CrossTarget, allocator: mem.Allocator, linkage: VcpkgLinkage) ![]u8 {593pub fn vcpkgTriplet(self: CrossTarget, allocator: mem.Allocator, linkage: VcpkgLinkage) ![]u8 {
594 const arch = switch (self.getCpuArch()) {594 const arch = switch (self.getCpuArch()) {
595 .i386 => "x86",595 .x86 => "x86",
596 .x86_64 => "x64",596 .x86_64 => "x64",
597597
598 .arm,598 .arm,
lib/std/zig/system/NativeTargetInfo.zig+5-5
...@@ -199,11 +199,11 @@ pub fn detect(cross_target: CrossTarget) DetectError!NativeTargetInfo {...@@ -199,11 +199,11 @@ pub fn detect(cross_target: CrossTarget) DetectError!NativeTargetInfo {
199 // For x86, we need to populate some CPU feature flags depending on architecture199 // For x86, we need to populate some CPU feature flags depending on architecture
200 // and mode:200 // and mode:
201 // * 16bit_mode => if the abi is code16201 // * 16bit_mode => if the abi is code16
202 // * 32bit_mode => if the arch is i386202 // * 32bit_mode => if the arch is x86
203 // However, the "mode" flags can be used as overrides, so if the user explicitly203 // However, the "mode" flags can be used as overrides, so if the user explicitly
204 // sets one of them, that takes precedence.204 // sets one of them, that takes precedence.
205 switch (cpu_arch) {205 switch (cpu_arch) {
206 .i386 => {206 .x86 => {
207 if (!std.Target.x86.featureSetHasAny(cross_target.cpu_features_add, .{207 if (!std.Target.x86.featureSetHasAny(cross_target.cpu_features_add, .{
208 .@"16bit_mode", .@"32bit_mode",208 .@"16bit_mode", .@"32bit_mode",
209 })) {209 })) {
...@@ -969,7 +969,7 @@ fn detectNativeCpuAndFeatures(cpu_arch: Target.Cpu.Arch, os: Target.Os, cross_ta...@@ -969,7 +969,7 @@ fn detectNativeCpuAndFeatures(cpu_arch: Target.Cpu.Arch, os: Target.Os, cross_ta
969 // although it is a runtime value, is guaranteed to be one of the architectures in the set969 // although it is a runtime value, is guaranteed to be one of the architectures in the set
970 // of the respective switch prong.970 // of the respective switch prong.
971 switch (builtin.cpu.arch) {971 switch (builtin.cpu.arch) {
972 .x86_64, .i386 => {972 .x86_64, .x86 => {
973 return @import("x86.zig").detectNativeCpuAndFeatures(cpu_arch, os, cross_target);973 return @import("x86.zig").detectNativeCpuAndFeatures(cpu_arch, os, cross_target);
974 },974 },
975 else => {},975 else => {},
...@@ -1019,7 +1019,7 @@ pub fn getExternalExecutor(...@@ -1019,7 +1019,7 @@ pub fn getExternalExecutor(
1019 if (host.target.cpu.arch == candidate.target.cpu.arch)1019 if (host.target.cpu.arch == candidate.target.cpu.arch)
1020 break :cpu_ok true;1020 break :cpu_ok true;
10211021
1022 if (host.target.cpu.arch == .x86_64 and candidate.target.cpu.arch == .i386)1022 if (host.target.cpu.arch == .x86_64 and candidate.target.cpu.arch == .x86)
1023 break :cpu_ok true;1023 break :cpu_ok true;
10241024
1025 if (host.target.cpu.arch == .aarch64 and candidate.target.cpu.arch == .arm)1025 if (host.target.cpu.arch == .aarch64 and candidate.target.cpu.arch == .arm)
...@@ -1068,7 +1068,7 @@ pub fn getExternalExecutor(...@@ -1068,7 +1068,7 @@ pub fn getExternalExecutor(
1068 .arm => Executor{ .qemu = "qemu-arm" },1068 .arm => Executor{ .qemu = "qemu-arm" },
1069 .armeb => Executor{ .qemu = "qemu-armeb" },1069 .armeb => Executor{ .qemu = "qemu-armeb" },
1070 .hexagon => Executor{ .qemu = "qemu-hexagon" },1070 .hexagon => Executor{ .qemu = "qemu-hexagon" },
1071 .i386 => Executor{ .qemu = "qemu-i386" },1071 .x86 => Executor{ .qemu = "qemu-i386" },
1072 .m68k => Executor{ .qemu = "qemu-m68k" },1072 .m68k => Executor{ .qemu = "qemu-m68k" },
1073 .mips => Executor{ .qemu = "qemu-mips" },1073 .mips => Executor{ .qemu = "qemu-mips" },
1074 .mipsel => Executor{ .qemu = "qemu-mipsel" },1074 .mipsel => Executor{ .qemu = "qemu-mipsel" },
lib/std/zig/system/x86.zig+1-1
...@@ -80,7 +80,7 @@ fn detectIntelProcessor(cpu: *Target.Cpu, family: u32, model: u32, brand_id: u32...@@ -80,7 +80,7 @@ fn detectIntelProcessor(cpu: *Target.Cpu, family: u32, model: u32, brand_id: u32
80 }80 }
81 switch (family) {81 switch (family) {
82 3 => {82 3 => {
83 cpu.model = &Target.x86.cpu.i386;83 cpu.model = &Target.x86.cpu.x86;
84 return;84 return;
85 },85 },
86 4 => {86 4 => {
src/Compilation.zig+2-2
...@@ -4281,7 +4281,7 @@ pub fn addCCArgs(...@@ -4281,7 +4281,7 @@ pub fn addCCArgs(
4281 },4281 },
4282 .ios, .tvos, .watchos => switch (target.cpu.arch) {4282 .ios, .tvos, .watchos => switch (target.cpu.arch) {
4283 // Pass the proper -m<os>-version-min argument for darwin.4283 // Pass the proper -m<os>-version-min argument for darwin.
4284 .i386, .x86_64 => {4284 .x86, .x86_64 => {
4285 const ver = target.os.version_range.semver.min;4285 const ver = target.os.version_range.semver.min;
4286 try argv.append(try std.fmt.allocPrint(4286 try argv.append(try std.fmt.allocPrint(
4287 arena,4287 arena,
...@@ -4969,7 +4969,7 @@ pub fn getZigBackend(comp: Compilation) std.builtin.CompilerBackend {...@@ -4969,7 +4969,7 @@ pub fn getZigBackend(comp: Compilation) std.builtin.CompilerBackend {
4969 .wasm32, .wasm64 => std.builtin.CompilerBackend.stage2_wasm,4969 .wasm32, .wasm64 => std.builtin.CompilerBackend.stage2_wasm,
4970 .arm, .armeb, .thumb, .thumbeb => .stage2_arm,4970 .arm, .armeb, .thumb, .thumbeb => .stage2_arm,
4971 .x86_64 => .stage2_x86_64,4971 .x86_64 => .stage2_x86_64,
4972 .i386 => .stage2_x86,4972 .x86 => .stage2_x86,
4973 .aarch64, .aarch64_be, .aarch64_32 => .stage2_aarch64,4973 .aarch64, .aarch64_be, .aarch64_32 => .stage2_aarch64,
4974 .riscv64 => .stage2_riscv64,4974 .riscv64 => .stage2_riscv64,
4975 .sparc64 => .stage2_sparc64,4975 .sparc64 => .stage2_sparc64,
src/Sema.zig+7-7
...@@ -8415,20 +8415,20 @@ fn funcCommon(...@@ -8415,20 +8415,20 @@ fn funcCommon(
8415 if (switch (cc_workaround) {8415 if (switch (cc_workaround) {
8416 .Unspecified, .C, .Naked, .Async, .Inline => null,8416 .Unspecified, .C, .Naked, .Async, .Inline => null,
8417 .Interrupt => switch (arch) {8417 .Interrupt => switch (arch) {
8418 .i386, .x86_64, .avr, .msp430 => null,8418 .x86, .x86_64, .avr, .msp430 => null,
8419 else => @as([]const u8, "i386, x86_64, AVR, and MSP430"),8419 else => @as([]const u8, "x86, x86_64, AVR, and MSP430"),
8420 },8420 },
8421 .Signal => switch (arch) {8421 .Signal => switch (arch) {
8422 .avr => null,8422 .avr => null,
8423 else => @as([]const u8, "AVR"),8423 else => @as([]const u8, "AVR"),
8424 },8424 },
8425 .Stdcall, .Fastcall, .Thiscall => switch (arch) {8425 .Stdcall, .Fastcall, .Thiscall => switch (arch) {
8426 .i386 => null,8426 .x86 => null,
8427 else => @as([]const u8, "i386"),8427 else => @as([]const u8, "x86"),
8428 },8428 },
8429 .Vectorcall => switch (arch) {8429 .Vectorcall => switch (arch) {
8430 .i386, .aarch64, .aarch64_be, .aarch64_32 => null,8430 .x86, .aarch64, .aarch64_be, .aarch64_32 => null,
8431 else => @as([]const u8, "i386 and AArch64"),8431 else => @as([]const u8, "x86 and AArch64"),
8432 },8432 },
8433 .APCS, .AAPCS, .AAPCSVFP => switch (arch) {8433 .APCS, .AAPCS, .AAPCSVFP => switch (arch) {
8434 .arm, .armeb, .aarch64, .aarch64_be, .aarch64_32, .thumb, .thumbeb => null,8434 .arm, .armeb, .aarch64, .aarch64_be, .aarch64_32, .thumb, .thumbeb => null,
...@@ -30766,7 +30766,7 @@ pub fn analyzeAddressSpace(...@@ -30766,7 +30766,7 @@ pub fn analyzeAddressSpace(
3076630766
30767 const supported = switch (address_space) {30767 const supported = switch (address_space) {
30768 .generic => true,30768 .generic => true,
30769 .gs, .fs, .ss => (arch == .i386 or arch == .x86_64) and ctx == .pointer,30769 .gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer,
30770 // TODO: check that .shared and .local are left uninitialized30770 // TODO: check that .shared and .local are left uninitialized
30771 .param => is_nv,30771 .param => is_nv,
30772 .global, .shared, .local => is_gpu,30772 .global, .shared, .local => is_gpu,
src/codegen.zig+1-1
...@@ -110,7 +110,7 @@ pub fn generateFunction(...@@ -110,7 +110,7 @@ pub fn generateFunction(
110 //.tcele => return Function(.tcele).generate(bin_file, src_loc, func, air, liveness, code, debug_output),110 //.tcele => return Function(.tcele).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
111 //.thumb => return Function(.thumb).generate(bin_file, src_loc, func, air, liveness, code, debug_output),111 //.thumb => return Function(.thumb).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
112 //.thumbeb => return Function(.thumbeb).generate(bin_file, src_loc, func, air, liveness, code, debug_output),112 //.thumbeb => return Function(.thumbeb).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
113 //.i386 => return Function(.i386).generate(bin_file, src_loc, func, air, liveness, code, debug_output),113 //.x86 => return Function(.x86).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
114 .x86_64 => return @import("arch/x86_64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),114 .x86_64 => return @import("arch/x86_64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),
115 //.xcore => return Function(.xcore).generate(bin_file, src_loc, func, air, liveness, code, debug_output),115 //.xcore => return Function(.xcore).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
116 //.nvptx => return Function(.nvptx).generate(bin_file, src_loc, func, air, liveness, code, debug_output),116 //.nvptx => return Function(.nvptx).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
src/codegen/llvm.zig+9-9
...@@ -70,7 +70,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {...@@ -70,7 +70,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
70 .tcele => "tcele",70 .tcele => "tcele",
71 .thumb => "thumb",71 .thumb => "thumb",
72 .thumbeb => "thumbeb",72 .thumbeb => "thumbeb",
73 .i386 => "i386",73 .x86 => "i386",
74 .x86_64 => "x86_64",74 .x86_64 => "x86_64",
75 .xcore => "xcore",75 .xcore => "xcore",
76 .nvptx => "nvptx",76 .nvptx => "nvptx",
...@@ -282,7 +282,7 @@ pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {...@@ -282,7 +282,7 @@ pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
282 .tcele => .tcele,282 .tcele => .tcele,
283 .thumb => .thumb,283 .thumb => .thumb,
284 .thumbeb => .thumbeb,284 .thumbeb => .thumbeb,
285 .i386 => .x86,285 .x86 => .x86,
286 .x86_64 => .x86_64,286 .x86_64 => .x86_64,
287 .xcore => .xcore,287 .xcore => .xcore,
288 .nvptx => .nvptx,288 .nvptx => .nvptx,
...@@ -6195,7 +6195,7 @@ pub const FuncGen = struct {...@@ -6195,7 +6195,7 @@ pub const FuncGen = struct {
6195 // here then we may risk tripping LLVM bugs since anything not used by Clang tends6195 // here then we may risk tripping LLVM bugs since anything not used by Clang tends
6196 // to be buggy and regress often.6196 // to be buggy and regress often.
6197 switch (target.cpu.arch) {6197 switch (target.cpu.arch) {
6198 .x86_64, .i386 => {6198 .x86_64, .x86 => {
6199 if (total_i != 0) try llvm_constraints.append(self.gpa, ',');6199 if (total_i != 0) try llvm_constraints.append(self.gpa, ',');
6200 try llvm_constraints.appendSlice(self.gpa, "~{dirflag},~{fpsr},~{flags}");6200 try llvm_constraints.appendSlice(self.gpa, "~{dirflag},~{fpsr},~{flags}");
6201 total_i += 3;6201 total_i += 3;
...@@ -9275,7 +9275,7 @@ pub const FuncGen = struct {...@@ -9275,7 +9275,7 @@ pub const FuncGen = struct {
9275 switch (prefetch.cache) {9275 switch (prefetch.cache) {
9276 .instruction => switch (target.cpu.arch) {9276 .instruction => switch (target.cpu.arch) {
9277 .x86_64,9277 .x86_64,
9278 .i386,9278 .x86,
9279 .powerpc,9279 .powerpc,
9280 .powerpcle,9280 .powerpcle,
9281 .powerpc64,9281 .powerpc64,
...@@ -9856,7 +9856,7 @@ fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {...@@ -9856,7 +9856,7 @@ fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
9856 llvm.LLVMInitializeWebAssemblyAsmPrinter();9856 llvm.LLVMInitializeWebAssemblyAsmPrinter();
9857 llvm.LLVMInitializeWebAssemblyAsmParser();9857 llvm.LLVMInitializeWebAssemblyAsmParser();
9858 },9858 },
9859 .i386, .x86_64 => {9859 .x86, .x86_64 => {
9860 llvm.LLVMInitializeX86Target();9860 llvm.LLVMInitializeX86Target();
9861 llvm.LLVMInitializeX86TargetInfo();9861 llvm.LLVMInitializeX86TargetInfo();
9862 llvm.LLVMInitializeX86TargetMC();9862 llvm.LLVMInitializeX86TargetMC();
...@@ -9968,7 +9968,7 @@ fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: std.Target) llvm.Ca...@@ -9968,7 +9968,7 @@ fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: std.Target) llvm.Ca
9968 .Stdcall => .X86_StdCall,9968 .Stdcall => .X86_StdCall,
9969 .Fastcall => .X86_FastCall,9969 .Fastcall => .X86_FastCall,
9970 .Vectorcall => return switch (target.cpu.arch) {9970 .Vectorcall => return switch (target.cpu.arch) {
9971 .i386, .x86_64 => .X86_VectorCall,9971 .x86, .x86_64 => .X86_VectorCall,
9972 .aarch64, .aarch64_be, .aarch64_32 => .AArch64_VectorCall,9972 .aarch64, .aarch64_be, .aarch64_32 => .AArch64_VectorCall,
9973 else => unreachable,9973 else => unreachable,
9974 },9974 },
...@@ -9977,7 +9977,7 @@ fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: std.Target) llvm.Ca...@@ -9977,7 +9977,7 @@ fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: std.Target) llvm.Ca
9977 .AAPCS => .ARM_AAPCS,9977 .AAPCS => .ARM_AAPCS,
9978 .AAPCSVFP => .ARM_AAPCS_VFP,9978 .AAPCSVFP => .ARM_AAPCS_VFP,
9979 .Interrupt => return switch (target.cpu.arch) {9979 .Interrupt => return switch (target.cpu.arch) {
9980 .i386, .x86_64 => .X86_INTR,9980 .x86, .x86_64 => .X86_INTR,
9981 .avr => .AVR_INTR,9981 .avr => .AVR_INTR,
9982 .msp430 => .MSP430_INTR,9982 .msp430 => .MSP430_INTR,
9983 else => unreachable,9983 else => unreachable,
...@@ -9999,7 +9999,7 @@ fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: std.Target) llvm.Ca...@@ -9999,7 +9999,7 @@ fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: std.Target) llvm.Ca
9999/// Convert a zig-address space to an llvm address space.9999/// Convert a zig-address space to an llvm address space.
10000fn toLlvmAddressSpace(address_space: std.builtin.AddressSpace, target: std.Target) c_uint {10000fn toLlvmAddressSpace(address_space: std.builtin.AddressSpace, target: std.Target) c_uint {
10001 return switch (target.cpu.arch) {10001 return switch (target.cpu.arch) {
10002 .i386, .x86_64 => switch (address_space) {10002 .x86, .x86_64 => switch (address_space) {
10003 .generic => llvm.address_space.default,10003 .generic => llvm.address_space.default,
10004 .gs => llvm.address_space.x86.gs,10004 .gs => llvm.address_space.x86.gs,
10005 .fs => llvm.address_space.x86.fs,10005 .fs => llvm.address_space.x86.fs,
...@@ -10714,7 +10714,7 @@ fn isScalar(ty: Type) bool {...@@ -10714,7 +10714,7 @@ fn isScalar(ty: Type) bool {
10714/// and false if we expect LLVM to crash if it counters an x86_fp80 type.10714/// and false if we expect LLVM to crash if it counters an x86_fp80 type.
10715fn backendSupportsF80(target: std.Target) bool {10715fn backendSupportsF80(target: std.Target) bool {
10716 return switch (target.cpu.arch) {10716 return switch (target.cpu.arch) {
10717 .x86_64, .i386 => !std.Target.x86.featureSetHas(target.cpu.features, .soft_float),10717 .x86_64, .x86 => !std.Target.x86.featureSetHas(target.cpu.features, .soft_float),
10718 else => false,10718 else => false,
10719 };10719 };
10720}10720}
src/crash_report.zig+1-1
...@@ -205,7 +205,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any...@@ -205,7 +205,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any
205 };205 };
206206
207 const stack_ctx: StackContext = switch (builtin.cpu.arch) {207 const stack_ctx: StackContext = switch (builtin.cpu.arch) {
208 .i386 => ctx: {208 .x86 => ctx: {
209 const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr));209 const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr));
210 const ip = @intCast(usize, ctx.mcontext.gregs[os.REG.EIP]);210 const ip = @intCast(usize, ctx.mcontext.gregs[os.REG.EIP]);
211 const bp = @intCast(usize, ctx.mcontext.gregs[os.REG.EBP]);211 const bp = @intCast(usize, ctx.mcontext.gregs[os.REG.EBP]);
src/glibc.zig+4-4
...@@ -327,7 +327,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {...@@ -327,7 +327,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
327 });327 });
328 try add_include_dirs(comp, arena, &args);328 try add_include_dirs(comp, arena, &args);
329329
330 if (target.cpu.arch == .i386) {330 if (target.cpu.arch == .x86) {
331 // This prevents i386/sysdep.h from trying to do some331 // This prevents i386/sysdep.h from trying to do some
332 // silly and unnecessary inline asm hack that uses weird332 // silly and unnecessary inline asm hack that uses weird
333 // syntax that clang does not support.333 // syntax that clang does not support.
...@@ -406,7 +406,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![...@@ -406,7 +406,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![
406 }406 }
407 } else if (arch == .x86_64) {407 } else if (arch == .x86_64) {
408 try result.appendSlice("x86_64");408 try result.appendSlice("x86_64");
409 } else if (arch == .i386) {409 } else if (arch == .x86) {
410 try result.appendSlice("i386");410 try result.appendSlice("i386");
411 } else if (is_aarch64) {411 } else if (is_aarch64) {
412 try result.appendSlice("aarch64");412 try result.appendSlice("aarch64");
...@@ -504,7 +504,7 @@ fn add_include_dirs_arch(...@@ -504,7 +504,7 @@ fn add_include_dirs_arch(
504 opt_nptl: ?[]const u8,504 opt_nptl: ?[]const u8,
505 dir: []const u8,505 dir: []const u8,
506) error{OutOfMemory}!void {506) error{OutOfMemory}!void {
507 const is_x86 = arch == .i386 or arch == .x86_64;507 const is_x86 = arch == .x86 or arch == .x86_64;
508 const is_aarch64 = arch == .aarch64 or arch == .aarch64_be;508 const is_aarch64 = arch == .aarch64 or arch == .aarch64_be;
509 const is_ppc = arch == .powerpc or arch == .powerpc64 or arch == .powerpc64le;509 const is_ppc = arch == .powerpc or arch == .powerpc64 or arch == .powerpc64le;
510 const is_sparc = arch == .sparc or arch == .sparcel or arch == .sparc64;510 const is_sparc = arch == .sparc or arch == .sparcel or arch == .sparc64;
...@@ -521,7 +521,7 @@ fn add_include_dirs_arch(...@@ -521,7 +521,7 @@ fn add_include_dirs_arch(
521 try args.append("-I");521 try args.append("-I");
522 try args.append(try path.join(arena, &[_][]const u8{ dir, "x86_64" }));522 try args.append(try path.join(arena, &[_][]const u8{ dir, "x86_64" }));
523 }523 }
524 } else if (arch == .i386) {524 } else if (arch == .x86) {
525 if (opt_nptl) |nptl| {525 if (opt_nptl) |nptl| {
526 try args.append("-I");526 try args.append("-I");
527 try args.append(try path.join(arena, &[_][]const u8{ dir, "i386", nptl }));527 try args.append(try path.join(arena, &[_][]const u8{ dir, "i386", nptl }));
src/libc_installation.zig+2-2
...@@ -408,7 +408,7 @@ pub const LibCInstallation = struct {...@@ -408,7 +408,7 @@ pub const LibCInstallation = struct {
408 defer result_buf.deinit();408 defer result_buf.deinit();
409409
410 const arch_sub_dir = switch (builtin.target.cpu.arch) {410 const arch_sub_dir = switch (builtin.target.cpu.arch) {
411 .i386 => "x86",411 .x86 => "x86",
412 .x86_64 => "x64",412 .x86_64 => "x64",
413 .arm, .armeb => "arm",413 .arm, .armeb => "arm",
414 else => return error.UnsupportedArchitecture,414 else => return error.UnsupportedArchitecture,
...@@ -471,7 +471,7 @@ pub const LibCInstallation = struct {...@@ -471,7 +471,7 @@ pub const LibCInstallation = struct {
471 defer result_buf.deinit();471 defer result_buf.deinit();
472472
473 const arch_sub_dir = switch (builtin.target.cpu.arch) {473 const arch_sub_dir = switch (builtin.target.cpu.arch) {
474 .i386 => "x86",474 .x86 => "x86",
475 .x86_64 => "x64",475 .x86_64 => "x64",
476 .arm, .armeb => "arm",476 .arm, .armeb => "arm",
477 else => return error.UnsupportedArchitecture,477 else => return error.UnsupportedArchitecture,
src/link/Coff.zig+1-1
...@@ -1294,7 +1294,7 @@ pub fn updateDeclExports(...@@ -1294,7 +1294,7 @@ pub fn updateDeclExports(
1294 const exported_decl = module.declPtr(exp.exported_decl);1294 const exported_decl = module.declPtr(exp.exported_decl);
1295 if (exported_decl.getFunction() == null) continue;1295 if (exported_decl.getFunction() == null) continue;
1296 const winapi_cc = switch (self.base.options.target.cpu.arch) {1296 const winapi_cc = switch (self.base.options.target.cpu.arch) {
1297 .i386 => std.builtin.CallingConvention.Stdcall,1297 .x86 => std.builtin.CallingConvention.Stdcall,
1298 else => std.builtin.CallingConvention.C,1298 else => std.builtin.CallingConvention.C,
1299 };1299 };
1300 const decl_cc = exported_decl.ty.fnCallingConvention();1300 const decl_cc = exported_decl.ty.fnCallingConvention();
src/link/Coff/lld.zig+3-3
...@@ -197,7 +197,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod...@@ -197,7 +197,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod
197 try argv.append(try std.fmt.allocPrint(arena, "-BASE:{d}", .{image_base}));197 try argv.append(try std.fmt.allocPrint(arena, "-BASE:{d}", .{image_base}));
198 }198 }
199199
200 if (target.cpu.arch == .i386) {200 if (target.cpu.arch == .x86) {
201 try argv.append("-MACHINE:X86");201 try argv.append("-MACHINE:X86");
202 } else if (target.cpu.arch == .x86_64) {202 } else if (target.cpu.arch == .x86_64) {
203 try argv.append("-MACHINE:X64");203 try argv.append("-MACHINE:X64");
...@@ -380,7 +380,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod...@@ -380,7 +380,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod
380 if (target.abi.isGnu()) {380 if (target.abi.isGnu()) {
381 try argv.append("-lldmingw");381 try argv.append("-lldmingw");
382382
383 if (target.cpu.arch == .i386) {383 if (target.cpu.arch == .x86) {
384 try argv.append("-ALTERNATENAME:__image_base__=___ImageBase");384 try argv.append("-ALTERNATENAME:__image_base__=___ImageBase");
385 } else {385 } else {
386 try argv.append("-ALTERNATENAME:__image_base__=__ImageBase");386 try argv.append("-ALTERNATENAME:__image_base__=__ImageBase");
...@@ -388,7 +388,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod...@@ -388,7 +388,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod
388388
389 if (is_dyn_lib) {389 if (is_dyn_lib) {
390 try argv.append(try comp.get_libc_crt_file(arena, "dllcrt2.obj"));390 try argv.append(try comp.get_libc_crt_file(arena, "dllcrt2.obj"));
391 if (target.cpu.arch == .i386) {391 if (target.cpu.arch == .x86) {
392 try argv.append("-ALTERNATENAME:__DllMainCRTStartup@12=_DllMainCRTStartup@12");392 try argv.append("-ALTERNATENAME:__DllMainCRTStartup@12=_DllMainCRTStartup@12");
393 } else {393 } else {
394 try argv.append("-ALTERNATENAME:_DllMainCRTStartup=DllMainCRTStartup");394 try argv.append("-ALTERNATENAME:_DllMainCRTStartup=DllMainCRTStartup");
src/link/Elf.zig+1-1
...@@ -3004,7 +3004,7 @@ fn sectHeaderTo32(shdr: elf.Elf64_Shdr) elf.Elf32_Shdr {...@@ -3004,7 +3004,7 @@ fn sectHeaderTo32(shdr: elf.Elf64_Shdr) elf.Elf32_Shdr {
30043004
3005fn getLDMOption(target: std.Target) ?[]const u8 {3005fn getLDMOption(target: std.Target) ?[]const u8 {
3006 switch (target.cpu.arch) {3006 switch (target.cpu.arch) {
3007 .i386 => return "elf_i386",3007 .x86 => return "elf_i386",
3008 .aarch64 => return "aarch64linux",3008 .aarch64 => return "aarch64linux",
3009 .aarch64_be => return "aarch64_be_linux",3009 .aarch64_be => return "aarch64_be_linux",
3010 .arm, .thumb => return "armelf_linux_eabi",3010 .arm, .thumb => return "armelf_linux_eabi",
src/link/Plan9.zig+1-1
...@@ -150,7 +150,7 @@ pub fn defaultBaseAddrs(arch: std.Target.Cpu.Arch) Bases {...@@ -150,7 +150,7 @@ pub fn defaultBaseAddrs(arch: std.Target.Cpu.Arch) Bases {
150 .text = 0x200028,150 .text = 0x200028,
151 .data = 0x400000,151 .data = 0x400000,
152 },152 },
153 .i386 => .{153 .x86 => .{
154 // header size => 32 => 0x20154 // header size => 32 => 0x20
155 .text = 0x200020,155 .text = 0x200020,
156 .data = 0x400000,156 .data = 0x400000,
src/link/Plan9/aout.zig+2-2
...@@ -109,7 +109,7 @@ pub const R_MAGIC = _MAGIC(HDR_MAGIC, 28); // arm64...@@ -109,7 +109,7 @@ pub const R_MAGIC = _MAGIC(HDR_MAGIC, 28); // arm64
109109
110pub fn magicFromArch(arch: std.Target.Cpu.Arch) !u32 {110pub fn magicFromArch(arch: std.Target.Cpu.Arch) !u32 {
111 return switch (arch) {111 return switch (arch) {
112 .i386 => I_MAGIC,112 .x86 => I_MAGIC,
113 .sparc => K_MAGIC, // TODO should sparc64 and sparcel go here?113 .sparc => K_MAGIC, // TODO should sparc64 and sparcel go here?
114 .mips => V_MAGIC,114 .mips => V_MAGIC,
115 .arm => E_MAGIC,115 .arm => E_MAGIC,
...@@ -124,7 +124,7 @@ pub fn magicFromArch(arch: std.Target.Cpu.Arch) !u32 {...@@ -124,7 +124,7 @@ pub fn magicFromArch(arch: std.Target.Cpu.Arch) !u32 {
124/// gets the quantization of pc for the arch124/// gets the quantization of pc for the arch
125pub fn getPCQuant(arch: std.Target.Cpu.Arch) !u8 {125pub fn getPCQuant(arch: std.Target.Cpu.Arch) !u8 {
126 return switch (arch) {126 return switch (arch) {
127 .i386, .x86_64 => 1,127 .x86, .x86_64 => 1,
128 .powerpc, .powerpc64, .mips, .sparc, .arm, .aarch64 => 4,128 .powerpc, .powerpc64, .mips, .sparc, .arm, .aarch64 => 4,
129 else => error.ArchNotSupportedByPlan9,129 else => error.ArchNotSupportedByPlan9,
130 };130 };
src/mingw.zig+4-4
...@@ -128,7 +128,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {...@@ -128,7 +128,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
128 .extra_flags = extra_flags,128 .extra_flags = extra_flags,
129 };129 };
130 }130 }
131 if (comp.getTarget().cpu.arch == .i386) {131 if (comp.getTarget().cpu.arch == .x86) {
132 for (msvcrt_i386_src) |dep| {132 for (msvcrt_i386_src) |dep| {
133 (try c_source_files.addOne()).* = .{133 (try c_source_files.addOne()).* = .{
134 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{134 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
...@@ -180,7 +180,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {...@@ -180,7 +180,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
180 };180 };
181 }181 }
182 const target = comp.getTarget();182 const target = comp.getTarget();
183 if (target.cpu.arch == .i386 or target.cpu.arch == .x86_64) {183 if (target.cpu.arch == .x86 or target.cpu.arch == .x86_64) {
184 for (mingwex_x86_src) |dep| {184 for (mingwex_x86_src) |dep| {
185 (try c_source_files.addOne()).* = .{185 (try c_source_files.addOne()).* = .{
186 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{186 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
...@@ -338,7 +338,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {...@@ -338,7 +338,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
338 });338 });
339339
340 const target_def_arg = switch (target.cpu.arch) {340 const target_def_arg = switch (target.cpu.arch) {
341 .i386 => "-DDEF_I386",341 .x86 => "-DDEF_I386",
342 .x86_64 => "-DDEF_X64",342 .x86_64 => "-DDEF_X64",
343 .arm, .armeb, .thumb, .thumbeb, .aarch64_32 => "-DDEF_ARM32",343 .arm, .armeb, .thumb, .thumbeb, .aarch64_32 => "-DDEF_ARM32",
344 .aarch64, .aarch64_be => "-DDEF_ARM64",344 .aarch64, .aarch64_be => "-DDEF_ARM64",
...@@ -434,7 +434,7 @@ fn findDef(comp: *Compilation, allocator: Allocator, lib_name: []const u8) ![]u8...@@ -434,7 +434,7 @@ fn findDef(comp: *Compilation, allocator: Allocator, lib_name: []const u8) ![]u8
434 const target = comp.getTarget();434 const target = comp.getTarget();
435435
436 const lib_path = switch (target.cpu.arch) {436 const lib_path = switch (target.cpu.arch) {
437 .i386 => "lib32",437 .x86 => "lib32",
438 .x86_64 => "lib64",438 .x86_64 => "lib64",
439 .arm, .armeb, .thumb, .thumbeb, .aarch64_32 => "libarm32",439 .arm, .armeb, .thumb, .thumbeb, .aarch64_32 => "libarm32",
440 .aarch64, .aarch64_be => "libarm64",440 .aarch64, .aarch64_be => "libarm64",
src/musl.zig+1-1
...@@ -262,7 +262,7 @@ pub fn archName(arch: std.Target.Cpu.Arch) [:0]const u8 {...@@ -262,7 +262,7 @@ pub fn archName(arch: std.Target.Cpu.Arch) [:0]const u8 {
262 switch (arch) {262 switch (arch) {
263 .aarch64, .aarch64_be => return "aarch64",263 .aarch64, .aarch64_be => return "aarch64",
264 .arm, .armeb, .thumb, .thumbeb => return "arm",264 .arm, .armeb, .thumb, .thumbeb => return "arm",
265 .i386 => return "i386",265 .x86 => return "i386",
266 .mips, .mipsel => return "mips",266 .mips, .mipsel => return "mips",
267 .mips64el, .mips64 => return "mips64",267 .mips64el, .mips64 => return "mips64",
268 .powerpc => return "powerpc",268 .powerpc => return "powerpc",
src/target.zig+9-9
...@@ -35,9 +35,9 @@ pub const available_libcs = [_]ArchOsAbi{...@@ -35,9 +35,9 @@ pub const available_libcs = [_]ArchOsAbi{
35 .{ .arch = .arm, .os = .windows, .abi = .gnu },35 .{ .arch = .arm, .os = .windows, .abi = .gnu },
36 .{ .arch = .csky, .os = .linux, .abi = .gnueabi },36 .{ .arch = .csky, .os = .linux, .abi = .gnueabi },
37 .{ .arch = .csky, .os = .linux, .abi = .gnueabihf },37 .{ .arch = .csky, .os = .linux, .abi = .gnueabihf },
38 .{ .arch = .i386, .os = .linux, .abi = .gnu },38 .{ .arch = .x86, .os = .linux, .abi = .gnu },
39 .{ .arch = .i386, .os = .linux, .abi = .musl },39 .{ .arch = .x86, .os = .linux, .abi = .musl },
40 .{ .arch = .i386, .os = .windows, .abi = .gnu },40 .{ .arch = .x86, .os = .windows, .abi = .gnu },
41 .{ .arch = .m68k, .os = .linux, .abi = .gnu },41 .{ .arch = .m68k, .os = .linux, .abi = .gnu },
42 .{ .arch = .m68k, .os = .linux, .abi = .musl },42 .{ .arch = .m68k, .os = .linux, .abi = .musl },
43 .{ .arch = .mips64el, .os = .linux, .abi = .gnuabi64 },43 .{ .arch = .mips64el, .os = .linux, .abi = .gnuabi64 },
...@@ -137,7 +137,7 @@ pub fn osArchName(target: std.Target) [:0]const u8 {...@@ -137,7 +137,7 @@ pub fn osArchName(target: std.Target) [:0]const u8 {
137 .powerpc, .powerpcle, .powerpc64, .powerpc64le => "powerpc",137 .powerpc, .powerpcle, .powerpc64, .powerpc64le => "powerpc",
138 .riscv32, .riscv64 => "riscv",138 .riscv32, .riscv64 => "riscv",
139 .sparc, .sparcel, .sparc64 => "sparc",139 .sparc, .sparcel, .sparc64 => "sparc",
140 .i386, .x86_64 => "x86",140 .x86, .x86_64 => "x86",
141 else => @tagName(target.cpu.arch),141 else => @tagName(target.cpu.arch),
142 },142 },
143 else => @tagName(target.cpu.arch),143 else => @tagName(target.cpu.arch),
...@@ -278,7 +278,7 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {...@@ -278,7 +278,7 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
278 .tcele,278 .tcele,
279 .thumb,279 .thumb,
280 .thumbeb,280 .thumbeb,
281 .i386,281 .x86,
282 .x86_64,282 .x86_64,
283 .xcore,283 .xcore,
284 .nvptx,284 .nvptx,
...@@ -319,7 +319,7 @@ pub fn selfHostedBackendIsAsRobustAsLlvm(target: std.Target) bool {...@@ -319,7 +319,7 @@ pub fn selfHostedBackendIsAsRobustAsLlvm(target: std.Target) bool {
319319
320pub fn supportsStackProbing(target: std.Target) bool {320pub fn supportsStackProbing(target: std.Target) bool {
321 return target.os.tag != .windows and target.os.tag != .uefi and321 return target.os.tag != .windows and target.os.tag != .uefi and
322 (target.cpu.arch == .i386 or target.cpu.arch == .x86_64);322 (target.cpu.arch == .x86 or target.cpu.arch == .x86_64);
323}323}
324324
325pub fn supportsStackProtector(target: std.Target) bool {325pub fn supportsStackProtector(target: std.Target) bool {
...@@ -431,7 +431,7 @@ pub fn defaultCompilerRtOptimizeMode(target: std.Target) std.builtin.Mode {...@@ -431,7 +431,7 @@ pub fn defaultCompilerRtOptimizeMode(target: std.Target) std.builtin.Mode {
431pub fn hasRedZone(target: std.Target) bool {431pub fn hasRedZone(target: std.Target) bool {
432 return switch (target.cpu.arch) {432 return switch (target.cpu.arch) {
433 .x86_64,433 .x86_64,
434 .i386,434 .x86,
435 .powerpc,435 .powerpc,
436 .powerpc64,436 .powerpc64,
437 .powerpc64le,437 .powerpc64le,
...@@ -550,7 +550,7 @@ pub fn atomicPtrAlignment(...@@ -550,7 +550,7 @@ pub fn atomicPtrAlignment(
550 .tcele,550 .tcele,
551 .thumb,551 .thumb,
552 .thumbeb,552 .thumbeb,
553 .i386,553 .x86,
554 .xcore,554 .xcore,
555 .amdil,555 .amdil,
556 .hsail,556 .hsail,
...@@ -655,7 +655,7 @@ pub fn addrSpaceCastIsValid(...@@ -655,7 +655,7 @@ pub fn addrSpaceCastIsValid(
655) bool {655) bool {
656 const arch = target.cpu.arch;656 const arch = target.cpu.arch;
657 switch (arch) {657 switch (arch) {
658 .x86_64, .i386 => return arch.supportsAddressSpace(from) and arch.supportsAddressSpace(to),658 .x86_64, .x86 => return arch.supportsAddressSpace(from) and arch.supportsAddressSpace(to),
659 .nvptx64, .nvptx, .amdgcn => {659 .nvptx64, .nvptx, .amdgcn => {
660 const to_generic = arch.supportsAddressSpace(from) and to == .generic;660 const to_generic = arch.supportsAddressSpace(from) and to == .generic;
661 const from_generic = arch.supportsAddressSpace(to) and from == .generic;661 const from_generic = arch.supportsAddressSpace(to) and from == .generic;
src/type.zig+9-9
...@@ -6653,7 +6653,7 @@ pub const CType = enum {...@@ -6653,7 +6653,7 @@ pub const CType = enum {
6653 .long, .ulong => return target.cpu.arch.ptrBitWidth(),6653 .long, .ulong => return target.cpu.arch.ptrBitWidth(),
6654 .longlong, .ulonglong, .double => return 64,6654 .longlong, .ulonglong, .double => return 64,
6655 .longdouble => switch (target.cpu.arch) {6655 .longdouble => switch (target.cpu.arch) {
6656 .i386 => switch (target.abi) {6656 .x86 => switch (target.abi) {
6657 .android => return 64,6657 .android => return 64,
6658 else => return 80,6658 else => return 80,
6659 },6659 },
...@@ -6741,7 +6741,7 @@ pub const CType = enum {...@@ -6741,7 +6741,7 @@ pub const CType = enum {
6741 .long, .ulong => return target.cpu.arch.ptrBitWidth(),6741 .long, .ulong => return target.cpu.arch.ptrBitWidth(),
6742 .longlong, .ulonglong, .double => return 64,6742 .longlong, .ulonglong, .double => return 64,
6743 .longdouble => switch (target.cpu.arch) {6743 .longdouble => switch (target.cpu.arch) {
6744 .i386 => switch (target.abi) {6744 .x86 => switch (target.abi) {
6745 .android => return 64,6745 .android => return 64,
6746 else => return 80,6746 else => return 80,
6747 },6747 },
...@@ -6795,7 +6795,7 @@ pub const CType = enum {...@@ -6795,7 +6795,7 @@ pub const CType = enum {
6795 },6795 },
67966796
6797 .windows, .uefi => switch (target.cpu.arch) {6797 .windows, .uefi => switch (target.cpu.arch) {
6798 .i386 => switch (self) {6798 .x86 => switch (self) {
6799 .short, .ushort => return 16,6799 .short, .ushort => return 16,
6800 .int, .uint, .float => return 32,6800 .int, .uint, .float => return 32,
6801 .long, .ulong => return 32,6801 .long, .ulong => return 32,
...@@ -6831,7 +6831,7 @@ pub const CType = enum {...@@ -6831,7 +6831,7 @@ pub const CType = enum {
6831 .short, .ushort => return 16,6831 .short, .ushort => return 16,
6832 .int, .uint, .float => return 32,6832 .int, .uint, .float => return 32,
6833 .long, .ulong => switch (target.cpu.arch) {6833 .long, .ulong => switch (target.cpu.arch) {
6834 .i386, .arm, .aarch64_32 => return 32,6834 .x86, .arm, .aarch64_32 => return 32,
6835 .x86_64 => switch (target.abi) {6835 .x86_64 => switch (target.abi) {
6836 .gnux32, .muslx32 => return 32,6836 .gnux32, .muslx32 => return 32,
6837 else => return 64,6837 else => return 64,
...@@ -6840,7 +6840,7 @@ pub const CType = enum {...@@ -6840,7 +6840,7 @@ pub const CType = enum {
6840 },6840 },
6841 .longlong, .ulonglong, .double => return 64,6841 .longlong, .ulonglong, .double => return 64,
6842 .longdouble => switch (target.cpu.arch) {6842 .longdouble => switch (target.cpu.arch) {
6843 .i386 => switch (target.abi) {6843 .x86 => switch (target.abi) {
6844 .android => return 64,6844 .android => return 64,
6845 else => return 80,6845 else => return 80,
6846 },6846 },
...@@ -6899,7 +6899,7 @@ pub const CType = enum {...@@ -6899,7 +6899,7 @@ pub const CType = enum {
6899 .short, .ushort => return 2,6899 .short, .ushort => return 2,
6900 else => return 1,6900 else => return 1,
6901 },6901 },
6902 .i386 => switch (target.os.tag) {6902 .x86 => switch (target.os.tag) {
6903 .windows, .uefi => switch (self) {6903 .windows, .uefi => switch (self) {
6904 .longlong, .ulonglong, .double => return 8,6904 .longlong, .ulonglong, .double => return 8,
6905 .longdouble => switch (target.abi) {6905 .longdouble => switch (target.abi) {
...@@ -6940,7 +6940,7 @@ pub const CType = enum {...@@ -6940,7 +6940,7 @@ pub const CType = enum {
69406940
6941 .arc,6941 .arc,
6942 .csky,6942 .csky,
6943 .i386,6943 .x86,
6944 .xcore,6944 .xcore,
6945 .dxil,6945 .dxil,
6946 .loongarch32,6946 .loongarch32,
...@@ -7037,7 +7037,7 @@ pub const CType = enum {...@@ -7037,7 +7037,7 @@ pub const CType = enum {
7037 .double => return 4,7037 .double => return 4,
7038 .longlong, .ulonglong => return 8,7038 .longlong, .ulonglong => return 8,
7039 },7039 },
7040 .i386 => switch (target.os.tag) {7040 .x86 => switch (target.os.tag) {
7041 .windows, .uefi => switch (self) {7041 .windows, .uefi => switch (self) {
7042 .longdouble => switch (target.abi) {7042 .longdouble => switch (target.abi) {
7043 .gnu, .gnuilp32, .cygnus => return 4,7043 .gnu, .gnuilp32, .cygnus => return 4,
...@@ -7090,7 +7090,7 @@ pub const CType = enum {...@@ -7090,7 +7090,7 @@ pub const CType = enum {
7090 .bpfeb,7090 .bpfeb,
7091 .hexagon,7091 .hexagon,
7092 .hsail64,7092 .hsail64,
7093 .i386,7093 .x86,
7094 .loongarch64,7094 .loongarch64,
7095 .m68k,7095 .m68k,
7096 .mips,7096 .mips,
src/windows_sdk.cpp+5-5
...@@ -21,7 +21,7 @@ struct ZigWindowsSDKPrivate {...@@ -21,7 +21,7 @@ struct ZigWindowsSDKPrivate {
2121
22enum NativeArch {22enum NativeArch {
23 NativeArchArm,23 NativeArchArm,
24 NativeArchi386,24 NativeArchx86,
25 NativeArchx86_64,25 NativeArchx86_64,
26 NativeArchAarch64,26 NativeArchAarch64,
27};27};
...@@ -29,7 +29,7 @@ enum NativeArch {...@@ -29,7 +29,7 @@ enum NativeArch {
29#if defined(_M_ARM) || defined(__arm_)29#if defined(_M_ARM) || defined(__arm_)
30static const NativeArch native_arch = NativeArchArm;30static const NativeArch native_arch = NativeArchArm;
31#elif defined(_M_IX86) || defined(__i386__)31#elif defined(_M_IX86) || defined(__i386__)
32static const NativeArch native_arch = NativeArchi386;32static const NativeArch native_arch = NativeArchx86;
33#elif defined(_M_X64) || defined(__x86_64__)33#elif defined(_M_X64) || defined(__x86_64__)
34static const NativeArch native_arch = NativeArchx86_64;34static const NativeArch native_arch = NativeArchx86_64;
35#elif defined(_M_ARM64) || defined(__aarch64__)35#elif defined(_M_ARM64) || defined(__aarch64__)
...@@ -110,7 +110,7 @@ static ZigFindWindowsSdkError find_msvc_lib_dir(ZigWindowsSDKPrivate *priv) {...@@ -110,7 +110,7 @@ static ZigFindWindowsSdkError find_msvc_lib_dir(ZigWindowsSDKPrivate *priv) {
110 fclose(tools_file);110 fclose(tools_file);
111 out_append_ptr += sprintf(out_append_ptr, "VC\\Tools\\MSVC\\%s\\lib\\", tmp_path);111 out_append_ptr += sprintf(out_append_ptr, "VC\\Tools\\MSVC\\%s\\lib\\", tmp_path);
112 switch (native_arch) {112 switch (native_arch) {
113 case NativeArchi386:113 case NativeArchx86:
114 out_append_ptr += sprintf(out_append_ptr, "x86\\");114 out_append_ptr += sprintf(out_append_ptr, "x86\\");
115 break;115 break;
116 case NativeArchx86_64:116 case NativeArchx86_64:
...@@ -158,7 +158,7 @@ com_done:;...@@ -158,7 +158,7 @@ com_done:;
158 char *tmp_buf_append_ptr = tmp_buf + (cb_data - 1);158 char *tmp_buf_append_ptr = tmp_buf + (cb_data - 1);
159 tmp_buf_append_ptr += sprintf(tmp_buf_append_ptr, "VC\\Lib\\");159 tmp_buf_append_ptr += sprintf(tmp_buf_append_ptr, "VC\\Lib\\");
160 switch (native_arch) {160 switch (native_arch) {
161 case NativeArchi386:161 case NativeArchx86:
162 //x86 is in the root of the Lib folder162 //x86 is in the root of the Lib folder
163 break;163 break;
164 case NativeArchx86_64:164 case NativeArchx86_64:
...@@ -219,7 +219,7 @@ static ZigFindWindowsSdkError find_10_version(ZigWindowsSDKPrivate *priv) {...@@ -219,7 +219,7 @@ static ZigFindWindowsSdkError find_10_version(ZigWindowsSDKPrivate *priv) {
219 case NativeArchx86_64:219 case NativeArchx86_64:
220 option_name = "OptionId.DesktopCPPx64";220 option_name = "OptionId.DesktopCPPx64";
221 break;221 break;
222 case NativeArchi386:222 case NativeArchx86:
223 option_name = "OptionId.DesktopCPPx86";223 option_name = "OptionId.DesktopCPPx86";
224 break;224 break;
225 default:225 default:
test/behavior/align.zig+1-1
...@@ -107,7 +107,7 @@ test "alignment and size of structs with 128-bit fields" {...@@ -107,7 +107,7 @@ test "alignment and size of structs with 128-bit fields" {
107 .u129_size = 24,107 .u129_size = 24,
108 },108 },
109109
110 .i386 => switch (builtin.os.tag) {110 .x86 => switch (builtin.os.tag) {
111 .windows => .{111 .windows => .{
112 .a_align = 8,112 .a_align = 8,
113 .a_size = 16,113 .a_size = 16,
test/behavior/floatop.zig+1-1
...@@ -5,7 +5,7 @@ const math = std.math;...@@ -5,7 +5,7 @@ const math = std.math;
5const pi = std.math.pi;5const pi = std.math.pi;
6const e = std.math.e;6const e = std.math.e;
7const has_f80_rt = switch (builtin.cpu.arch) {7const has_f80_rt = switch (builtin.cpu.arch) {
8 .x86_64, .i386 => true,8 .x86_64, .x86 => true,
9 else => false,9 else => false,
10};10};
1111
test/behavior/fn.zig+2-2
...@@ -150,9 +150,9 @@ test "extern struct with stdcallcc fn pointer" {...@@ -150,9 +150,9 @@ test "extern struct with stdcallcc fn pointer" {
150 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;150 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
151151
152 const S = extern struct {152 const S = extern struct {
153 ptr: *const fn () callconv(if (builtin.target.cpu.arch == .i386) .Stdcall else .C) i32,153 ptr: *const fn () callconv(if (builtin.target.cpu.arch == .x86) .Stdcall else .C) i32,
154154
155 fn foo() callconv(if (builtin.target.cpu.arch == .i386) .Stdcall else .C) i32 {155 fn foo() callconv(if (builtin.target.cpu.arch == .x86) .Stdcall else .C) i32 {
156 return 1234;156 return 1234;
157 }157 }
158 };158 };
test/behavior/struct.zig+1-1
...@@ -1109,7 +1109,7 @@ test "packed struct with undefined initializers" {...@@ -1109,7 +1109,7 @@ test "packed struct with undefined initializers" {
1109 var p: P = undefined;1109 var p: P = undefined;
1110 p = P{ .a = 2, .b = 4, .c = 6 };1110 p = P{ .a = 2, .b = 4, .c = 6 };
1111 // Make sure the compiler doesn't touch the unprefixed fields.1111 // Make sure the compiler doesn't touch the unprefixed fields.
1112 // Use expect since i386-linux doesn't like expectEqual1112 // Use expect since x86-linux doesn't like expectEqual
1113 try expect(p.a == 2);1113 try expect(p.a == 2);
1114 try expect(p.b == 4);1114 try expect(p.b == 4);
1115 try expect(p.c == 6);1115 try expect(p.c == 6);
test/behavior/vector.zig+1-1
...@@ -639,7 +639,7 @@ test "vector shift operators" {...@@ -639,7 +639,7 @@ test "vector shift operators" {
639 };639 };
640640
641 switch (builtin.target.cpu.arch) {641 switch (builtin.target.cpu.arch) {
642 .i386,642 .x86,
643 .aarch64,643 .aarch64,
644 .aarch64_be,644 .aarch64_be,
645 .aarch64_32,645 .aarch64_32,
test/c_abi/main.zig+10-10
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const builtin = @import("builtin");2const builtin = @import("builtin");
3const print = std.debug.print;3const print = std.debug.print;
4const expect = std.testing.expect;4const expect = std.testing.expect;
5const has_i128 = builtin.cpu.arch != .i386 and !builtin.cpu.arch.isARM() and5const has_i128 = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isARM() and
6 !builtin.cpu.arch.isMIPS() and !builtin.cpu.arch.isPPC();6 !builtin.cpu.arch.isMIPS() and !builtin.cpu.arch.isPPC();
77
8extern fn run_c_tests() void;8extern fn run_c_tests() void;
...@@ -153,7 +153,7 @@ export fn zig_bool(x: bool) void {...@@ -153,7 +153,7 @@ export fn zig_bool(x: bool) void {
153// https://github.com/ziglang/zig/issues/8465153// https://github.com/ziglang/zig/issues/8465
154//154//
155// For now, we have no way of referring to the _Complex C types from Zig,155// For now, we have no way of referring to the _Complex C types from Zig,
156// so our ABI is unavoidably broken on some platforms (such as i386)156// so our ABI is unavoidably broken on some platforms (such as x86)
157const ComplexFloat = extern struct {157const ComplexFloat = extern struct {
158 real: f32,158 real: f32,
159 imag: f32,159 imag: f32,
...@@ -170,7 +170,7 @@ extern fn c_cmultd_comp(a_r: f64, a_i: f64, b_r: f64, b_i: f64) ComplexDouble;...@@ -170,7 +170,7 @@ extern fn c_cmultd_comp(a_r: f64, a_i: f64, b_r: f64, b_i: f64) ComplexDouble;
170extern fn c_cmultf(a: ComplexFloat, b: ComplexFloat) ComplexFloat;170extern fn c_cmultf(a: ComplexFloat, b: ComplexFloat) ComplexFloat;
171extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;171extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;
172172
173const complex_abi_compatible = builtin.cpu.arch != .i386 and !builtin.cpu.arch.isMIPS() and173const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and
174 !builtin.cpu.arch.isARM() and !builtin.cpu.arch.isPPC() and !builtin.cpu.arch.isRISCV();174 !builtin.cpu.arch.isARM() and !builtin.cpu.arch.isPPC() and !builtin.cpu.arch.isRISCV();
175175
176test "C ABI complex float" {176test "C ABI complex float" {
...@@ -323,7 +323,7 @@ extern fn c_med_struct_mixed(MedStructMixed) void;...@@ -323,7 +323,7 @@ extern fn c_med_struct_mixed(MedStructMixed) void;
323extern fn c_ret_med_struct_mixed() MedStructMixed;323extern fn c_ret_med_struct_mixed() MedStructMixed;
324324
325test "C ABI medium struct of ints and floats" {325test "C ABI medium struct of ints and floats" {
326 if (builtin.cpu.arch == .i386) return error.SkipZigTest;326 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
327 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;327 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
328 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;328 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
329 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;329 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
...@@ -356,7 +356,7 @@ extern fn c_small_struct_ints(SmallStructInts) void;...@@ -356,7 +356,7 @@ extern fn c_small_struct_ints(SmallStructInts) void;
356extern fn c_ret_small_struct_ints() SmallStructInts;356extern fn c_ret_small_struct_ints() SmallStructInts;
357357
358test "C ABI small struct of ints" {358test "C ABI small struct of ints" {
359 if (builtin.cpu.arch == .i386) return error.SkipZigTest;359 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
360 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;360 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
361 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;361 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
362 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;362 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
...@@ -438,7 +438,7 @@ const SplitStructInt = extern struct {...@@ -438,7 +438,7 @@ const SplitStructInt = extern struct {
438extern fn c_split_struct_ints(SplitStructInt) void;438extern fn c_split_struct_ints(SplitStructInt) void;
439439
440test "C ABI split struct of ints" {440test "C ABI split struct of ints" {
441 if (builtin.cpu.arch == .i386) return error.SkipZigTest;441 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
442 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;442 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
443 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;443 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
444 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;444 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
...@@ -466,7 +466,7 @@ extern fn c_split_struct_mixed(SplitStructMixed) void;...@@ -466,7 +466,7 @@ extern fn c_split_struct_mixed(SplitStructMixed) void;
466extern fn c_ret_split_struct_mixed() SplitStructMixed;466extern fn c_ret_split_struct_mixed() SplitStructMixed;
467467
468test "C ABI split struct of ints and floats" {468test "C ABI split struct of ints and floats" {
469 if (builtin.cpu.arch == .i386) return error.SkipZigTest;469 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
470 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;470 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
471 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;471 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
472 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;472 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
...@@ -729,7 +729,7 @@ extern fn c_struct_with_array(StructWithArray) void;...@@ -729,7 +729,7 @@ extern fn c_struct_with_array(StructWithArray) void;
729extern fn c_ret_struct_with_array() StructWithArray;729extern fn c_ret_struct_with_array() StructWithArray;
730730
731test "Struct with array as padding." {731test "Struct with array as padding." {
732 if (builtin.cpu.arch == .i386) return error.SkipZigTest;732 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
733 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;733 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
734 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;734 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
735 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;735 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
...@@ -783,7 +783,7 @@ extern fn c_small_vec(SmallVec) void;...@@ -783,7 +783,7 @@ extern fn c_small_vec(SmallVec) void;
783extern fn c_ret_small_vec() SmallVec;783extern fn c_ret_small_vec() SmallVec;
784784
785test "small simd vector" {785test "small simd vector" {
786 if (builtin.cpu.arch == .i386) return error.SkipZigTest;786 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
787 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;787 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
788788
789 c_small_vec(.{ 1, 2 });789 c_small_vec(.{ 1, 2 });
...@@ -820,7 +820,7 @@ extern fn c_ptr_size_float_struct(Vector2) void;...@@ -820,7 +820,7 @@ extern fn c_ptr_size_float_struct(Vector2) void;
820extern fn c_ret_ptr_size_float_struct() Vector2;820extern fn c_ret_ptr_size_float_struct() Vector2;
821821
822test "C ABI pointer sized float struct" {822test "C ABI pointer sized float struct" {
823 if (builtin.cpu.arch == .i386) return error.SkipZigTest;823 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
824 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;824 if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
825 if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest;825 if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
826 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;826 if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest;
test/cases/compile_errors/callconv_interrupt_on_unsupported_platform.zig+1-1
...@@ -4,4 +4,4 @@ export fn entry() callconv(.Interrupt) void {}...@@ -4,4 +4,4 @@ export fn entry() callconv(.Interrupt) void {}
4// backend=stage24// backend=stage2
5// target=aarch64-linux-none5// target=aarch64-linux-none
6//6//
7// :1:29: error: callconv 'Interrupt' is only available on i386, x86_64, AVR, and MSP430, not aarch647// :1:29: error: callconv 'Interrupt' is only available on x86, x86_64, AVR, and MSP430, not aarch64
test/cases/compile_errors/callconv_stdcall_fastcall_thiscall_on_unsupported_platform.zig+3-3
...@@ -18,6 +18,6 @@ export fn entry3() void {...@@ -18,6 +18,6 @@ export fn entry3() void {
18// backend=stage218// backend=stage2
19// target=x86_64-linux-none19// target=x86_64-linux-none
20//20//
21// :1:28: error: callconv 'Stdcall' is only available on i386, not x86_6421// :1:28: error: callconv 'Stdcall' is only available on x86, not x86_64
22// :2:28: error: callconv 'Fastcall' is only available on i386, not x86_6422// :2:28: error: callconv 'Fastcall' is only available on x86, not x86_64
23// :3:28: error: callconv 'Thiscall' is only available on i386, not x86_6423// :3:28: error: callconv 'Thiscall' is only available on x86, not x86_64
test/cases/compile_errors/callconv_vectorcall_on_unsupported_platform.zig+1-1
...@@ -4,4 +4,4 @@ export fn entry() callconv(.Vectorcall) void {}...@@ -4,4 +4,4 @@ export fn entry() callconv(.Vectorcall) void {}
4// backend=stage24// backend=stage2
5// target=x86_64-linux-none5// target=x86_64-linux-none
6//6//
7// :1:29: error: callconv 'Vectorcall' is only available on i386 and AArch64, not x86_647// :1:29: error: callconv 'Vectorcall' is only available on x86 and AArch64, not x86_64
test/tests.zig+6-6
...@@ -163,14 +163,14 @@ const test_targets = blk: {...@@ -163,14 +163,14 @@ const test_targets = blk: {
163163
164 .{164 .{
165 .target = .{165 .target = .{
166 .cpu_arch = .i386,166 .cpu_arch = .x86,
167 .os_tag = .linux,167 .os_tag = .linux,
168 .abi = .none,168 .abi = .none,
169 },169 },
170 },170 },
171 .{171 .{
172 .target = .{172 .target = .{
173 .cpu_arch = .i386,173 .cpu_arch = .x86,
174 .os_tag = .linux,174 .os_tag = .linux,
175 .abi = .musl,175 .abi = .musl,
176 },176 },
...@@ -178,7 +178,7 @@ const test_targets = blk: {...@@ -178,7 +178,7 @@ const test_targets = blk: {
178 },178 },
179 .{179 .{
180 .target = .{180 .target = .{
181 .cpu_arch = .i386,181 .cpu_arch = .x86,
182 .os_tag = .linux,182 .os_tag = .linux,
183 .abi = .gnu,183 .abi = .gnu,
184 },184 },
...@@ -387,7 +387,7 @@ const test_targets = blk: {...@@ -387,7 +387,7 @@ const test_targets = blk: {
387387
388 .{388 .{
389 .target = .{389 .target = .{
390 .cpu_arch = .i386,390 .cpu_arch = .x86,
391 .os_tag = .windows,391 .os_tag = .windows,
392 .abi = .msvc,392 .abi = .msvc,
393 },393 },
...@@ -403,7 +403,7 @@ const test_targets = blk: {...@@ -403,7 +403,7 @@ const test_targets = blk: {
403403
404 .{404 .{
405 .target = .{405 .target = .{
406 .cpu_arch = .i386,406 .cpu_arch = .x86,
407 .os_tag = .windows,407 .os_tag = .windows,
408 .abi = .gnu,408 .abi = .gnu,
409 },409 },
...@@ -1279,7 +1279,7 @@ const c_abi_targets = [_]CrossTarget{...@@ -1279,7 +1279,7 @@ const c_abi_targets = [_]CrossTarget{
1279 .abi = .musl,1279 .abi = .musl,
1280 },1280 },
1281 .{1281 .{
1282 .cpu_arch = .i386,1282 .cpu_arch = .x86,
1283 .os_tag = .linux,1283 .os_tag = .linux,
1284 .abi = .musl,1284 .abi = .musl,
1285 },1285 },
test/translate_c.zig+1-1
...@@ -1775,7 +1775,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -1775,7 +1775,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
1775 }1775 }
17761776
1777 cases.addWithTarget("Calling convention", .{1777 cases.addWithTarget("Calling convention", .{
1778 .cpu_arch = .i386,1778 .cpu_arch = .x86,
1779 .os_tag = .linux,1779 .os_tag = .linux,
1780 .abi = .none,1780 .abi = .none,
1781 },1781 },
tools/gen_stubs.zig+7-7
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2//! ./gen_stubs /path/to/musl/build-all >libc.S2//! ./gen_stubs /path/to/musl/build-all >libc.S
3//!3//!
4//! The directory 'build-all' is expected to contain these subdirectories:4//! The directory 'build-all' is expected to contain these subdirectories:
5//! arm i386 mips mips64 powerpc powerpc64 riscv64 x86_645//! arm x86 mips mips64 powerpc powerpc64 riscv64 x86_64
6//!6//!
7//! ...each with 'lib/libc.so' inside of them.7//! ...each with 'lib/libc.so' inside of them.
8//!8//!
...@@ -30,7 +30,7 @@ const native_endian = @import("builtin").target.cpu.arch.endian();...@@ -30,7 +30,7 @@ const native_endian = @import("builtin").target.cpu.arch.endian();
3030
31const arches: [7]std.Target.Cpu.Arch = blk: {31const arches: [7]std.Target.Cpu.Arch = blk: {
32 var result: [7]std.Target.Cpu.Arch = undefined;32 var result: [7]std.Target.Cpu.Arch = undefined;
33 for (.{ .riscv64, .mips, .i386, .x86_64, .powerpc, .powerpc64, .aarch64 }) |arch| {33 for (.{ .riscv64, .mips, .x86, .x86_64, .powerpc, .powerpc64, .aarch64 }) |arch| {
34 result[archIndex(arch)] = arch;34 result[archIndex(arch)] = arch;
35 }35 }
36 break :blk result;36 break :blk result;
...@@ -56,7 +56,7 @@ const MultiSym = struct {...@@ -56,7 +56,7 @@ const MultiSym = struct {
56 fn is32Only(ms: MultiSym) bool {56 fn is32Only(ms: MultiSym) bool {
57 return ms.present[archIndex(.riscv64)] == false and57 return ms.present[archIndex(.riscv64)] == false and
58 ms.present[archIndex(.mips)] == true and58 ms.present[archIndex(.mips)] == true and
59 ms.present[archIndex(.i386)] == true and59 ms.present[archIndex(.x86)] == true and
60 ms.present[archIndex(.x86_64)] == false and60 ms.present[archIndex(.x86_64)] == false and
61 ms.present[archIndex(.powerpc)] == true and61 ms.present[archIndex(.powerpc)] == true and
62 ms.present[archIndex(.powerpc64)] == false and62 ms.present[archIndex(.powerpc64)] == false and
...@@ -97,7 +97,7 @@ const MultiSym = struct {...@@ -97,7 +97,7 @@ const MultiSym = struct {
97 const map = .{97 const map = .{
98 .{ .riscv64, 8 },98 .{ .riscv64, 8 },
99 .{ .mips, 4 },99 .{ .mips, 4 },
100 .{ .i386, 4 },100 .{ .x86, 4 },
101 .{ .x86_64, 8 },101 .{ .x86_64, 8 },
102 .{ .powerpc, 4 },102 .{ .powerpc, 4 },
103 .{ .powerpc64, 8 },103 .{ .powerpc64, 8 },
...@@ -118,7 +118,7 @@ const MultiSym = struct {...@@ -118,7 +118,7 @@ const MultiSym = struct {
118 const map = .{118 const map = .{
119 .{ .riscv64, 16 },119 .{ .riscv64, 16 },
120 .{ .mips, 8 },120 .{ .mips, 8 },
121 .{ .i386, 8 },121 .{ .x86, 8 },
122 .{ .x86_64, 16 },122 .{ .x86_64, 16 },
123 .{ .powerpc, 8 },123 .{ .powerpc, 8 },
124 .{ .powerpc64, 16 },124 .{ .powerpc64, 16 },
...@@ -139,7 +139,7 @@ const MultiSym = struct {...@@ -139,7 +139,7 @@ const MultiSym = struct {
139 const map = .{139 const map = .{
140 .{ .riscv64, 2 },140 .{ .riscv64, 2 },
141 .{ .mips, 1 },141 .{ .mips, 1 },
142 .{ .i386, 1 },142 .{ .x86, 1 },
143 .{ .x86_64, 2 },143 .{ .x86_64, 2 },
144 .{ .powerpc, 1 },144 .{ .powerpc, 1 },
145 .{ .powerpc64, 2 },145 .{ .powerpc64, 2 },
...@@ -555,7 +555,7 @@ fn archIndex(arch: std.Target.Cpu.Arch) u8 {...@@ -555,7 +555,7 @@ fn archIndex(arch: std.Target.Cpu.Arch) u8 {
555 // zig fmt: off555 // zig fmt: off
556 .riscv64 => 0,556 .riscv64 => 0,
557 .mips => 1,557 .mips => 1,
558 .i386 => 2,558 .x86 => 2,
559 .x86_64 => 3,559 .x86_64 => 3,
560 .powerpc => 4,560 .powerpc => 4,
561 .powerpc64 => 5,561 .powerpc64 => 5,
tools/process_headers.zig+3-3
...@@ -96,7 +96,7 @@ const glibc_targets = [_]LibCTarget{...@@ -96,7 +96,7 @@ const glibc_targets = [_]LibCTarget{
96 },96 },
97 LibCTarget{97 LibCTarget{
98 .name = "i686-linux-gnu",98 .name = "i686-linux-gnu",
99 .arch = MultiArch{ .specific = Arch.i386 },99 .arch = MultiArch{ .specific = Arch.x86 },
100 .abi = MultiAbi{ .specific = Abi.gnu },100 .abi = MultiAbi{ .specific = Abi.gnu },
101 },101 },
102 LibCTarget{102 LibCTarget{
...@@ -208,8 +208,8 @@ const musl_targets = [_]LibCTarget{...@@ -208,8 +208,8 @@ const musl_targets = [_]LibCTarget{
208 .abi = MultiAbi.musl,208 .abi = MultiAbi.musl,
209 },209 },
210 LibCTarget{210 LibCTarget{
211 .name = "i386",211 .name = "x86",
212 .arch = MultiArch{ .specific = .i386 },212 .arch = MultiArch{ .specific = .x86 },
213 .abi = MultiAbi.musl,213 .abi = MultiAbi.musl,
214 },214 },
215 LibCTarget{215 LibCTarget{