diff --git a/CMakeLists.txt b/CMakeLists.txt index d87f39401aa1d84ffc07cf24de35724e24fecee7..f40634b7e20ab9b8f8ea1fc9cda5ac5978a93e30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,7 +239,8 @@ set(ZIG_STAGE2_SOURCES lib/std/atomic.zig lib/std/base64.zig lib/std/buf_map.zig - lib/std/builtin.zig + lib/std/lang.zig + lib/std/lang/assembly.zig lib/std/c.zig lib/std/coff.zig lib/std/crypto.zig diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig deleted file mode 100644 index 97846ed035c64d280a94c67d9b03c720e1204e61..0000000000000000000000000000000000000000 --- a/lib/std/builtin.zig +++ /dev/null @@ -1,1254 +0,0 @@ -//! Types and values provided by the Zig language. - -const builtin = @import("builtin"); -const std = @import("std.zig"); -const root = @import("root"); - -pub const assembly = @import("builtin/assembly.zig"); - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const StackTrace = struct { - index: usize, - instruction_addresses: []usize, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const GlobalLinkage = enum(u2) { - internal, - strong, - weak, - link_once, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const SymbolVisibility = enum(u2) { - default, - hidden, - protected, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const AtomicOrder = enum { - unordered, - monotonic, - acquire, - release, - acq_rel, - seq_cst, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const ReduceOp = enum { - And, - Or, - Xor, - Min, - Max, - Add, - Mul, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const AtomicRmwOp = enum { - /// Exchange - store the operand unmodified. - /// Supports enums, integers, and floats. - Xchg, - /// Add operand to existing value. - /// Supports integers and floats. - /// For integers, two's complement wraparound applies. - Add, - /// Subtract operand from existing value. - /// Supports integers and floats. - /// For integers, two's complement wraparound applies. - Sub, - /// Perform bitwise AND on existing value with operand. - /// Supports integers. - And, - /// Perform bitwise NAND on existing value with operand. - /// Supports integers. - Nand, - /// Perform bitwise OR on existing value with operand. - /// Supports integers. - Or, - /// Perform bitwise XOR on existing value with operand. - /// Supports integers. - Xor, - /// Store operand if it is larger than the existing value. - /// Supports integers and floats. - Max, - /// Store operand if it is smaller than the existing value. - /// Supports integers and floats. - Min, -}; - -/// The code model puts constraints on the location of symbols and the size of code and data. -/// The selection of a code model is a trade off on speed and restrictions that needs to be selected on a per application basis to meet its requirements. -/// A slightly more detailed explanation can be found in (for example) the [System V Application Binary Interface (x86_64)](https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf) 3.5.1. -/// -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const CodeModel = enum { - default, - extreme, - kernel, - large, - medany, - medium, - medlow, - medmid, - normal, - small, - tiny, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const OptimizeMode = enum { - Debug, - ReleaseSafe, - ReleaseFast, - ReleaseSmall, -}; - -/// The calling convention of a function defines how arguments and return values are passed, as well -/// as any other requirements which callers and callees must respect, such as register preservation -/// and stack alignment. -/// -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const CallingConvention = union(enum(u8)) { - pub const Tag = @typeInfo(CallingConvention).@"union".tag_type.?; - - /// This is an alias for the default C calling convention for this target. - /// Functions marked as `extern` or `export` are given this calling convention by default. - pub const c = builtin.target.cCallingConvention().?; - - pub const winapi: CallingConvention = switch (builtin.target.cpu.arch) { - .x86_64 => .{ .x86_64_win = .{} }, - .x86 => .{ .x86_stdcall = .{} }, - .aarch64 => .{ .aarch64_aapcs_win = .{} }, - .thumb => .{ .arm_aapcs_vfp = .{} }, - else => unreachable, - }; - - pub const kernel: CallingConvention = switch (builtin.target.cpu.arch) { - .amdgcn => .amdgcn_kernel, - .nvptx, .nvptx64 => .nvptx_kernel, - .spirv32, .spirv64 => .spirv_kernel, - else => unreachable, - }; - - /// The default Zig calling convention when neither `export` nor `inline` is specified. - /// This calling convention makes no guarantees about stack alignment, registers, etc. - /// It can only be used within this Zig compilation unit. - auto, - - /// The calling convention of a function that can be called with `async` syntax. An `async` call - /// of a runtime-known function must target a function with this calling convention. - /// Comptime-known functions with other calling conventions may be coerced to this one. - async, - - /// Functions with this calling convention have no prologue or epilogue, making the function - /// uncallable in regular Zig code. This can be useful when integrating with assembly. - naked, - - /// This calling convention is exactly equivalent to using the `inline` keyword on a function - /// definition. This function will be semantically inlined by the Zig compiler at call sites. - /// Pointers to inline functions are comptime-only. - @"inline", - - // Calling conventions for the `x86_64` architecture. - x86_64_sysv: CommonOptions, - x86_64_x32: CommonOptions, - x86_64_win: CommonOptions, - x86_64_regcall_v3_sysv: CommonOptions, - x86_64_regcall_v4_win: CommonOptions, - x86_64_vectorcall: CommonOptions, - x86_64_interrupt: CommonOptions, - - // Calling conventions for the `x86` architecture. - x86_sysv: X86RegparmOptions, - x86_win: X86RegparmOptions, - x86_stdcall: X86RegparmOptions, - x86_fastcall: CommonOptions, - x86_thiscall: CommonOptions, - x86_thiscall_mingw: CommonOptions, - x86_regcall_v3: CommonOptions, - x86_regcall_v4_win: CommonOptions, - x86_vectorcall: CommonOptions, - x86_interrupt: CommonOptions, - - // Calling conventions for the `x86_16` architecture. - - x86_16_cdecl: CommonOptions, - x86_16_stdcall: CommonOptions, - x86_16_regparmcall: CommonOptions, - x86_16_interrupt: CommonOptions, - - // Calling conventions for the `aarch64` and `aarch64_be` architectures. - aarch64_aapcs: CommonOptions, - aarch64_aapcs_darwin: CommonOptions, - aarch64_aapcs_win: CommonOptions, - aarch64_vfabi: CommonOptions, - aarch64_vfabi_sve: CommonOptions, - - /// The standard `alpha` calling convention. - alpha_osf: CommonOptions, - - // Calling convetions for the `arm`, `armeb`, `thumb`, and `thumbeb` architectures. - /// ARM Architecture Procedure Call Standard - arm_aapcs: CommonOptions, - /// ARM Architecture Procedure Call Standard Vector Floating-Point - arm_aapcs_vfp: CommonOptions, - arm_interrupt: ArmInterruptOptions, - - // Calling conventions for the `mips64` and `mips64el` architectures. - mips64_n64: CommonOptions, - mips64_n32: CommonOptions, - mips64_interrupt: MipsInterruptOptions, - - // Calling conventions for the `mips` and `mipsel` architectures. - mips_o32: CommonOptions, - mips_interrupt: MipsInterruptOptions, - - // Calling conventions for the `riscv64` architecture. - riscv64_lp64: CommonOptions, - riscv64_lp64_v: CommonOptions, - riscv64_interrupt: RiscvInterruptOptions, - - // Calling conventions for the `riscv32` architecture. - riscv32_ilp32: CommonOptions, - riscv32_ilp32_v: CommonOptions, - riscv32_interrupt: RiscvInterruptOptions, - - // Calling conventions for the `sparc64` architecture. - sparc64_sysv: CommonOptions, - - // Calling conventions for the `sparc` architecture. - sparc_sysv: CommonOptions, - - // Calling conventions for the `powerpc64` and `powerpc64le` architectures. - powerpc64_elf: CommonOptions, - powerpc64_elf_altivec: CommonOptions, - powerpc64_elf_v2: CommonOptions, - - // Calling conventions for the `powerpc` and `powerpcle` architectures. - powerpc_sysv: CommonOptions, - powerpc_sysv_altivec: CommonOptions, - powerpc_aix: CommonOptions, - powerpc_aix_altivec: CommonOptions, - - /// The standard `wasm32` and `wasm64` calling convention, as specified in the WebAssembly Tool Conventions. - wasm_mvp: CommonOptions, - - /// The standard `arc`/`arceb` calling convention. - arc_sysv: CommonOptions, - arc_interrupt: ArcInterruptOptions, - - // Calling conventions for the `avr` architecture. - avr_gnu, - avr_builtin, - avr_signal, - avr_interrupt, - - /// The standard `bpfel`/`bpfeb` calling convention. - bpf_std: CommonOptions, - - // Calling conventions for the `csky` architecture. - csky_sysv: CommonOptions, - csky_interrupt: CommonOptions, - - // Calling conventions for the `hexagon` architecture. - hexagon_sysv: CommonOptions, - hexagon_sysv_hvx: CommonOptions, - - /// The standard `hppa` calling convention. - hppa_elf: CommonOptions, - - /// The standard `hppa64` calling convention. - hppa64_elf: CommonOptions, - - kvx_lp64: CommonOptions, - kvx_ilp32: CommonOptions, - - /// The standard `lanai` calling convention. - lanai_sysv: CommonOptions, - - /// The standard `loongarch64` calling convention. - loongarch64_lp64: CommonOptions, - - /// The standard `loongarch32` calling convention. - loongarch32_ilp32: CommonOptions, - - // Calling conventions for the `m68k` architecture. - m68k_sysv: CommonOptions, - m68k_gnu: CommonOptions, - m68k_rtd: CommonOptions, - m68k_interrupt: CommonOptions, - - /// The standard `microblaze`/`microblazeel` calling convention. - microblaze_std: CommonOptions, - microblaze_interrupt: MicroblazeInterruptOptions, - - /// The standard `msp430` calling convention. - msp430_eabi: CommonOptions, - msp430_interrupt: CommonOptions, - - /// The standard `or1k` calling convention. - or1k_sysv: CommonOptions, - - /// The standard `propeller` calling convention. - propeller_sysv: CommonOptions, - - // Calling conventions for the `s390x` architecture. - s390x_sysv: CommonOptions, - s390x_sysv_vx: CommonOptions, - - // Calling conventions for the `sh`/`sheb` architecture. - sh_gnu: CommonOptions, - sh_renesas: CommonOptions, - sh_interrupt: ShInterruptOptions, - - /// The standard `ve` calling convention. - ve_sysv: CommonOptions, - - // Calling conventions for the `xcore` architecture. - xcore_xs1: CommonOptions, - xcore_xs2: CommonOptions, - - // Calling conventions for the `xtensa`/`xtensaeb` architecture. - xtensa_call0: CommonOptions, - xtensa_windowed: CommonOptions, - - // Calling conventions for the `amdgcn` architecture. - amdgcn_device: CommonOptions, - amdgcn_kernel, - amdgcn_cs: CommonOptions, - - // Calling conventions for the `nvptx` and `nvptx64` architectures. - nvptx_device, - nvptx_kernel, - - // Calling conventions for kernels and shaders on the `spirv`, `spirv32`, and `spirv64` architectures. - spirv_device, - spirv_kernel, - spirv_fragment, - spirv_vertex, - - // Calling conventions for the `ez80` architecture. - ez80_cet, - ez80_tiflags, - - /// Options shared across most calling conventions. - pub const CommonOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - }; - - /// Options for x86 calling conventions which support the regparm attribute to pass some - /// arguments in registers. - pub const X86RegparmOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - /// The number of arguments to pass in registers before passing the remaining arguments - /// according to the calling convention. - /// Equivalent to `__attribute__((regparm(x)))` in Clang and GCC. - register_params: u2 = 0, - }; - - /// Options for the `arc_interrupt` calling convention. - pub const ArcInterruptOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - /// The kind of interrupt being received. - type: InterruptType, - - pub const InterruptType = enum(u2) { - ilink1, - ilink2, - ilink, - firq, - }; - }; - - /// Options for the `arm_interrupt` calling convention. - pub const ArmInterruptOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - /// The kind of interrupt being received. - type: InterruptType = .generic, - - pub const InterruptType = enum(u3) { - generic, - irq, - fiq, - swi, - abort, - undef, - }; - }; - - /// Options for the `microblaze_interrupt` calling convention. - pub const MicroblazeInterruptOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - type: InterruptType = .regular, - - pub const InterruptType = enum(u2) { - /// User exception; return with `rtsd`. - user, - /// Regular interrupt; return with `rtid`. - regular, - /// Fast interrupt; return with `rtid`. - fast, - /// Software breakpoint; return with `rtbd`. - breakpoint, - }; - }; - - /// Options for the `mips_interrupt` and `mips64_interrupt` calling conventions. - pub const MipsInterruptOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - /// The interrupt mode. - mode: InterruptMode = .eic, - - pub const InterruptMode = enum(u4) { - eic, - sw0, - sw1, - hw0, - hw1, - hw2, - hw3, - hw4, - hw5, - }; - }; - - /// Options for the `riscv32_interrupt` and `riscv64_interrupt` calling conventions. - pub const RiscvInterruptOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - /// The privilege mode. - mode: PrivilegeMode, - - pub const PrivilegeMode = enum(u2) { - supervisor, - machine, - }; - }; - - /// Options for the `sh_interrupt` calling convention. - pub const ShInterruptOptions = struct { - /// The boundary the stack is aligned to when the function is called. - /// `null` means the default for this calling convention. - incoming_stack_alignment: ?u64 = null, - save: SaveBehavior = .full, - - pub const SaveBehavior = enum(u3) { - /// Save only fpscr (if applicable). - fpscr, - /// Save only high-numbered registers, i.e. r0 through r7 are *not* saved. - high, - /// Save all registers normally. - full, - /// Save all registers using the CPU's fast register bank. - bank, - }; - }; - - /// Returns the array of `std.Target.Cpu.Arch` to which this `CallingConvention` applies. - /// Asserts that `cc` is not `.auto`, `.@"async"`, `.naked`, or `.@"inline"`. - pub fn archs(cc: CallingConvention) []const std.Target.Cpu.Arch { - return std.Target.Cpu.Arch.fromCallingConvention(cc); - } - - pub fn eql(a: CallingConvention, b: CallingConvention) bool { - return std.meta.eql(a, b); - } - - pub fn withStackAlign(cc: CallingConvention, incoming_stack_alignment: u64) CallingConvention { - const tag: CallingConvention.Tag = cc; - var result = cc; - @field(result, @tagName(tag)).incoming_stack_alignment = incoming_stack_alignment; - return result; - } -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const AddressSpace = enum(u5) { - // CPU address spaces. - generic, - gs, - fs, - ss, - - // x86_16 extra address spaces. - /// Allows addressing the entire address space by storing both segment and offset. - far, - - // GPU address spaces. - global, - constant, - param, - shared, - local, - input, - output, - uniform, - push_constant, - storage_buffer, - physical_storage_buffer, - - // AVR address spaces. - flash, - flash1, - flash2, - flash3, - flash4, - flash5, - - // Propeller address spaces. - - /// This address space only addresses the cog-local ram. - cog, - - /// This address space only addresses shared hub ram. - hub, - - /// This address space only addresses the "lookup" ram - lut, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const SourceLocation = struct { - /// The name chosen when compiling. Not a file path. - module: [:0]const u8, - /// Relative to the root directory of its module. - file: [:0]const u8, - fn_name: [:0]const u8, - line: u32, - column: u32, -}; - -pub const TypeId = std.meta.Tag(Type); - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const Type = union(enum) { - type, - void, - bool, - noreturn, - int: Int, - float: Float, - pointer: Pointer, - array: Array, - @"struct": Struct, - comptime_float, - comptime_int, - undefined, - null, - optional: Optional, - error_union: ErrorUnion, - error_set: ErrorSet, - @"enum": Enum, - @"union": Union, - @"fn": Fn, - @"opaque": Opaque, - frame: Frame, - @"anyframe": AnyFrame, - vector: Vector, - enum_literal, - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Int = struct { - signedness: Signedness, - bits: u16, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Float = struct { - bits: u16, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Pointer = struct { - size: Size, - is_const: bool, - is_volatile: bool, - /// `null` means implicit alignment, which is equivalent to `@alignOf(child)`. - alignment: ?usize, - address_space: AddressSpace, - child: type, - is_allowzero: bool, - - /// The type of the sentinel is the element type of the pointer, which is - /// the value of the `child` field in this struct. However there is no way - /// to refer to that type here, so we use `*const anyopaque`. - /// See also: `sentinel` - sentinel_ptr: ?*const anyopaque, - - /// Loads the pointer type's sentinel value from `sentinel_ptr`. - /// Returns `null` if the pointer type has no sentinel. - pub inline fn sentinel(comptime ptr: Pointer) ?ptr.child { - const sp: *const ptr.child = @ptrCast(@alignCast(ptr.sentinel_ptr orelse return null)); - return sp.*; - } - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Size = enum(u2) { - one, - many, - slice, - c, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Attributes = struct { - @"const": bool = false, - @"volatile": bool = false, - @"allowzero": bool = false, - @"addrspace": ?AddressSpace = null, - @"align": ?usize = null, - }; - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Array = struct { - len: comptime_int, - child: type, - - /// The type of the sentinel is the element type of the array, which is - /// the value of the `child` field in this struct. However there is no way - /// to refer to that type here, so we use `*const anyopaque`. - /// See also: `sentinel`. - sentinel_ptr: ?*const anyopaque, - - /// Loads the array type's sentinel value from `sentinel_ptr`. - /// Returns `null` if the array type has no sentinel. - pub inline fn sentinel(comptime arr: Array) ?arr.child { - const sp: *const arr.child = @ptrCast(@alignCast(arr.sentinel_ptr orelse return null)); - return sp.*; - } - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const ContainerLayout = enum(u2) { - auto, - @"extern", - @"packed", - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const StructField = struct { - name: [:0]const u8, - type: type, - /// The type of the default value is the type of this struct field, which - /// is the value of the `type` field in this struct. However there is no - /// way to refer to that type here, so we use `*const anyopaque`. - /// See also: `defaultValue`. - default_value_ptr: ?*const anyopaque, - is_comptime: bool, - /// `null` means the field alignment was not explicitly specified. The - /// field will still be aligned to at least `@alignOf` its `type`. - alignment: ?usize, - - /// Loads the field's default value from `default_value_ptr`. - /// Returns `null` if the field has no default value. - pub inline fn defaultValue(comptime sf: StructField) ?sf.type { - const dp: *const sf.type = @ptrCast(@alignCast(sf.default_value_ptr orelse return null)); - return dp.*; - } - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Attributes = struct { - @"comptime": bool = false, - @"align": ?usize = null, - default_value_ptr: ?*const anyopaque = null, - }; - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Struct = struct { - layout: ContainerLayout, - /// Only valid if layout is .@"packed" - backing_integer: ?type = null, - fields: []const StructField, - decls: []const Declaration, - is_tuple: bool, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Optional = struct { - child: type, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const ErrorUnion = struct { - error_set: type, - payload: type, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Error = struct { - name: [:0]const u8, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const ErrorSet = ?[]const Error; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const EnumField = struct { - name: [:0]const u8, - value: comptime_int, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Enum = struct { - tag_type: type, - fields: []const EnumField, - decls: []const Declaration, - is_exhaustive: bool, - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Mode = enum { exhaustive, nonexhaustive }; - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const UnionField = struct { - name: [:0]const u8, - type: type, - /// `null` means the field alignment was not explicitly specified. The - /// field will still be aligned to at least `@alignOf` its `type`. - alignment: ?usize, - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Attributes = struct { - @"align": ?usize = null, - }; - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Union = struct { - layout: ContainerLayout, - tag_type: ?type, - fields: []const UnionField, - decls: []const Declaration, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Fn = struct { - calling_convention: CallingConvention, - is_generic: bool, - is_var_args: bool, - /// TODO change the language spec to make this not optional. - return_type: ?type, - params: []const Param, - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Param = struct { - is_generic: bool, - is_noalias: bool, - type: ?type, - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Attributes = struct { - @"noalias": bool = false, - }; - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Attributes = struct { - @"callconv": CallingConvention = .auto, - varargs: bool = false, - }; - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Opaque = struct { - decls: []const Declaration, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Frame = struct { - function: *const anyopaque, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const AnyFrame = struct { - child: ?type, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Vector = struct { - len: comptime_int, - child: type, - }; - - /// This data structure is used by the Zig language code generation and - /// therefore must be kept in sync with the compiler implementation. - pub const Declaration = struct { - name: [:0]const u8, - }; -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const FloatMode = enum { - strict, - optimized, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const Endian = enum { - big, - little, - - pub const native = builtin.target.cpu.arch.endian(); - pub const foreign: Endian = @enumFromInt(1 - @intFromEnum(native)); -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const Signedness = enum(u1) { - signed, - unsigned, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const OutputMode = enum { - Exe, - Lib, - Obj, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const LinkMode = enum { - static, - dynamic, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const UnwindTables = enum { - none, - sync, - async, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const WasiExecModel = enum { - command, - reactor, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const CallModifier = enum { - /// Equivalent to function call syntax. - auto, - /// Prevents tail call optimization. This guarantees that the return - /// address will point to the callsite, as opposed to the callsite's - /// callsite. If the call is otherwise required to be tail-called - /// or inlined, a compile error is emitted instead. - never_tail, - /// Guarantees that the call will not be inlined. If the call is - /// otherwise required to be inlined, a compile error is emitted instead. - never_inline, - /// Asserts that the function call will not suspend. This allows a - /// non-async function to call an async function. - no_suspend, - /// Guarantees that the call will be generated with tail call optimization. - /// If this is not possible, a compile error is emitted instead. - always_tail, - /// Guarantees that the call will be inlined at the callsite. - /// If this is not possible, a compile error is emitted instead. - always_inline, - /// Evaluates the call at compile-time. If the call cannot be completed at - /// compile-time, a compile error is emitted instead. - compile_time, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListAarch64 = extern struct { - __stack: *anyopaque, - __gr_top: *anyopaque, - __vr_top: *anyopaque, - __gr_offs: c_int, - __vr_offs: c_int, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListAlpha = extern struct { - __base: *anyopaque, - __offset: c_int, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListArm = extern struct { - __ap: *anyopaque, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListHexagon = extern struct { - __gpr: c_long, - __fpr: c_long, - __overflow_arg_area: *anyopaque, - __reg_save_area: *anyopaque, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListPowerPc = extern struct { - gpr: u8, - fpr: u8, - reserved: c_ushort, - overflow_arg_area: *anyopaque, - reg_save_area: *anyopaque, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListS390x = extern struct { - __current_saved_reg_area_pointer: *anyopaque, - __saved_reg_area_end_pointer: *anyopaque, - __overflow_area_pointer: *anyopaque, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListSh = extern struct { - __va_next_o: *anyopaque, - __va_next_o_limit: *anyopaque, - __va_next_fp: *anyopaque, - __va_next_fp_limit: *anyopaque, - __va_next_stack: *anyopaque, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListX86_64 = extern struct { - gp_offset: c_uint, - fp_offset: c_uint, - overflow_arg_area: *anyopaque, - reg_save_area: *anyopaque, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaListXtensa = extern struct { - __va_stk: *c_int, - __va_reg: *c_int, - __va_ndx: c_int, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const VaList = switch (builtin.cpu.arch) { - .amdgcn, - .msp430, - .nvptx, - .nvptx64, - .powerpc64, - .powerpc64le, - .x86, - => *u8, - .arc, - .arceb, - .avr, - .bpfel, - .bpfeb, - .csky, - .hppa, - .hppa64, - .kvx, - .lanai, - .loongarch32, - .loongarch64, - .m68k, - .microblaze, - .microblazeel, - .mips, - .mipsel, - .mips64, - .mips64el, - .riscv32, - .riscv32be, - .riscv64, - .riscv64be, - .sparc, - .sparc64, - .spirv32, - .spirv64, - .ve, - .wasm32, - .wasm64, - .xcore, - => *anyopaque, - .aarch64, .aarch64_be => switch (builtin.os.tag) { - .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .windows => *u8, - else => switch (builtin.zig_backend) { - else => VaListAarch64, - .stage2_llvm => @compileError("disabled due to miscompilations"), - }, - }, - .alpha => VaListAlpha, - .arm, .armeb, .thumb, .thumbeb => VaListArm, - .hexagon => if (builtin.target.abi.isMusl()) VaListHexagon else *u8, - .powerpc, .powerpcle => VaListPowerPc, - .s390x => VaListS390x, - .sh, .sheb => VaListSh, // This is wrong for `sh_renesas`: https://github.com/ziglang/zig/issues/24692#issuecomment-3150779829 - .x86_64 => switch (builtin.os.tag) { - .uefi, .windows => switch (builtin.zig_backend) { - else => *u8, - .stage2_llvm => @compileError("disabled due to miscompilations"), - }, - else => VaListX86_64, - }, - .xtensa, .xtensaeb => VaListXtensa, - else => @compileError("VaList not supported for this target yet"), -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const PrefetchOptions = struct { - /// Whether the prefetch should prepare for a read or a write. - rw: Rw = .read, - /// The data's locality in an inclusive range from 0 to 3. - /// - /// 0 means no temporal locality. That is, the data can be immediately - /// dropped from the cache after it is accessed. - /// - /// 3 means high temporal locality. That is, the data should be kept in - /// the cache as it is likely to be accessed again soon. - locality: u2 = 3, - /// The cache that the prefetch should be performed on. - cache: Cache = .data, - - pub const Rw = enum(u1) { - read, - write, - }; - - pub const Cache = enum(u1) { - instruction, - data, - }; -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const ExportOptions = struct { - name: []const u8, - linkage: GlobalLinkage = .strong, - section: ?[]const u8 = null, - visibility: SymbolVisibility = .default, -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const ExternOptions = struct { - name: []const u8, - library_name: ?[]const u8 = null, - linkage: GlobalLinkage = .strong, - visibility: SymbolVisibility = .default, - /// Setting this to `true` makes the `@extern` a runtime value. - is_thread_local: bool = false, - is_dll_import: bool = false, - relocation: Relocation = .any, - decoration: ?Decoration = null, - - pub const Decoration = union(enum) { - location: u32, - descriptor: Descriptor, - - pub const Descriptor = struct { - binding: u32, - set: u32, - }; - }; - - pub const Relocation = enum(u1) { - /// Any type of relocation is allowed. - any, - /// A program-counter-relative relocation is required. - /// Using this value makes the `@extern` a runtime value. - pcrel, - }; -}; - -/// This data structure is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const BranchHint = enum(u3) { - /// Equivalent to no hint given. - none, - /// This branch of control flow is more likely to be reached than its peers. - /// The optimizer should optimize for reaching it. - likely, - /// This branch of control flow is less likely to be reached than its peers. - /// The optimizer should optimize for not reaching it. - unlikely, - /// This branch of control flow is unlikely to *ever* be reached. - /// The optimizer may place it in a different page of memory to optimize other branches. - cold, - /// It is difficult to predict whether this branch of control flow will be reached. - /// The optimizer should avoid branching behavior with expensive mispredictions. - unpredictable, -}; - -/// This enum is set by the compiler and communicates which compiler backend is -/// used to produce machine code. -/// Think carefully before deciding to observe this value. Nearly all code should -/// be agnostic to the backend that implements the language. The use case -/// to use this value is to **work around problems with compiler implementations.** -/// -/// Avoid failing the compilation if the compiler backend does not match a -/// whitelist of backends; rather one should detect that a known problem would -/// occur in a blacklist of backends. -/// -/// The enum is nonexhaustive so that alternate Zig language implementations may -/// choose a number as their tag (please use a random number generator rather -/// than a "cute" number) and codebases can interact with these values even if -/// this upstream enum does not have a name for the number. Of course, upstream -/// is happy to accept pull requests to add Zig implementations to this enum. -/// -/// This data structure is part of the Zig language specification. -pub const CompilerBackend = enum(u64) { - /// It is allowed for a compiler implementation to not reveal its identity, - /// in which case this value is appropriate. Be cool and make sure your - /// code supports `other` Zig compilers! - other = 0, - /// The original Zig compiler created in 2015 by Andrew Kelley. Implemented - /// in C++. Used LLVM. Deleted from the ZSF ziglang/zig codebase on - /// December 6th, 2022. - stage1 = 1, - /// The reference implementation self-hosted compiler of Zig, using the - /// LLVM backend. - stage2_llvm = 2, - /// The reference implementation self-hosted compiler of Zig, using the - /// backend that generates C source code. - /// Note that one can observe whether the compilation will output C code - /// directly with `object_format` value rather than the `compiler_backend` value. - stage2_c = 3, - /// The reference implementation self-hosted compiler of Zig, using the - /// WebAssembly backend. - stage2_wasm = 4, - /// The reference implementation self-hosted compiler of Zig, using the - /// arm backend. - stage2_arm = 5, - /// The reference implementation self-hosted compiler of Zig, using the - /// x86_64 backend. - stage2_x86_64 = 6, - /// The reference implementation self-hosted compiler of Zig, using the - /// aarch64 backend. - stage2_aarch64 = 7, - /// The reference implementation self-hosted compiler of Zig, using the - /// x86 backend. - stage2_x86 = 8, - /// The reference implementation self-hosted compiler of Zig, using the - /// riscv64 backend. - stage2_riscv64 = 9, - /// The reference implementation self-hosted compiler of Zig, using the - /// sparc64 backend. - stage2_sparc64 = 10, - /// The reference implementation self-hosted compiler of Zig, using the - /// spirv backend. - stage2_spirv = 11, - /// The reference implementation self-hosted compiler of Zig, using the - /// powerpc backend. - stage2_powerpc = 12, - - _, -}; - -/// This function type is used by the Zig language code generation and -/// therefore must be kept in sync with the compiler implementation. -pub const TestFn = struct { - name: []const u8, - func: *const fn () anyerror!void, -}; - -/// This namespace is used by the Zig compiler to emit various kinds of safety -/// panics. These can be overridden by making a public `panic` namespace in the -/// root source file. -pub const panic: type = p: { - if (@hasDecl(root, "panic")) { - if (@TypeOf(root.panic) != type) { - // Deprecated; make `panic` a namespace instead. - break :p std.debug.FullPanic(struct { - fn panic(msg: []const u8, ra: ?usize) noreturn { - root.panic(msg, @errorReturnTrace(), ra); - } - }.panic); - } - break :p root.panic; - } - break :p switch (builtin.zig_backend) { - .stage2_powerpc, - .stage2_riscv64, - => std.debug.simple_panic, - else => std.debug.FullPanic(std.debug.defaultPanic), - }; -}; - -pub noinline fn returnError() void { - @branchHint(.unlikely); - @setRuntimeSafety(false); - const st = @errorReturnTrace().?; - if (st.index < st.instruction_addresses.len) - st.instruction_addresses[st.index] = @returnAddress(); - st.index += 1; -} diff --git a/lib/std/builtin/assembly.zig b/lib/std/builtin/assembly.zig deleted file mode 100644 index f2ea98063674af603e9ee831f4dcf2fa76c8795c..0000000000000000000000000000000000000000 --- a/lib/std/builtin/assembly.zig +++ /dev/null @@ -1,3119 +0,0 @@ -pub const Clobbers = switch (@import("builtin").cpu.arch) { - .x86_16, .x86, .x86_64 => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - /// Condition codes. Subset of the bits in `eflags` and `rflags`. - cc: bool = false, - dirflag: bool = false, - eflags: bool = false, - flags: bool = false, - fpcr: bool = false, - fpsr: bool = false, - mxcsr: bool = false, - rflags: bool = false, - - rax: bool = false, - rcx: bool = false, - rdx: bool = false, - rbx: bool = false, - rsp: bool = false, - rbp: bool = false, - rsi: bool = false, - rdi: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - eax: bool = false, - ecx: bool = false, - edx: bool = false, - ebx: bool = false, - esp: bool = false, - ebp: bool = false, - esi: bool = false, - edi: bool = false, - r8d: bool = false, - r9d: bool = false, - r10d: bool = false, - r11d: bool = false, - r12d: bool = false, - r13d: bool = false, - r14d: bool = false, - r15d: bool = false, - ax: bool = false, - cx: bool = false, - dx: bool = false, - bx: bool = false, - sp: bool = false, - bp: bool = false, - si: bool = false, - di: bool = false, - r8w: bool = false, - r9w: bool = false, - r10w: bool = false, - r11w: bool = false, - r12w: bool = false, - r13w: bool = false, - r14w: bool = false, - r15w: bool = false, - al: bool = false, - cl: bool = false, - dl: bool = false, - bl: bool = false, - spl: bool = false, - bpl: bool = false, - sil: bool = false, - dil: bool = false, - r8b: bool = false, - r9b: bool = false, - r10b: bool = false, - r11b: bool = false, - r12b: bool = false, - r13b: bool = false, - r14b: bool = false, - r15b: bool = false, - ah: bool = false, - ch: bool = false, - dh: bool = false, - bh: bool = false, - zmm0: bool = false, - zmm1: bool = false, - zmm2: bool = false, - zmm3: bool = false, - zmm4: bool = false, - zmm5: bool = false, - zmm6: bool = false, - zmm7: bool = false, - zmm8: bool = false, - zmm9: bool = false, - zmm10: bool = false, - zmm11: bool = false, - zmm12: bool = false, - zmm13: bool = false, - zmm14: bool = false, - zmm15: bool = false, - zmm16: bool = false, - zmm17: bool = false, - zmm18: bool = false, - zmm19: bool = false, - zmm20: bool = false, - zmm21: bool = false, - zmm22: bool = false, - zmm23: bool = false, - zmm24: bool = false, - zmm25: bool = false, - zmm26: bool = false, - zmm27: bool = false, - zmm28: bool = false, - zmm29: bool = false, - zmm30: bool = false, - zmm31: bool = false, - ymm0: bool = false, - ymm1: bool = false, - ymm2: bool = false, - ymm3: bool = false, - ymm4: bool = false, - ymm5: bool = false, - ymm6: bool = false, - ymm7: bool = false, - ymm8: bool = false, - ymm9: bool = false, - ymm10: bool = false, - ymm11: bool = false, - ymm12: bool = false, - ymm13: bool = false, - ymm14: bool = false, - ymm15: bool = false, - ymm16: bool = false, - ymm17: bool = false, - ymm18: bool = false, - ymm19: bool = false, - ymm20: bool = false, - ymm21: bool = false, - ymm22: bool = false, - ymm23: bool = false, - ymm24: bool = false, - ymm25: bool = false, - ymm26: bool = false, - ymm27: bool = false, - ymm28: bool = false, - ymm29: bool = false, - ymm30: bool = false, - ymm31: bool = false, - xmm0: bool = false, - xmm1: bool = false, - xmm2: bool = false, - xmm3: bool = false, - xmm4: bool = false, - xmm5: bool = false, - xmm6: bool = false, - xmm7: bool = false, - xmm8: bool = false, - xmm9: bool = false, - xmm10: bool = false, - xmm11: bool = false, - xmm12: bool = false, - xmm13: bool = false, - xmm14: bool = false, - xmm15: bool = false, - xmm16: bool = false, - xmm17: bool = false, - xmm18: bool = false, - xmm19: bool = false, - xmm20: bool = false, - xmm21: bool = false, - xmm22: bool = false, - xmm23: bool = false, - xmm24: bool = false, - xmm25: bool = false, - xmm26: bool = false, - xmm27: bool = false, - xmm28: bool = false, - xmm29: bool = false, - xmm30: bool = false, - xmm31: bool = false, - mm0: bool = false, - mm1: bool = false, - mm2: bool = false, - mm3: bool = false, - mm4: bool = false, - mm5: bool = false, - mm6: bool = false, - mm7: bool = false, - st0: bool = false, - st1: bool = false, - st2: bool = false, - st3: bool = false, - st4: bool = false, - st5: bool = false, - st6: bool = false, - st7: bool = false, - es: bool = false, - cs: bool = false, - ss: bool = false, - ds: bool = false, - fs: bool = false, - gs: bool = false, - }, - .aarch64, .aarch64_be => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - nzcv: bool = false, - - x0: bool = false, - x1: bool = false, - x2: bool = false, - x3: bool = false, - x4: bool = false, - x5: bool = false, - x6: bool = false, - x7: bool = false, - x8: bool = false, - x9: bool = false, - x10: bool = false, - x11: bool = false, - x12: bool = false, - x13: bool = false, - x14: bool = false, - x15: bool = false, - x16: bool = false, - x17: bool = false, - x18: bool = false, - x19: bool = false, - x20: bool = false, - x21: bool = false, - x22: bool = false, - x23: bool = false, - x24: bool = false, - x25: bool = false, - x26: bool = false, - x27: bool = false, - x28: bool = false, - x29: bool = false, - x30: bool = false, - - w0: bool = false, - w1: bool = false, - w2: bool = false, - w3: bool = false, - w4: bool = false, - w5: bool = false, - w6: bool = false, - w7: bool = false, - w8: bool = false, - w9: bool = false, - w10: bool = false, - w11: bool = false, - w12: bool = false, - w13: bool = false, - w14: bool = false, - w15: bool = false, - w16: bool = false, - w17: bool = false, - w18: bool = false, - w19: bool = false, - w20: bool = false, - w21: bool = false, - w22: bool = false, - w23: bool = false, - w24: bool = false, - w25: bool = false, - w26: bool = false, - w27: bool = false, - w28: bool = false, - w29: bool = false, - - lr: bool = false, - sp: bool = false, - wsp: bool = false, - fpcr: bool = false, - fpmr: bool = false, - fpsr: bool = false, - ffr: bool = false, - - p0: bool = false, - p1: bool = false, - p2: bool = false, - p3: bool = false, - p4: bool = false, - p5: bool = false, - p6: bool = false, - p7: bool = false, - p8: bool = false, - p9: bool = false, - p10: bool = false, - p11: bool = false, - p12: bool = false, - p13: bool = false, - p14: bool = false, - p15: bool = false, - - z0: bool = false, - z1: bool = false, - z2: bool = false, - z3: bool = false, - z4: bool = false, - z5: bool = false, - z6: bool = false, - z7: bool = false, - z8: bool = false, - z9: bool = false, - z10: bool = false, - z11: bool = false, - z12: bool = false, - z13: bool = false, - z14: bool = false, - z15: bool = false, - z16: bool = false, - z17: bool = false, - z18: bool = false, - z19: bool = false, - z20: bool = false, - z21: bool = false, - z22: bool = false, - z23: bool = false, - z24: bool = false, - z25: bool = false, - z26: bool = false, - z27: bool = false, - z28: bool = false, - z29: bool = false, - z30: bool = false, - z31: bool = false, - - v0: bool = false, - v1: bool = false, - v2: bool = false, - v3: bool = false, - v4: bool = false, - v5: bool = false, - v6: bool = false, - v7: bool = false, - v8: bool = false, - v9: bool = false, - v10: bool = false, - v11: bool = false, - v12: bool = false, - v13: bool = false, - v14: bool = false, - v15: bool = false, - v16: bool = false, - v17: bool = false, - v18: bool = false, - v19: bool = false, - v20: bool = false, - v21: bool = false, - v22: bool = false, - v23: bool = false, - v24: bool = false, - v25: bool = false, - v26: bool = false, - v27: bool = false, - v28: bool = false, - v29: bool = false, - v30: bool = false, - v31: bool = false, - - d0: bool = false, - d1: bool = false, - d2: bool = false, - d3: bool = false, - d4: bool = false, - d5: bool = false, - d6: bool = false, - d7: bool = false, - d8: bool = false, - d9: bool = false, - d10: bool = false, - d11: bool = false, - d12: bool = false, - d13: bool = false, - d14: bool = false, - d15: bool = false, - d16: bool = false, - d17: bool = false, - d18: bool = false, - d19: bool = false, - d20: bool = false, - d21: bool = false, - d22: bool = false, - d23: bool = false, - d24: bool = false, - d25: bool = false, - d26: bool = false, - d27: bool = false, - d28: bool = false, - d29: bool = false, - d30: bool = false, - d31: bool = false, - - s0: bool = false, - s1: bool = false, - s2: bool = false, - s3: bool = false, - s4: bool = false, - s5: bool = false, - s6: bool = false, - s7: bool = false, - s8: bool = false, - s9: bool = false, - s10: bool = false, - s11: bool = false, - s12: bool = false, - s13: bool = false, - s14: bool = false, - s15: bool = false, - s16: bool = false, - s17: bool = false, - s18: bool = false, - s19: bool = false, - s20: bool = false, - s21: bool = false, - s22: bool = false, - s23: bool = false, - s24: bool = false, - s25: bool = false, - s26: bool = false, - s27: bool = false, - s28: bool = false, - s29: bool = false, - s30: bool = false, - s31: bool = false, - - h0: bool = false, - h1: bool = false, - h2: bool = false, - h3: bool = false, - h4: bool = false, - h5: bool = false, - h6: bool = false, - h7: bool = false, - h8: bool = false, - h9: bool = false, - h10: bool = false, - h11: bool = false, - h12: bool = false, - h13: bool = false, - h14: bool = false, - h15: bool = false, - h16: bool = false, - h17: bool = false, - h18: bool = false, - h19: bool = false, - h20: bool = false, - h21: bool = false, - h22: bool = false, - h23: bool = false, - h24: bool = false, - h25: bool = false, - h26: bool = false, - h27: bool = false, - h28: bool = false, - h29: bool = false, - h30: bool = false, - h31: bool = false, - - b0: bool = false, - b1: bool = false, - b2: bool = false, - b3: bool = false, - b4: bool = false, - b5: bool = false, - b6: bool = false, - b7: bool = false, - b8: bool = false, - b9: bool = false, - b10: bool = false, - b11: bool = false, - b12: bool = false, - b13: bool = false, - b14: bool = false, - b15: bool = false, - b16: bool = false, - b17: bool = false, - b18: bool = false, - b19: bool = false, - b20: bool = false, - b21: bool = false, - b22: bool = false, - b23: bool = false, - b24: bool = false, - b25: bool = false, - b26: bool = false, - b27: bool = false, - b28: bool = false, - b29: bool = false, - b30: bool = false, - b31: bool = false, - - za0q: bool = false, - za1q: bool = false, - za2q: bool = false, - za3q: bool = false, - za4q: bool = false, - za5q: bool = false, - za6q: bool = false, - za7q: bool = false, - za8q: bool = false, - za9q: bool = false, - za10q: bool = false, - za11q: bool = false, - za12q: bool = false, - za13q: bool = false, - za14q: bool = false, - za15q: bool = false, - - za0d: bool = false, - za1d: bool = false, - za2d: bool = false, - za3d: bool = false, - za4d: bool = false, - za5d: bool = false, - za6d: bool = false, - za7d: bool = false, - - za0s: bool = false, - za1s: bool = false, - za2s: bool = false, - za3s: bool = false, - - za0h: bool = false, - za1h: bool = false, - za0b: bool = false, - - zt0: bool = false, - }, - .arm, .armeb, .thumb, .thumbeb => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - apsr: bool = false, - cpsr: bool = false, - spsr: bool = false, - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - - lr: bool = false, - sp: bool = false, - fpscr: bool = false, - vpr: bool = false, - - d0: bool = false, - d1: bool = false, - d2: bool = false, - d3: bool = false, - d4: bool = false, - d5: bool = false, - d6: bool = false, - d7: bool = false, - d8: bool = false, - d9: bool = false, - d10: bool = false, - d11: bool = false, - d12: bool = false, - d13: bool = false, - d14: bool = false, - d15: bool = false, - d16: bool = false, - d17: bool = false, - d18: bool = false, - d19: bool = false, - d20: bool = false, - d21: bool = false, - d22: bool = false, - d23: bool = false, - d24: bool = false, - d25: bool = false, - d26: bool = false, - d27: bool = false, - d28: bool = false, - d29: bool = false, - d30: bool = false, - d31: bool = false, - - s0: bool = false, - s1: bool = false, - s2: bool = false, - s3: bool = false, - s4: bool = false, - s5: bool = false, - s6: bool = false, - s7: bool = false, - s8: bool = false, - s9: bool = false, - s10: bool = false, - s11: bool = false, - s12: bool = false, - s13: bool = false, - s14: bool = false, - s15: bool = false, - s16: bool = false, - s17: bool = false, - s18: bool = false, - s19: bool = false, - s20: bool = false, - s21: bool = false, - s22: bool = false, - s23: bool = false, - s24: bool = false, - s25: bool = false, - s26: bool = false, - s27: bool = false, - s28: bool = false, - s29: bool = false, - s30: bool = false, - s31: bool = false, - - q0: bool = false, - q1: bool = false, - q2: bool = false, - q3: bool = false, - q4: bool = false, - q5: bool = false, - q6: bool = false, - q7: bool = false, - q8: bool = false, - q9: bool = false, - q10: bool = false, - q11: bool = false, - q12: bool = false, - q13: bool = false, - q14: bool = false, - q15: bool = false, - }, - .riscv32, .riscv32be, .riscv64, .riscv64be => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - ssp: bool = false, - - x1: bool = false, - x2: bool = false, - x3: bool = false, - x4: bool = false, - x5: bool = false, - x6: bool = false, - x7: bool = false, - x8: bool = false, - x9: bool = false, - x10: bool = false, - x11: bool = false, - x12: bool = false, - x13: bool = false, - x14: bool = false, - x15: bool = false, - x16: bool = false, - x17: bool = false, - x18: bool = false, - x19: bool = false, - x20: bool = false, - x21: bool = false, - x22: bool = false, - x23: bool = false, - x24: bool = false, - x25: bool = false, - x26: bool = false, - x27: bool = false, - x28: bool = false, - x29: bool = false, - x30: bool = false, - x31: bool = false, - - // ABI aliases for integer registers - ra: bool = false, - sp: bool = false, - gp: bool = false, - tp: bool = false, - t0: bool = false, - t1: bool = false, - t2: bool = false, - s0: bool = false, - fp: bool = false, - s1: bool = false, - a0: bool = false, - a1: bool = false, - a2: bool = false, - a3: bool = false, - a4: bool = false, - a5: bool = false, - a6: bool = false, - a7: bool = false, - s2: bool = false, - s3: bool = false, - s4: bool = false, - s5: bool = false, - s6: bool = false, - s7: bool = false, - s8: bool = false, - s9: bool = false, - s10: bool = false, - s11: bool = false, - t3: bool = false, - t4: bool = false, - t5: bool = false, - t6: bool = false, - - fflags: bool = false, - frm: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - f16: bool = false, - f17: bool = false, - f18: bool = false, - f19: bool = false, - f20: bool = false, - f21: bool = false, - f22: bool = false, - f23: bool = false, - f24: bool = false, - f25: bool = false, - f26: bool = false, - f27: bool = false, - f28: bool = false, - f29: bool = false, - f30: bool = false, - f31: bool = false, - - // ABI aliases for float registers - ft0: bool = false, - ft1: bool = false, - ft2: bool = false, - ft3: bool = false, - ft4: bool = false, - ft5: bool = false, - ft6: bool = false, - ft7: bool = false, - fs0: bool = false, - fs1: bool = false, - fa0: bool = false, - fa1: bool = false, - fa2: bool = false, - fa3: bool = false, - fa4: bool = false, - fa5: bool = false, - fa6: bool = false, - fa7: bool = false, - fs2: bool = false, - fs3: bool = false, - fs4: bool = false, - fs5: bool = false, - fs6: bool = false, - fs7: bool = false, - fs8: bool = false, - fs9: bool = false, - fs10: bool = false, - fs11: bool = false, - ft8: bool = false, - ft9: bool = false, - ft10: bool = false, - ft11: bool = false, - - vtype: bool = false, - vl: bool = false, - vxsat: bool = false, - vxrm: bool = false, - vcsr: bool = false, - - v0: bool = false, - v1: bool = false, - v2: bool = false, - v3: bool = false, - v4: bool = false, - v5: bool = false, - v6: bool = false, - v7: bool = false, - v8: bool = false, - v9: bool = false, - v10: bool = false, - v11: bool = false, - v12: bool = false, - v13: bool = false, - v14: bool = false, - v15: bool = false, - v16: bool = false, - v17: bool = false, - v18: bool = false, - v19: bool = false, - v20: bool = false, - v21: bool = false, - v22: bool = false, - v23: bool = false, - v24: bool = false, - v25: bool = false, - v26: bool = false, - v27: bool = false, - v28: bool = false, - v29: bool = false, - v30: bool = false, - v31: bool = false, - }, - .xcore => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - - cp: bool = false, - dp: bool = false, - sp: bool = false, - lr: bool = false, - sr: bool = false, - }, - .xtensa, .xtensaeb => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - sar: bool = false, - lbeg: bool = false, - lend: bool = false, - lcount: bool = false, - atomctl: bool = false, - scompare1: bool = false, - threadptr: bool = false, - litbase: bool = false, - windowbase: bool = false, - windowstart: bool = false, - ps: bool = false, - - a0: bool = false, - a1: bool = false, - a2: bool = false, - a3: bool = false, - a4: bool = false, - a5: bool = false, - a6: bool = false, - a7: bool = false, - a8: bool = false, - a9: bool = false, - a10: bool = false, - a11: bool = false, - a12: bool = false, - a13: bool = false, - a14: bool = false, - a15: bool = false, - - br: bool = false, - b0: bool = false, - b1: bool = false, - b2: bool = false, - b3: bool = false, - b4: bool = false, - b5: bool = false, - b6: bool = false, - b7: bool = false, - b8: bool = false, - b9: bool = false, - b10: bool = false, - b11: bool = false, - b12: bool = false, - b13: bool = false, - b14: bool = false, - b15: bool = false, - - acchi: bool = false, - acclo: bool = false, - m0: bool = false, - m1: bool = false, - m2: bool = false, - m3: bool = false, - fcr: bool = false, - fsr: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - }, - .kvx => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - cs: bool = false, - - ra: bool = false, - - ls: bool = false, - le: bool = false, - lc: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - r32: bool = false, - r33: bool = false, - r34: bool = false, - r35: bool = false, - r36: bool = false, - r37: bool = false, - r38: bool = false, - r39: bool = false, - r40: bool = false, - r41: bool = false, - r42: bool = false, - r43: bool = false, - r44: bool = false, - r45: bool = false, - r46: bool = false, - r47: bool = false, - r48: bool = false, - r49: bool = false, - r50: bool = false, - r51: bool = false, - r52: bool = false, - r53: bool = false, - r54: bool = false, - r55: bool = false, - r56: bool = false, - r57: bool = false, - r58: bool = false, - r59: bool = false, - r60: bool = false, - r61: bool = false, - r62: bool = false, - r63: bool = false, - - a0: bool = false, - a1: bool = false, - a2: bool = false, - a3: bool = false, - a4: bool = false, - a5: bool = false, - a6: bool = false, - a7: bool = false, - a8: bool = false, - a9: bool = false, - a10: bool = false, - a11: bool = false, - a12: bool = false, - a13: bool = false, - a14: bool = false, - a15: bool = false, - a16: bool = false, - a17: bool = false, - a18: bool = false, - a19: bool = false, - a20: bool = false, - a21: bool = false, - a22: bool = false, - a23: bool = false, - a24: bool = false, - a25: bool = false, - a26: bool = false, - a27: bool = false, - a28: bool = false, - a29: bool = false, - a30: bool = false, - a31: bool = false, - a32: bool = false, - a33: bool = false, - a34: bool = false, - a35: bool = false, - a36: bool = false, - a37: bool = false, - a38: bool = false, - a39: bool = false, - a40: bool = false, - a41: bool = false, - a42: bool = false, - a43: bool = false, - a44: bool = false, - a45: bool = false, - a46: bool = false, - a47: bool = false, - a48: bool = false, - a49: bool = false, - a50: bool = false, - a51: bool = false, - a52: bool = false, - a53: bool = false, - a54: bool = false, - a55: bool = false, - a56: bool = false, - a57: bool = false, - a58: bool = false, - a59: bool = false, - a60: bool = false, - a61: bool = false, - a62: bool = false, - a63: bool = false, - - a0_lo: bool = false, - a0_hi: bool = false, - a1_lo: bool = false, - a1_hi: bool = false, - a2_lo: bool = false, - a2_hi: bool = false, - a3_lo: bool = false, - a3_hi: bool = false, - a4_lo: bool = false, - a4_hi: bool = false, - a5_lo: bool = false, - a5_hi: bool = false, - a6_lo: bool = false, - a6_hi: bool = false, - a7_lo: bool = false, - a7_hi: bool = false, - a8_lo: bool = false, - a8_hi: bool = false, - a9_lo: bool = false, - a9_hi: bool = false, - a10_lo: bool = false, - a10_hi: bool = false, - a11_lo: bool = false, - a11_hi: bool = false, - a12_lo: bool = false, - a12_hi: bool = false, - a13_lo: bool = false, - a13_hi: bool = false, - a14_lo: bool = false, - a14_hi: bool = false, - a15_lo: bool = false, - a15_hi: bool = false, - a16_lo: bool = false, - a16_hi: bool = false, - a17_lo: bool = false, - a17_hi: bool = false, - a18_lo: bool = false, - a18_hi: bool = false, - a19_lo: bool = false, - a19_hi: bool = false, - a20_lo: bool = false, - a20_hi: bool = false, - a21_lo: bool = false, - a21_hi: bool = false, - a22_lo: bool = false, - a22_hi: bool = false, - a23_lo: bool = false, - a23_hi: bool = false, - a24_lo: bool = false, - a24_hi: bool = false, - a25_lo: bool = false, - a25_hi: bool = false, - a26_lo: bool = false, - a26_hi: bool = false, - a27_lo: bool = false, - a27_hi: bool = false, - a28_lo: bool = false, - a28_hi: bool = false, - a29_lo: bool = false, - a29_hi: bool = false, - a30_lo: bool = false, - a30_hi: bool = false, - a31_lo: bool = false, - a31_hi: bool = false, - a32_lo: bool = false, - a32_hi: bool = false, - a33_lo: bool = false, - a33_hi: bool = false, - a34_lo: bool = false, - a34_hi: bool = false, - a35_lo: bool = false, - a35_hi: bool = false, - a36_lo: bool = false, - a36_hi: bool = false, - a37_lo: bool = false, - a37_hi: bool = false, - a38_lo: bool = false, - a38_hi: bool = false, - a39_lo: bool = false, - a39_hi: bool = false, - a40_lo: bool = false, - a40_hi: bool = false, - a41_lo: bool = false, - a41_hi: bool = false, - a42_lo: bool = false, - a42_hi: bool = false, - a43_lo: bool = false, - a43_hi: bool = false, - a44_lo: bool = false, - a44_hi: bool = false, - a45_lo: bool = false, - a45_hi: bool = false, - a46_lo: bool = false, - a46_hi: bool = false, - a47_lo: bool = false, - a47_hi: bool = false, - a48_lo: bool = false, - a48_hi: bool = false, - a49_lo: bool = false, - a49_hi: bool = false, - a50_lo: bool = false, - a50_hi: bool = false, - a51_lo: bool = false, - a51_hi: bool = false, - a52_lo: bool = false, - a52_hi: bool = false, - a53_lo: bool = false, - a53_hi: bool = false, - a54_lo: bool = false, - a54_hi: bool = false, - a55_lo: bool = false, - a55_hi: bool = false, - a56_lo: bool = false, - a56_hi: bool = false, - a57_lo: bool = false, - a57_hi: bool = false, - a58_lo: bool = false, - a58_hi: bool = false, - a59_lo: bool = false, - a59_hi: bool = false, - a60_lo: bool = false, - a60_hi: bool = false, - a61_lo: bool = false, - a61_hi: bool = false, - a62_lo: bool = false, - a62_hi: bool = false, - a63_lo: bool = false, - a63_hi: bool = false, - - a0_x: bool = false, - a0_y: bool = false, - a0_z: bool = false, - a0_t: bool = false, - a1_x: bool = false, - a1_y: bool = false, - a1_z: bool = false, - a1_t: bool = false, - a2_x: bool = false, - a2_y: bool = false, - a2_z: bool = false, - a2_t: bool = false, - a3_x: bool = false, - a3_y: bool = false, - a3_z: bool = false, - a3_t: bool = false, - a4_x: bool = false, - a4_y: bool = false, - a4_z: bool = false, - a4_t: bool = false, - a5_x: bool = false, - a5_y: bool = false, - a5_z: bool = false, - a5_t: bool = false, - a6_x: bool = false, - a6_y: bool = false, - a6_z: bool = false, - a6_t: bool = false, - a7_x: bool = false, - a7_y: bool = false, - a7_z: bool = false, - a7_t: bool = false, - a8_x: bool = false, - a8_y: bool = false, - a8_z: bool = false, - a8_t: bool = false, - a9_x: bool = false, - a9_y: bool = false, - a9_z: bool = false, - a9_t: bool = false, - a10_x: bool = false, - a10_y: bool = false, - a10_z: bool = false, - a10_t: bool = false, - a11_x: bool = false, - a11_y: bool = false, - a11_z: bool = false, - a11_t: bool = false, - a12_x: bool = false, - a12_y: bool = false, - a12_z: bool = false, - a12_t: bool = false, - a13_x: bool = false, - a13_y: bool = false, - a13_z: bool = false, - a13_t: bool = false, - a14_x: bool = false, - a14_y: bool = false, - a14_z: bool = false, - a14_t: bool = false, - a15_x: bool = false, - a15_y: bool = false, - a15_z: bool = false, - a15_t: bool = false, - a16_x: bool = false, - a16_y: bool = false, - a16_z: bool = false, - a16_t: bool = false, - a17_x: bool = false, - a17_y: bool = false, - a17_z: bool = false, - a17_t: bool = false, - a18_x: bool = false, - a18_y: bool = false, - a18_z: bool = false, - a18_t: bool = false, - a19_x: bool = false, - a19_y: bool = false, - a19_z: bool = false, - a19_t: bool = false, - a20_x: bool = false, - a20_y: bool = false, - a20_z: bool = false, - a20_t: bool = false, - a21_x: bool = false, - a21_y: bool = false, - a21_z: bool = false, - a21_t: bool = false, - a22_x: bool = false, - a22_y: bool = false, - a22_z: bool = false, - a22_t: bool = false, - a23_x: bool = false, - a23_y: bool = false, - a23_z: bool = false, - a23_t: bool = false, - a24_x: bool = false, - a24_y: bool = false, - a24_z: bool = false, - a24_t: bool = false, - a25_x: bool = false, - a25_y: bool = false, - a25_z: bool = false, - a25_t: bool = false, - a26_x: bool = false, - a26_y: bool = false, - a26_z: bool = false, - a26_t: bool = false, - a27_x: bool = false, - a27_y: bool = false, - a27_z: bool = false, - a27_t: bool = false, - a28_x: bool = false, - a28_y: bool = false, - a28_z: bool = false, - a28_t: bool = false, - a29_x: bool = false, - a29_y: bool = false, - a29_z: bool = false, - a29_t: bool = false, - a30_x: bool = false, - a30_y: bool = false, - a30_z: bool = false, - a30_t: bool = false, - a31_x: bool = false, - a31_y: bool = false, - a31_z: bool = false, - a31_t: bool = false, - a32_x: bool = false, - a32_y: bool = false, - a32_z: bool = false, - a32_t: bool = false, - a33_x: bool = false, - a33_y: bool = false, - a33_z: bool = false, - a33_t: bool = false, - a34_x: bool = false, - a34_y: bool = false, - a34_z: bool = false, - a34_t: bool = false, - a35_x: bool = false, - a35_y: bool = false, - a35_z: bool = false, - a35_t: bool = false, - a36_x: bool = false, - a36_y: bool = false, - a36_z: bool = false, - a36_t: bool = false, - a37_x: bool = false, - a37_y: bool = false, - a37_z: bool = false, - a37_t: bool = false, - a38_x: bool = false, - a38_y: bool = false, - a38_z: bool = false, - a38_t: bool = false, - a39_x: bool = false, - a39_y: bool = false, - a39_z: bool = false, - a39_t: bool = false, - a40_x: bool = false, - a40_y: bool = false, - a40_z: bool = false, - a40_t: bool = false, - a41_x: bool = false, - a41_y: bool = false, - a41_z: bool = false, - a41_t: bool = false, - a42_x: bool = false, - a42_y: bool = false, - a42_z: bool = false, - a42_t: bool = false, - a43_x: bool = false, - a43_y: bool = false, - a43_z: bool = false, - a43_t: bool = false, - a44_x: bool = false, - a44_y: bool = false, - a44_z: bool = false, - a44_t: bool = false, - a45_x: bool = false, - a45_y: bool = false, - a45_z: bool = false, - a45_t: bool = false, - a46_x: bool = false, - a46_y: bool = false, - a46_z: bool = false, - a46_t: bool = false, - a47_x: bool = false, - a47_y: bool = false, - a47_z: bool = false, - a47_t: bool = false, - a48_x: bool = false, - a48_y: bool = false, - a48_z: bool = false, - a48_t: bool = false, - a49_x: bool = false, - a49_y: bool = false, - a49_z: bool = false, - a49_t: bool = false, - a50_x: bool = false, - a50_y: bool = false, - a50_z: bool = false, - a50_t: bool = false, - a51_x: bool = false, - a51_y: bool = false, - a51_z: bool = false, - a51_t: bool = false, - a52_x: bool = false, - a52_y: bool = false, - a52_z: bool = false, - a52_t: bool = false, - a53_x: bool = false, - a53_y: bool = false, - a53_z: bool = false, - a53_t: bool = false, - a54_x: bool = false, - a54_y: bool = false, - a54_z: bool = false, - a54_t: bool = false, - a55_x: bool = false, - a55_y: bool = false, - a55_z: bool = false, - a55_t: bool = false, - a56_x: bool = false, - a56_y: bool = false, - a56_z: bool = false, - a56_t: bool = false, - a57_x: bool = false, - a57_y: bool = false, - a57_z: bool = false, - a57_t: bool = false, - a58_x: bool = false, - a58_y: bool = false, - a58_z: bool = false, - a58_t: bool = false, - a59_x: bool = false, - a59_y: bool = false, - a59_z: bool = false, - a59_t: bool = false, - a60_x: bool = false, - a60_y: bool = false, - a60_z: bool = false, - a60_t: bool = false, - a61_x: bool = false, - a61_y: bool = false, - a61_z: bool = false, - a61_t: bool = false, - a62_x: bool = false, - a62_y: bool = false, - a62_z: bool = false, - a62_t: bool = false, - a63_x: bool = false, - a63_y: bool = false, - a63_z: bool = false, - a63_t: bool = false, - }, - .lanai => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - /// Condition flags which aren't accessible outside of conditional execution. - sw: bool = false, - - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - }, - .avr => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - flags: bool = false, - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - }, - .msp430 => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - }, - .m68k => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - ccr: bool = false, - - d0: bool = false, - d1: bool = false, - d2: bool = false, - d3: bool = false, - d4: bool = false, - d5: bool = false, - d6: bool = false, - d7: bool = false, - - a0: bool = false, - a1: bool = false, - a2: bool = false, - a3: bool = false, - a4: bool = false, - a5: bool = false, - a6: bool = false, - a7: bool = false, - - macsr: bool = false, - acc: bool = false, - acc0: bool = false, - acc1: bool = false, - acc2: bool = false, - acc3: bool = false, - - mask: bool = false, - fpcr: bool = false, - fpsr: bool = false, - - fp0: bool = false, - fp1: bool = false, - fp2: bool = false, - fp3: bool = false, - fp4: bool = false, - fp5: bool = false, - fp6: bool = false, - fp7: bool = false, - }, - .sparc, .sparc64 => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - psr: bool = false, - gsr: bool = false, - y: bool = false, - - /// asr2; v9+ - ccr: bool = false, - /// Lower bits of `ccr`. - icc: bool = false, - /// Upper bits of `ccr`. - xcc: bool = false, - - g1: bool = false, - g2: bool = false, - g3: bool = false, - g4: bool = false, - g5: bool = false, - g6: bool = false, - g7: bool = false, - - o0: bool = false, - o1: bool = false, - o2: bool = false, - o3: bool = false, - o4: bool = false, - o5: bool = false, - o6: bool = false, - o7: bool = false, - - l0: bool = false, - l1: bool = false, - l2: bool = false, - l3: bool = false, - l4: bool = false, - l5: bool = false, - l6: bool = false, - l7: bool = false, - - i0: bool = false, - i1: bool = false, - i2: bool = false, - i3: bool = false, - i4: bool = false, - i5: bool = false, - i6: bool = false, - i7: bool = false, - - fsr: bool = false, - fprs: bool = false, - - q0: bool = false, - q1: bool = false, - q2: bool = false, - q3: bool = false, - q4: bool = false, - q5: bool = false, - q6: bool = false, - q7: bool = false, - q8: bool = false, - q9: bool = false, - q10: bool = false, - q11: bool = false, - q12: bool = false, - q13: bool = false, - q14: bool = false, - q15: bool = false, - }, - .bpfel, .bpfeb => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - - w0: bool = false, - w1: bool = false, - w2: bool = false, - w3: bool = false, - w4: bool = false, - w5: bool = false, - w6: bool = false, - w7: bool = false, - w8: bool = false, - w9: bool = false, - }, - .hexagon => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - sa0: bool = false, - sa1: bool = false, - lc0: bool = false, - lc1: bool = false, - m0: bool = false, - m1: bool = false, - usr: bool = false, - ugp: bool = false, - gp: bool = false, - cs0: bool = false, - cs1: bool = false, - framelimit: bool = false, - framekey: bool = false, - - p0: bool = false, - p1: bool = false, - p2: bool = false, - p3: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - - q0: bool = false, - q1: bool = false, - q2: bool = false, - q3: bool = false, - - v0: bool = false, - v1: bool = false, - v2: bool = false, - v3: bool = false, - v4: bool = false, - v5: bool = false, - v6: bool = false, - v7: bool = false, - v8: bool = false, - v9: bool = false, - v10: bool = false, - v11: bool = false, - v12: bool = false, - v13: bool = false, - v14: bool = false, - v15: bool = false, - v16: bool = false, - v17: bool = false, - v18: bool = false, - v19: bool = false, - v20: bool = false, - v21: bool = false, - v22: bool = false, - v23: bool = false, - v24: bool = false, - v25: bool = false, - v26: bool = false, - v27: bool = false, - v28: bool = false, - v29: bool = false, - v30: bool = false, - v31: bool = false, - }, - .s390x => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - ps: bool = false, - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - - fpc: bool = false, - - v0: bool = false, - v1: bool = false, - v2: bool = false, - v3: bool = false, - v4: bool = false, - v5: bool = false, - v6: bool = false, - v7: bool = false, - v8: bool = false, - v9: bool = false, - v10: bool = false, - v11: bool = false, - v12: bool = false, - v13: bool = false, - v14: bool = false, - v15: bool = false, - v16: bool = false, - v17: bool = false, - v18: bool = false, - v19: bool = false, - v20: bool = false, - v21: bool = false, - v22: bool = false, - v23: bool = false, - v24: bool = false, - v25: bool = false, - v26: bool = false, - v27: bool = false, - v28: bool = false, - v29: bool = false, - v30: bool = false, - v31: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - }, - .ve => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - psw: bool = false, - - s0: bool = false, - s1: bool = false, - s2: bool = false, - s3: bool = false, - s4: bool = false, - s5: bool = false, - s6: bool = false, - s7: bool = false, - s8: bool = false, - s9: bool = false, - s10: bool = false, - s11: bool = false, - s12: bool = false, - s13: bool = false, - s14: bool = false, - s15: bool = false, - s16: bool = false, - s17: bool = false, - s18: bool = false, - s19: bool = false, - s20: bool = false, - s21: bool = false, - s22: bool = false, - s23: bool = false, - s24: bool = false, - s25: bool = false, - s26: bool = false, - s27: bool = false, - s28: bool = false, - s29: bool = false, - s30: bool = false, - s31: bool = false, - s32: bool = false, - s33: bool = false, - s34: bool = false, - s35: bool = false, - s36: bool = false, - s37: bool = false, - s38: bool = false, - s39: bool = false, - s40: bool = false, - s41: bool = false, - s42: bool = false, - s43: bool = false, - s44: bool = false, - s45: bool = false, - s46: bool = false, - s47: bool = false, - s48: bool = false, - s49: bool = false, - s50: bool = false, - s51: bool = false, - s52: bool = false, - s53: bool = false, - s54: bool = false, - s55: bool = false, - s56: bool = false, - s57: bool = false, - s58: bool = false, - s59: bool = false, - s60: bool = false, - s61: bool = false, - s62: bool = false, - s63: bool = false, - - vixr: bool = false, - vl: bool = false, - - vm0: bool = false, - vm1: bool = false, - vm2: bool = false, - vm3: bool = false, - vm4: bool = false, - vm5: bool = false, - vm6: bool = false, - vm7: bool = false, - vm8: bool = false, - vm9: bool = false, - vm10: bool = false, - vm11: bool = false, - vm12: bool = false, - vm13: bool = false, - vm14: bool = false, - vm15: bool = false, - - v0: bool = false, - v1: bool = false, - v2: bool = false, - v3: bool = false, - v4: bool = false, - v5: bool = false, - v6: bool = false, - v7: bool = false, - v8: bool = false, - v9: bool = false, - v10: bool = false, - v11: bool = false, - v12: bool = false, - v13: bool = false, - v14: bool = false, - v15: bool = false, - v16: bool = false, - v17: bool = false, - v18: bool = false, - v19: bool = false, - v20: bool = false, - v21: bool = false, - v22: bool = false, - v23: bool = false, - v24: bool = false, - v25: bool = false, - v26: bool = false, - v27: bool = false, - v28: bool = false, - v29: bool = false, - v30: bool = false, - v31: bool = false, - v32: bool = false, - v33: bool = false, - v34: bool = false, - v35: bool = false, - v36: bool = false, - v37: bool = false, - v38: bool = false, - v39: bool = false, - v40: bool = false, - v41: bool = false, - v42: bool = false, - v43: bool = false, - v44: bool = false, - v45: bool = false, - v46: bool = false, - v47: bool = false, - v48: bool = false, - v49: bool = false, - v50: bool = false, - v51: bool = false, - v52: bool = false, - v53: bool = false, - v54: bool = false, - v55: bool = false, - v56: bool = false, - v57: bool = false, - v58: bool = false, - v59: bool = false, - v60: bool = false, - v61: bool = false, - v62: bool = false, - v63: bool = false, - }, - .kalimba => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - i0: bool = false, - i1: bool = false, - i2: bool = false, - i3: bool = false, - i4: bool = false, - i5: bool = false, - i6: bool = false, - i7: bool = false, - - m0: bool = false, - m1: bool = false, - m2: bool = false, - m3: bool = false, - l0: bool = false, - l1: bool = false, - l2: bool = false, - l3: bool = false, - l4: bool = false, - l5: bool = false, - doloopstart: bool = false, - doloopend: bool = false, - divresult: bool = false, - divremainder: bool = false, - rmac: bool = false, - rmac0: bool = false, - rmac1: bool = false, - rmac2: bool = false, - rlink: bool = false, - rflags: bool = false, - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - }, - .or1k => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - maclo: bool = false, - machi: bool = false, - fpcsr: bool = false, - fpmaddlo: bool = false, - fpmaddhi: bool = false, - vmaclo: bool = false, - vmachi: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - }, - .csky => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - psr: bool = false, - hi: bool = false, - lo: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - - vr0: bool = false, - vr1: bool = false, - vr2: bool = false, - vr3: bool = false, - vr4: bool = false, - vr5: bool = false, - vr6: bool = false, - vr7: bool = false, - vr8: bool = false, - vr9: bool = false, - vr10: bool = false, - vr11: bool = false, - vr12: bool = false, - vr13: bool = false, - vr14: bool = false, - vr15: bool = false, - vr16: bool = false, - vr17: bool = false, - vr18: bool = false, - vr19: bool = false, - vr20: bool = false, - vr21: bool = false, - vr22: bool = false, - vr23: bool = false, - vr24: bool = false, - vr25: bool = false, - vr26: bool = false, - vr27: bool = false, - vr28: bool = false, - vr29: bool = false, - vr30: bool = false, - vr31: bool = false, - }, - .arc, .arceb => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - status32: bool = false, - aux_macmode: bool = false, - mulhi: bool = false, - lp_start: bool = false, - lp_end: bool = false, - jli_base: bool = false, - ldi_base: bool = false, - ei_base: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - r32: bool = false, - r33: bool = false, - r34: bool = false, - r35: bool = false, - r36: bool = false, - r37: bool = false, - r38: bool = false, - r39: bool = false, - r40: bool = false, - r41: bool = false, - r42: bool = false, - r43: bool = false, - r44: bool = false, - r45: bool = false, - r46: bool = false, - r47: bool = false, - r48: bool = false, - r49: bool = false, - r50: bool = false, - r51: bool = false, - r52: bool = false, - r53: bool = false, - r54: bool = false, - r55: bool = false, - r56: bool = false, - r57: bool = false, - r58: bool = false, - r59: bool = false, - r60: bool = false, - - fmp_ctrl: bool = false, - dsp_ctrl: bool = false, - acc0_lo: bool = false, - acc0_glo: bool = false, - acc0_hi: bool = false, - acc0_ghi: bool = false, - fp_ctrl: bool = false, - fpu_status: bool = false, - vfpu_status: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - f16: bool = false, - f17: bool = false, - f18: bool = false, - f19: bool = false, - f20: bool = false, - f21: bool = false, - f22: bool = false, - f23: bool = false, - f24: bool = false, - f25: bool = false, - f26: bool = false, - f27: bool = false, - f28: bool = false, - f29: bool = false, - f30: bool = false, - f31: bool = false, - }, - .loongarch32, .loongarch64 => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - - fcc0: bool = false, - fcc1: bool = false, - fcc2: bool = false, - fcc3: bool = false, - fcc4: bool = false, - fcc5: bool = false, - fcc6: bool = false, - fcc7: bool = false, - - fcsr0: bool = false, - fcsr1: bool = false, - fcsr2: bool = false, - fcsr3: bool = false, - - xr0: bool = false, - xr1: bool = false, - xr2: bool = false, - xr3: bool = false, - xr4: bool = false, - xr5: bool = false, - xr6: bool = false, - xr7: bool = false, - xr8: bool = false, - xr9: bool = false, - xr10: bool = false, - xr11: bool = false, - xr12: bool = false, - xr13: bool = false, - xr14: bool = false, - xr15: bool = false, - xr16: bool = false, - xr17: bool = false, - xr18: bool = false, - xr19: bool = false, - xr20: bool = false, - xr21: bool = false, - xr22: bool = false, - xr23: bool = false, - xr24: bool = false, - xr25: bool = false, - xr26: bool = false, - xr27: bool = false, - xr28: bool = false, - xr29: bool = false, - xr30: bool = false, - xr31: bool = false, - - vr0: bool = false, - vr1: bool = false, - vr2: bool = false, - vr3: bool = false, - vr4: bool = false, - vr5: bool = false, - vr6: bool = false, - vr7: bool = false, - vr8: bool = false, - vr9: bool = false, - vr10: bool = false, - vr11: bool = false, - vr12: bool = false, - vr13: bool = false, - vr14: bool = false, - vr15: bool = false, - vr16: bool = false, - vr17: bool = false, - vr18: bool = false, - vr19: bool = false, - vr20: bool = false, - vr21: bool = false, - vr22: bool = false, - vr23: bool = false, - vr24: bool = false, - vr25: bool = false, - vr26: bool = false, - vr27: bool = false, - vr28: bool = false, - vr29: bool = false, - vr30: bool = false, - vr31: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - f16: bool = false, - f17: bool = false, - f18: bool = false, - f19: bool = false, - f20: bool = false, - f21: bool = false, - f22: bool = false, - f23: bool = false, - f24: bool = false, - f25: bool = false, - f26: bool = false, - f27: bool = false, - f28: bool = false, - f29: bool = false, - f30: bool = false, - f31: bool = false, - }, - .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - cr0: bool = false, - cr1: bool = false, - cr2: bool = false, - cr3: bool = false, - cr4: bool = false, - cr5: bool = false, - cr6: bool = false, - cr7: bool = false, - - xer: bool = false, - ctr: bool = false, - lr: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - - fpscr: bool = false, - vscr: bool = false, - - vs0: bool = false, - vs1: bool = false, - vs2: bool = false, - vs3: bool = false, - vs4: bool = false, - vs5: bool = false, - vs6: bool = false, - vs7: bool = false, - vs8: bool = false, - vs9: bool = false, - vs10: bool = false, - vs11: bool = false, - vs12: bool = false, - vs13: bool = false, - vs14: bool = false, - vs15: bool = false, - vs16: bool = false, - vs17: bool = false, - vs18: bool = false, - vs19: bool = false, - vs20: bool = false, - vs21: bool = false, - vs22: bool = false, - vs23: bool = false, - vs24: bool = false, - vs25: bool = false, - vs26: bool = false, - vs27: bool = false, - vs28: bool = false, - vs29: bool = false, - vs30: bool = false, - vs31: bool = false, - vs32: bool = false, - vs33: bool = false, - vs34: bool = false, - vs35: bool = false, - vs36: bool = false, - vs37: bool = false, - vs38: bool = false, - vs39: bool = false, - vs40: bool = false, - vs41: bool = false, - vs42: bool = false, - vs43: bool = false, - vs44: bool = false, - vs45: bool = false, - vs46: bool = false, - vs47: bool = false, - vs48: bool = false, - vs49: bool = false, - vs50: bool = false, - vs51: bool = false, - vs52: bool = false, - vs53: bool = false, - vs54: bool = false, - vs55: bool = false, - vs56: bool = false, - vs57: bool = false, - vs58: bool = false, - vs59: bool = false, - vs60: bool = false, - vs61: bool = false, - vs62: bool = false, - vs63: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - f16: bool = false, - f17: bool = false, - f18: bool = false, - f19: bool = false, - f20: bool = false, - f21: bool = false, - f22: bool = false, - f23: bool = false, - f24: bool = false, - f25: bool = false, - f26: bool = false, - f27: bool = false, - f28: bool = false, - f29: bool = false, - f30: bool = false, - f31: bool = false, - - v0: bool = false, - v1: bool = false, - v2: bool = false, - v3: bool = false, - v4: bool = false, - v5: bool = false, - v6: bool = false, - v7: bool = false, - v8: bool = false, - v9: bool = false, - v10: bool = false, - v11: bool = false, - v12: bool = false, - v13: bool = false, - v14: bool = false, - v15: bool = false, - v16: bool = false, - v17: bool = false, - v18: bool = false, - v19: bool = false, - v20: bool = false, - v21: bool = false, - v22: bool = false, - v23: bool = false, - v24: bool = false, - v25: bool = false, - v26: bool = false, - v27: bool = false, - v28: bool = false, - v29: bool = false, - v30: bool = false, - v31: bool = false, - - acc0: bool = false, - acc1: bool = false, - acc2: bool = false, - acc3: bool = false, - acc4: bool = false, - acc5: bool = false, - acc6: bool = false, - acc7: bool = false, - - acc: bool = false, - spefsc: bool = false, - }, - .mips, .mipsel, .mips64, .mips64el => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - lr: bool = false, - - hi: bool = false, - lo: bool = false, - ac0: bool = false, - ac1: bool = false, - ac2: bool = false, - ac3: bool = false, - acx: bool = false, - - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - - fcsr: bool = false, - fcc0: bool = false, - fcc1: bool = false, - fcc2: bool = false, - fcc3: bool = false, - fcc4: bool = false, - fcc5: bool = false, - fcc6: bool = false, - fcc7: bool = false, - - w0: bool = false, - w1: bool = false, - w2: bool = false, - w3: bool = false, - w4: bool = false, - w5: bool = false, - w6: bool = false, - w7: bool = false, - w8: bool = false, - w9: bool = false, - w10: bool = false, - w11: bool = false, - w12: bool = false, - w13: bool = false, - w14: bool = false, - w15: bool = false, - w16: bool = false, - w17: bool = false, - w18: bool = false, - w19: bool = false, - w20: bool = false, - w21: bool = false, - w22: bool = false, - w23: bool = false, - w24: bool = false, - w25: bool = false, - w26: bool = false, - w27: bool = false, - w28: bool = false, - w29: bool = false, - w30: bool = false, - w31: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - f16: bool = false, - f17: bool = false, - f18: bool = false, - f19: bool = false, - f20: bool = false, - f21: bool = false, - f22: bool = false, - f23: bool = false, - f24: bool = false, - f25: bool = false, - f26: bool = false, - f27: bool = false, - f28: bool = false, - f29: bool = false, - f30: bool = false, - f31: bool = false, - - mpl0: bool = false, - mpl1: bool = false, - mpl2: bool = false, - - p0: bool = false, - p1: bool = false, - p2: bool = false, - - msa_ir: bool = false, - msa_csr: bool = false, - msa_access: bool = false, - msa_save: bool = false, - msa_modify: bool = false, - msa_request: bool = false, - msa_map: bool = false, - msa_unmap: bool = false, - }, - .alpha => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - - f0: bool = false, - f1: bool = false, - f2: bool = false, - f3: bool = false, - f4: bool = false, - f5: bool = false, - f6: bool = false, - f7: bool = false, - f8: bool = false, - f9: bool = false, - f10: bool = false, - f11: bool = false, - f12: bool = false, - f13: bool = false, - f14: bool = false, - f15: bool = false, - f16: bool = false, - f17: bool = false, - f18: bool = false, - f19: bool = false, - f20: bool = false, - f21: bool = false, - f22: bool = false, - f23: bool = false, - f24: bool = false, - f25: bool = false, - f26: bool = false, - f27: bool = false, - f28: bool = false, - f29: bool = false, - f30: bool = false, - }, - .hppa, .hppa64 => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - sar: bool = false, - - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - - fr4: bool = false, - fr5: bool = false, - fr6: bool = false, - fr7: bool = false, - fr8: bool = false, - fr9: bool = false, - fr10: bool = false, - fr11: bool = false, - fr12: bool = false, - fr13: bool = false, - fr14: bool = false, - fr15: bool = false, - fr16: bool = false, - fr17: bool = false, - fr18: bool = false, - fr19: bool = false, - fr20: bool = false, - fr21: bool = false, - fr22: bool = false, - fr23: bool = false, - fr24: bool = false, - fr25: bool = false, - fr26: bool = false, - fr27: bool = false, - fr28: bool = false, - fr29: bool = false, - fr30: bool = false, - fr31: bool = false, - - fr4r: bool = false, - fr5r: bool = false, - fr6r: bool = false, - fr7r: bool = false, - fr8r: bool = false, - fr9r: bool = false, - fr10r: bool = false, - fr11r: bool = false, - fr12r: bool = false, - fr13r: bool = false, - fr14r: bool = false, - fr15r: bool = false, - fr16r: bool = false, - fr17r: bool = false, - fr18r: bool = false, - fr19r: bool = false, - fr20r: bool = false, - fr21r: bool = false, - fr22r: bool = false, - fr23r: bool = false, - fr24r: bool = false, - fr25r: bool = false, - fr26r: bool = false, - fr27r: bool = false, - fr28r: bool = false, - fr29r: bool = false, - fr30r: bool = false, - fr31r: bool = false, - }, - .microblaze, .microblazeel => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - rmsr: bool = false, - - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - r16: bool = false, - r17: bool = false, - r18: bool = false, - r19: bool = false, - r20: bool = false, - r21: bool = false, - r22: bool = false, - r23: bool = false, - r24: bool = false, - r25: bool = false, - r26: bool = false, - r27: bool = false, - r28: bool = false, - r29: bool = false, - r30: bool = false, - r31: bool = false, - }, - .sh, .sheb => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - - sr: bool = false, - gbr: bool = false, - pr: bool = false, - - r0: bool = false, - r1: bool = false, - r2: bool = false, - r3: bool = false, - r4: bool = false, - r5: bool = false, - r6: bool = false, - r7: bool = false, - r8: bool = false, - r9: bool = false, - r10: bool = false, - r11: bool = false, - r12: bool = false, - r13: bool = false, - r14: bool = false, - r15: bool = false, - - mach: bool = false, - macl: bool = false, - - fr0: bool = false, - fr1: bool = false, - fr2: bool = false, - fr3: bool = false, - fr4: bool = false, - fr5: bool = false, - fr6: bool = false, - fr7: bool = false, - fr8: bool = false, - fr9: bool = false, - fr10: bool = false, - fr11: bool = false, - fr12: bool = false, - fr13: bool = false, - fr14: bool = false, - fr15: bool = false, - - dr0: bool = false, - dr2: bool = false, - dr4: bool = false, - dr6: bool = false, - dr8: bool = false, - dr10: bool = false, - dr12: bool = false, - dr14: bool = false, - - fv0: bool = false, - fv4: bool = false, - fv8: bool = false, - fv12: bool = false, - - xf0: bool = false, - xf1: bool = false, - xf2: bool = false, - xf3: bool = false, - xf4: bool = false, - xf5: bool = false, - xf6: bool = false, - xf7: bool = false, - xf8: bool = false, - xf9: bool = false, - xf10: bool = false, - xf11: bool = false, - xf12: bool = false, - xf13: bool = false, - xf14: bool = false, - xf15: bool = false, - - xd0: bool = false, - xd2: bool = false, - xd4: bool = false, - xd6: bool = false, - xd8: bool = false, - xd10: bool = false, - xd12: bool = false, - xd14: bool = false, - - xmtrx: bool = false, - - fpul: bool = false, - fpscr: bool = false, - - ms: bool = false, - me: bool = false, - - rs: bool = false, - re: bool = false, - - a0: bool = false, - a0g: bool = false, - a1: bool = false, - a1g: bool = false, - m0: bool = false, - m1: bool = false, - x0: bool = false, - x1: bool = false, - y0: bool = false, - y1: bool = false, - - dsr: bool = false, - }, - else => packed struct { - /// Whether the inline assembly code may perform stores to memory - /// addresses other than those derived from input pointer provenance. - memory: bool = false, - }, -}; diff --git a/lib/std/lang.zig b/lib/std/lang.zig new file mode 100644 index 0000000000000000000000000000000000000000..e06c4ba313287bbd534309df6021127a8475b6aa --- /dev/null +++ b/lib/std/lang.zig @@ -0,0 +1,1254 @@ +//! Types and values provided by the Zig language. + +const builtin = @import("builtin"); +const std = @import("std.zig"); +const root = @import("root"); + +pub const assembly = @import("lang/assembly.zig"); + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const StackTrace = struct { + index: usize, + instruction_addresses: []usize, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const GlobalLinkage = enum(u2) { + internal, + strong, + weak, + link_once, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const SymbolVisibility = enum(u2) { + default, + hidden, + protected, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const AtomicOrder = enum { + unordered, + monotonic, + acquire, + release, + acq_rel, + seq_cst, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const ReduceOp = enum { + And, + Or, + Xor, + Min, + Max, + Add, + Mul, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const AtomicRmwOp = enum { + /// Exchange - store the operand unmodified. + /// Supports enums, integers, and floats. + Xchg, + /// Add operand to existing value. + /// Supports integers and floats. + /// For integers, two's complement wraparound applies. + Add, + /// Subtract operand from existing value. + /// Supports integers and floats. + /// For integers, two's complement wraparound applies. + Sub, + /// Perform bitwise AND on existing value with operand. + /// Supports integers. + And, + /// Perform bitwise NAND on existing value with operand. + /// Supports integers. + Nand, + /// Perform bitwise OR on existing value with operand. + /// Supports integers. + Or, + /// Perform bitwise XOR on existing value with operand. + /// Supports integers. + Xor, + /// Store operand if it is larger than the existing value. + /// Supports integers and floats. + Max, + /// Store operand if it is smaller than the existing value. + /// Supports integers and floats. + Min, +}; + +/// The code model puts constraints on the location of symbols and the size of code and data. +/// The selection of a code model is a trade off on speed and restrictions that needs to be selected on a per application basis to meet its requirements. +/// A slightly more detailed explanation can be found in (for example) the [System V Application Binary Interface (x86_64)](https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf) 3.5.1. +/// +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const CodeModel = enum { + default, + extreme, + kernel, + large, + medany, + medium, + medlow, + medmid, + normal, + small, + tiny, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const OptimizeMode = enum { + Debug, + ReleaseSafe, + ReleaseFast, + ReleaseSmall, +}; + +/// The calling convention of a function defines how arguments and return values are passed, as well +/// as any other requirements which callers and callees must respect, such as register preservation +/// and stack alignment. +/// +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const CallingConvention = union(enum(u8)) { + pub const Tag = @typeInfo(CallingConvention).@"union".tag_type.?; + + /// This is an alias for the default C calling convention for this target. + /// Functions marked as `extern` or `export` are given this calling convention by default. + pub const c = builtin.target.cCallingConvention().?; + + pub const winapi: CallingConvention = switch (builtin.target.cpu.arch) { + .x86_64 => .{ .x86_64_win = .{} }, + .x86 => .{ .x86_stdcall = .{} }, + .aarch64 => .{ .aarch64_aapcs_win = .{} }, + .thumb => .{ .arm_aapcs_vfp = .{} }, + else => unreachable, + }; + + pub const kernel: CallingConvention = switch (builtin.target.cpu.arch) { + .amdgcn => .amdgcn_kernel, + .nvptx, .nvptx64 => .nvptx_kernel, + .spirv32, .spirv64 => .spirv_kernel, + else => unreachable, + }; + + /// The default Zig calling convention when neither `export` nor `inline` is specified. + /// This calling convention makes no guarantees about stack alignment, registers, etc. + /// It can only be used within this Zig compilation unit. + auto, + + /// The calling convention of a function that can be called with `async` syntax. An `async` call + /// of a runtime-known function must target a function with this calling convention. + /// Comptime-known functions with other calling conventions may be coerced to this one. + async, + + /// Functions with this calling convention have no prologue or epilogue, making the function + /// uncallable in regular Zig code. This can be useful when integrating with assembly. + naked, + + /// This calling convention is exactly equivalent to using the `inline` keyword on a function + /// definition. This function will be semantically inlined by the Zig compiler at call sites. + /// Pointers to inline functions are comptime-only. + @"inline", + + // Calling conventions for the `x86_64` architecture. + x86_64_sysv: CommonOptions, + x86_64_x32: CommonOptions, + x86_64_win: CommonOptions, + x86_64_regcall_v3_sysv: CommonOptions, + x86_64_regcall_v4_win: CommonOptions, + x86_64_vectorcall: CommonOptions, + x86_64_interrupt: CommonOptions, + + // Calling conventions for the `x86` architecture. + x86_sysv: X86RegparmOptions, + x86_win: X86RegparmOptions, + x86_stdcall: X86RegparmOptions, + x86_fastcall: CommonOptions, + x86_thiscall: CommonOptions, + x86_thiscall_mingw: CommonOptions, + x86_regcall_v3: CommonOptions, + x86_regcall_v4_win: CommonOptions, + x86_vectorcall: CommonOptions, + x86_interrupt: CommonOptions, + + // Calling conventions for the `x86_16` architecture. + + x86_16_cdecl: CommonOptions, + x86_16_stdcall: CommonOptions, + x86_16_regparmcall: CommonOptions, + x86_16_interrupt: CommonOptions, + + // Calling conventions for the `aarch64` and `aarch64_be` architectures. + aarch64_aapcs: CommonOptions, + aarch64_aapcs_darwin: CommonOptions, + aarch64_aapcs_win: CommonOptions, + aarch64_vfabi: CommonOptions, + aarch64_vfabi_sve: CommonOptions, + + /// The standard `alpha` calling convention. + alpha_osf: CommonOptions, + + // Calling convetions for the `arm`, `armeb`, `thumb`, and `thumbeb` architectures. + /// ARM Architecture Procedure Call Standard + arm_aapcs: CommonOptions, + /// ARM Architecture Procedure Call Standard Vector Floating-Point + arm_aapcs_vfp: CommonOptions, + arm_interrupt: ArmInterruptOptions, + + // Calling conventions for the `mips64` and `mips64el` architectures. + mips64_n64: CommonOptions, + mips64_n32: CommonOptions, + mips64_interrupt: MipsInterruptOptions, + + // Calling conventions for the `mips` and `mipsel` architectures. + mips_o32: CommonOptions, + mips_interrupt: MipsInterruptOptions, + + // Calling conventions for the `riscv64` architecture. + riscv64_lp64: CommonOptions, + riscv64_lp64_v: CommonOptions, + riscv64_interrupt: RiscvInterruptOptions, + + // Calling conventions for the `riscv32` architecture. + riscv32_ilp32: CommonOptions, + riscv32_ilp32_v: CommonOptions, + riscv32_interrupt: RiscvInterruptOptions, + + // Calling conventions for the `sparc64` architecture. + sparc64_sysv: CommonOptions, + + // Calling conventions for the `sparc` architecture. + sparc_sysv: CommonOptions, + + // Calling conventions for the `powerpc64` and `powerpc64le` architectures. + powerpc64_elf: CommonOptions, + powerpc64_elf_altivec: CommonOptions, + powerpc64_elf_v2: CommonOptions, + + // Calling conventions for the `powerpc` and `powerpcle` architectures. + powerpc_sysv: CommonOptions, + powerpc_sysv_altivec: CommonOptions, + powerpc_aix: CommonOptions, + powerpc_aix_altivec: CommonOptions, + + /// The standard `wasm32` and `wasm64` calling convention, as specified in the WebAssembly Tool Conventions. + wasm_mvp: CommonOptions, + + /// The standard `arc`/`arceb` calling convention. + arc_sysv: CommonOptions, + arc_interrupt: ArcInterruptOptions, + + // Calling conventions for the `avr` architecture. + avr_gnu, + avr_builtin, + avr_signal, + avr_interrupt, + + /// The standard `bpfel`/`bpfeb` calling convention. + bpf_std: CommonOptions, + + // Calling conventions for the `csky` architecture. + csky_sysv: CommonOptions, + csky_interrupt: CommonOptions, + + // Calling conventions for the `hexagon` architecture. + hexagon_sysv: CommonOptions, + hexagon_sysv_hvx: CommonOptions, + + /// The standard `hppa` calling convention. + hppa_elf: CommonOptions, + + /// The standard `hppa64` calling convention. + hppa64_elf: CommonOptions, + + kvx_lp64: CommonOptions, + kvx_ilp32: CommonOptions, + + /// The standard `lanai` calling convention. + lanai_sysv: CommonOptions, + + /// The standard `loongarch64` calling convention. + loongarch64_lp64: CommonOptions, + + /// The standard `loongarch32` calling convention. + loongarch32_ilp32: CommonOptions, + + // Calling conventions for the `m68k` architecture. + m68k_sysv: CommonOptions, + m68k_gnu: CommonOptions, + m68k_rtd: CommonOptions, + m68k_interrupt: CommonOptions, + + /// The standard `microblaze`/`microblazeel` calling convention. + microblaze_std: CommonOptions, + microblaze_interrupt: MicroblazeInterruptOptions, + + /// The standard `msp430` calling convention. + msp430_eabi: CommonOptions, + msp430_interrupt: CommonOptions, + + /// The standard `or1k` calling convention. + or1k_sysv: CommonOptions, + + /// The standard `propeller` calling convention. + propeller_sysv: CommonOptions, + + // Calling conventions for the `s390x` architecture. + s390x_sysv: CommonOptions, + s390x_sysv_vx: CommonOptions, + + // Calling conventions for the `sh`/`sheb` architecture. + sh_gnu: CommonOptions, + sh_renesas: CommonOptions, + sh_interrupt: ShInterruptOptions, + + /// The standard `ve` calling convention. + ve_sysv: CommonOptions, + + // Calling conventions for the `xcore` architecture. + xcore_xs1: CommonOptions, + xcore_xs2: CommonOptions, + + // Calling conventions for the `xtensa`/`xtensaeb` architecture. + xtensa_call0: CommonOptions, + xtensa_windowed: CommonOptions, + + // Calling conventions for the `amdgcn` architecture. + amdgcn_device: CommonOptions, + amdgcn_kernel, + amdgcn_cs: CommonOptions, + + // Calling conventions for the `nvptx` and `nvptx64` architectures. + nvptx_device, + nvptx_kernel, + + // Calling conventions for kernels and shaders on the `spirv`, `spirv32`, and `spirv64` architectures. + spirv_device, + spirv_kernel, + spirv_fragment, + spirv_vertex, + + // Calling conventions for the `ez80` architecture. + ez80_cet, + ez80_tiflags, + + /// Options shared across most calling conventions. + pub const CommonOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + }; + + /// Options for x86 calling conventions which support the regparm attribute to pass some + /// arguments in registers. + pub const X86RegparmOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + /// The number of arguments to pass in registers before passing the remaining arguments + /// according to the calling convention. + /// Equivalent to `__attribute__((regparm(x)))` in Clang and GCC. + register_params: u2 = 0, + }; + + /// Options for the `arc_interrupt` calling convention. + pub const ArcInterruptOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + /// The kind of interrupt being received. + type: InterruptType, + + pub const InterruptType = enum(u2) { + ilink1, + ilink2, + ilink, + firq, + }; + }; + + /// Options for the `arm_interrupt` calling convention. + pub const ArmInterruptOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + /// The kind of interrupt being received. + type: InterruptType = .generic, + + pub const InterruptType = enum(u3) { + generic, + irq, + fiq, + swi, + abort, + undef, + }; + }; + + /// Options for the `microblaze_interrupt` calling convention. + pub const MicroblazeInterruptOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + type: InterruptType = .regular, + + pub const InterruptType = enum(u2) { + /// User exception; return with `rtsd`. + user, + /// Regular interrupt; return with `rtid`. + regular, + /// Fast interrupt; return with `rtid`. + fast, + /// Software breakpoint; return with `rtbd`. + breakpoint, + }; + }; + + /// Options for the `mips_interrupt` and `mips64_interrupt` calling conventions. + pub const MipsInterruptOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + /// The interrupt mode. + mode: InterruptMode = .eic, + + pub const InterruptMode = enum(u4) { + eic, + sw0, + sw1, + hw0, + hw1, + hw2, + hw3, + hw4, + hw5, + }; + }; + + /// Options for the `riscv32_interrupt` and `riscv64_interrupt` calling conventions. + pub const RiscvInterruptOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + /// The privilege mode. + mode: PrivilegeMode, + + pub const PrivilegeMode = enum(u2) { + supervisor, + machine, + }; + }; + + /// Options for the `sh_interrupt` calling convention. + pub const ShInterruptOptions = struct { + /// The boundary the stack is aligned to when the function is called. + /// `null` means the default for this calling convention. + incoming_stack_alignment: ?u64 = null, + save: SaveBehavior = .full, + + pub const SaveBehavior = enum(u3) { + /// Save only fpscr (if applicable). + fpscr, + /// Save only high-numbered registers, i.e. r0 through r7 are *not* saved. + high, + /// Save all registers normally. + full, + /// Save all registers using the CPU's fast register bank. + bank, + }; + }; + + /// Returns the array of `std.Target.Cpu.Arch` to which this `CallingConvention` applies. + /// Asserts that `cc` is not `.auto`, `.@"async"`, `.naked`, or `.@"inline"`. + pub fn archs(cc: CallingConvention) []const std.Target.Cpu.Arch { + return std.Target.Cpu.Arch.fromCallingConvention(cc); + } + + pub fn eql(a: CallingConvention, b: CallingConvention) bool { + return std.meta.eql(a, b); + } + + pub fn withStackAlign(cc: CallingConvention, incoming_stack_alignment: u64) CallingConvention { + const tag: CallingConvention.Tag = cc; + var result = cc; + @field(result, @tagName(tag)).incoming_stack_alignment = incoming_stack_alignment; + return result; + } +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const AddressSpace = enum(u5) { + // CPU address spaces. + generic, + gs, + fs, + ss, + + // x86_16 extra address spaces. + /// Allows addressing the entire address space by storing both segment and offset. + far, + + // GPU address spaces. + global, + constant, + param, + shared, + local, + input, + output, + uniform, + push_constant, + storage_buffer, + physical_storage_buffer, + + // AVR address spaces. + flash, + flash1, + flash2, + flash3, + flash4, + flash5, + + // Propeller address spaces. + + /// This address space only addresses the cog-local ram. + cog, + + /// This address space only addresses shared hub ram. + hub, + + /// This address space only addresses the "lookup" ram + lut, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const SourceLocation = struct { + /// The name chosen when compiling. Not a file path. + module: [:0]const u8, + /// Relative to the root directory of its module. + file: [:0]const u8, + fn_name: [:0]const u8, + line: u32, + column: u32, +}; + +pub const TypeId = std.meta.Tag(Type); + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const Type = union(enum) { + type, + void, + bool, + noreturn, + int: Int, + float: Float, + pointer: Pointer, + array: Array, + @"struct": Struct, + comptime_float, + comptime_int, + undefined, + null, + optional: Optional, + error_union: ErrorUnion, + error_set: ErrorSet, + @"enum": Enum, + @"union": Union, + @"fn": Fn, + @"opaque": Opaque, + frame: Frame, + @"anyframe": AnyFrame, + vector: Vector, + enum_literal, + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Int = struct { + signedness: Signedness, + bits: u16, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Float = struct { + bits: u16, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Pointer = struct { + size: Size, + is_const: bool, + is_volatile: bool, + /// `null` means implicit alignment, which is equivalent to `@alignOf(child)`. + alignment: ?usize, + address_space: AddressSpace, + child: type, + is_allowzero: bool, + + /// The type of the sentinel is the element type of the pointer, which is + /// the value of the `child` field in this struct. However there is no way + /// to refer to that type here, so we use `*const anyopaque`. + /// See also: `sentinel` + sentinel_ptr: ?*const anyopaque, + + /// Loads the pointer type's sentinel value from `sentinel_ptr`. + /// Returns `null` if the pointer type has no sentinel. + pub inline fn sentinel(comptime ptr: Pointer) ?ptr.child { + const sp: *const ptr.child = @ptrCast(@alignCast(ptr.sentinel_ptr orelse return null)); + return sp.*; + } + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Size = enum(u2) { + one, + many, + slice, + c, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Attributes = struct { + @"const": bool = false, + @"volatile": bool = false, + @"allowzero": bool = false, + @"addrspace": ?AddressSpace = null, + @"align": ?usize = null, + }; + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Array = struct { + len: comptime_int, + child: type, + + /// The type of the sentinel is the element type of the array, which is + /// the value of the `child` field in this struct. However there is no way + /// to refer to that type here, so we use `*const anyopaque`. + /// See also: `sentinel`. + sentinel_ptr: ?*const anyopaque, + + /// Loads the array type's sentinel value from `sentinel_ptr`. + /// Returns `null` if the array type has no sentinel. + pub inline fn sentinel(comptime arr: Array) ?arr.child { + const sp: *const arr.child = @ptrCast(@alignCast(arr.sentinel_ptr orelse return null)); + return sp.*; + } + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const ContainerLayout = enum(u2) { + auto, + @"extern", + @"packed", + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const StructField = struct { + name: [:0]const u8, + type: type, + /// The type of the default value is the type of this struct field, which + /// is the value of the `type` field in this struct. However there is no + /// way to refer to that type here, so we use `*const anyopaque`. + /// See also: `defaultValue`. + default_value_ptr: ?*const anyopaque, + is_comptime: bool, + /// `null` means the field alignment was not explicitly specified. The + /// field will still be aligned to at least `@alignOf` its `type`. + alignment: ?usize, + + /// Loads the field's default value from `default_value_ptr`. + /// Returns `null` if the field has no default value. + pub inline fn defaultValue(comptime sf: StructField) ?sf.type { + const dp: *const sf.type = @ptrCast(@alignCast(sf.default_value_ptr orelse return null)); + return dp.*; + } + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Attributes = struct { + @"comptime": bool = false, + @"align": ?usize = null, + default_value_ptr: ?*const anyopaque = null, + }; + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Struct = struct { + layout: ContainerLayout, + /// Only valid if layout is .@"packed" + backing_integer: ?type = null, + fields: []const StructField, + decls: []const Declaration, + is_tuple: bool, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Optional = struct { + child: type, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const ErrorUnion = struct { + error_set: type, + payload: type, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Error = struct { + name: [:0]const u8, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const ErrorSet = ?[]const Error; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const EnumField = struct { + name: [:0]const u8, + value: comptime_int, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Enum = struct { + tag_type: type, + fields: []const EnumField, + decls: []const Declaration, + is_exhaustive: bool, + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Mode = enum { exhaustive, nonexhaustive }; + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const UnionField = struct { + name: [:0]const u8, + type: type, + /// `null` means the field alignment was not explicitly specified. The + /// field will still be aligned to at least `@alignOf` its `type`. + alignment: ?usize, + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Attributes = struct { + @"align": ?usize = null, + }; + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Union = struct { + layout: ContainerLayout, + tag_type: ?type, + fields: []const UnionField, + decls: []const Declaration, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Fn = struct { + calling_convention: CallingConvention, + is_generic: bool, + is_var_args: bool, + /// TODO change the language spec to make this not optional. + return_type: ?type, + params: []const Param, + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Param = struct { + is_generic: bool, + is_noalias: bool, + type: ?type, + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Attributes = struct { + @"noalias": bool = false, + }; + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Attributes = struct { + @"callconv": CallingConvention = .auto, + varargs: bool = false, + }; + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Opaque = struct { + decls: []const Declaration, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Frame = struct { + function: *const anyopaque, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const AnyFrame = struct { + child: ?type, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Vector = struct { + len: comptime_int, + child: type, + }; + + /// This data structure is used by the Zig language code generation and + /// therefore must be kept in sync with the compiler implementation. + pub const Declaration = struct { + name: [:0]const u8, + }; +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const FloatMode = enum { + strict, + optimized, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const Endian = enum { + big, + little, + + pub const native = builtin.target.cpu.arch.endian(); + pub const foreign: Endian = @enumFromInt(1 - @intFromEnum(native)); +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const Signedness = enum(u1) { + signed, + unsigned, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const OutputMode = enum { + Exe, + Lib, + Obj, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const LinkMode = enum { + static, + dynamic, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const UnwindTables = enum { + none, + sync, + async, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const WasiExecModel = enum { + command, + reactor, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const CallModifier = enum { + /// Equivalent to function call syntax. + auto, + /// Prevents tail call optimization. This guarantees that the return + /// address will point to the callsite, as opposed to the callsite's + /// callsite. If the call is otherwise required to be tail-called + /// or inlined, a compile error is emitted instead. + never_tail, + /// Guarantees that the call will not be inlined. If the call is + /// otherwise required to be inlined, a compile error is emitted instead. + never_inline, + /// Asserts that the function call will not suspend. This allows a + /// non-async function to call an async function. + no_suspend, + /// Guarantees that the call will be generated with tail call optimization. + /// If this is not possible, a compile error is emitted instead. + always_tail, + /// Guarantees that the call will be inlined at the callsite. + /// If this is not possible, a compile error is emitted instead. + always_inline, + /// Evaluates the call at compile-time. If the call cannot be completed at + /// compile-time, a compile error is emitted instead. + compile_time, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListAarch64 = extern struct { + __stack: *anyopaque, + __gr_top: *anyopaque, + __vr_top: *anyopaque, + __gr_offs: c_int, + __vr_offs: c_int, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListAlpha = extern struct { + __base: *anyopaque, + __offset: c_int, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListArm = extern struct { + __ap: *anyopaque, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListHexagon = extern struct { + __gpr: c_long, + __fpr: c_long, + __overflow_arg_area: *anyopaque, + __reg_save_area: *anyopaque, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListPowerPc = extern struct { + gpr: u8, + fpr: u8, + reserved: c_ushort, + overflow_arg_area: *anyopaque, + reg_save_area: *anyopaque, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListS390x = extern struct { + __current_saved_reg_area_pointer: *anyopaque, + __saved_reg_area_end_pointer: *anyopaque, + __overflow_area_pointer: *anyopaque, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListSh = extern struct { + __va_next_o: *anyopaque, + __va_next_o_limit: *anyopaque, + __va_next_fp: *anyopaque, + __va_next_fp_limit: *anyopaque, + __va_next_stack: *anyopaque, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListX86_64 = extern struct { + gp_offset: c_uint, + fp_offset: c_uint, + overflow_arg_area: *anyopaque, + reg_save_area: *anyopaque, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaListXtensa = extern struct { + __va_stk: *c_int, + __va_reg: *c_int, + __va_ndx: c_int, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const VaList = switch (builtin.cpu.arch) { + .amdgcn, + .msp430, + .nvptx, + .nvptx64, + .powerpc64, + .powerpc64le, + .x86, + => *u8, + .arc, + .arceb, + .avr, + .bpfel, + .bpfeb, + .csky, + .hppa, + .hppa64, + .kvx, + .lanai, + .loongarch32, + .loongarch64, + .m68k, + .microblaze, + .microblazeel, + .mips, + .mipsel, + .mips64, + .mips64el, + .riscv32, + .riscv32be, + .riscv64, + .riscv64be, + .sparc, + .sparc64, + .spirv32, + .spirv64, + .ve, + .wasm32, + .wasm64, + .xcore, + => *anyopaque, + .aarch64, .aarch64_be => switch (builtin.os.tag) { + .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .windows => *u8, + else => switch (builtin.zig_backend) { + else => VaListAarch64, + .stage2_llvm => @compileError("disabled due to miscompilations"), + }, + }, + .alpha => VaListAlpha, + .arm, .armeb, .thumb, .thumbeb => VaListArm, + .hexagon => if (builtin.target.abi.isMusl()) VaListHexagon else *u8, + .powerpc, .powerpcle => VaListPowerPc, + .s390x => VaListS390x, + .sh, .sheb => VaListSh, // This is wrong for `sh_renesas`: https://github.com/ziglang/zig/issues/24692#issuecomment-3150779829 + .x86_64 => switch (builtin.os.tag) { + .uefi, .windows => switch (builtin.zig_backend) { + else => *u8, + .stage2_llvm => @compileError("disabled due to miscompilations"), + }, + else => VaListX86_64, + }, + .xtensa, .xtensaeb => VaListXtensa, + else => @compileError("VaList not supported for this target yet"), +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const PrefetchOptions = struct { + /// Whether the prefetch should prepare for a read or a write. + rw: Rw = .read, + /// The data's locality in an inclusive range from 0 to 3. + /// + /// 0 means no temporal locality. That is, the data can be immediately + /// dropped from the cache after it is accessed. + /// + /// 3 means high temporal locality. That is, the data should be kept in + /// the cache as it is likely to be accessed again soon. + locality: u2 = 3, + /// The cache that the prefetch should be performed on. + cache: Cache = .data, + + pub const Rw = enum(u1) { + read, + write, + }; + + pub const Cache = enum(u1) { + instruction, + data, + }; +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const ExportOptions = struct { + name: []const u8, + linkage: GlobalLinkage = .strong, + section: ?[]const u8 = null, + visibility: SymbolVisibility = .default, +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const ExternOptions = struct { + name: []const u8, + library_name: ?[]const u8 = null, + linkage: GlobalLinkage = .strong, + visibility: SymbolVisibility = .default, + /// Setting this to `true` makes the `@extern` a runtime value. + is_thread_local: bool = false, + is_dll_import: bool = false, + relocation: Relocation = .any, + decoration: ?Decoration = null, + + pub const Decoration = union(enum) { + location: u32, + descriptor: Descriptor, + + pub const Descriptor = struct { + binding: u32, + set: u32, + }; + }; + + pub const Relocation = enum(u1) { + /// Any type of relocation is allowed. + any, + /// A program-counter-relative relocation is required. + /// Using this value makes the `@extern` a runtime value. + pcrel, + }; +}; + +/// This data structure is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const BranchHint = enum(u3) { + /// Equivalent to no hint given. + none, + /// This branch of control flow is more likely to be reached than its peers. + /// The optimizer should optimize for reaching it. + likely, + /// This branch of control flow is less likely to be reached than its peers. + /// The optimizer should optimize for not reaching it. + unlikely, + /// This branch of control flow is unlikely to *ever* be reached. + /// The optimizer may place it in a different page of memory to optimize other branches. + cold, + /// It is difficult to predict whether this branch of control flow will be reached. + /// The optimizer should avoid branching behavior with expensive mispredictions. + unpredictable, +}; + +/// This enum is set by the compiler and communicates which compiler backend is +/// used to produce machine code. +/// Think carefully before deciding to observe this value. Nearly all code should +/// be agnostic to the backend that implements the language. The use case +/// to use this value is to **work around problems with compiler implementations.** +/// +/// Avoid failing the compilation if the compiler backend does not match a +/// whitelist of backends; rather one should detect that a known problem would +/// occur in a blacklist of backends. +/// +/// The enum is nonexhaustive so that alternate Zig language implementations may +/// choose a number as their tag (please use a random number generator rather +/// than a "cute" number) and codebases can interact with these values even if +/// this upstream enum does not have a name for the number. Of course, upstream +/// is happy to accept pull requests to add Zig implementations to this enum. +/// +/// This data structure is part of the Zig language specification. +pub const CompilerBackend = enum(u64) { + /// It is allowed for a compiler implementation to not reveal its identity, + /// in which case this value is appropriate. Be cool and make sure your + /// code supports `other` Zig compilers! + other = 0, + /// The original Zig compiler created in 2015 by Andrew Kelley. Implemented + /// in C++. Used LLVM. Deleted from the ZSF ziglang/zig codebase on + /// December 6th, 2022. + stage1 = 1, + /// The reference implementation self-hosted compiler of Zig, using the + /// LLVM backend. + stage2_llvm = 2, + /// The reference implementation self-hosted compiler of Zig, using the + /// backend that generates C source code. + /// Note that one can observe whether the compilation will output C code + /// directly with `object_format` value rather than the `compiler_backend` value. + stage2_c = 3, + /// The reference implementation self-hosted compiler of Zig, using the + /// WebAssembly backend. + stage2_wasm = 4, + /// The reference implementation self-hosted compiler of Zig, using the + /// arm backend. + stage2_arm = 5, + /// The reference implementation self-hosted compiler of Zig, using the + /// x86_64 backend. + stage2_x86_64 = 6, + /// The reference implementation self-hosted compiler of Zig, using the + /// aarch64 backend. + stage2_aarch64 = 7, + /// The reference implementation self-hosted compiler of Zig, using the + /// x86 backend. + stage2_x86 = 8, + /// The reference implementation self-hosted compiler of Zig, using the + /// riscv64 backend. + stage2_riscv64 = 9, + /// The reference implementation self-hosted compiler of Zig, using the + /// sparc64 backend. + stage2_sparc64 = 10, + /// The reference implementation self-hosted compiler of Zig, using the + /// spirv backend. + stage2_spirv = 11, + /// The reference implementation self-hosted compiler of Zig, using the + /// powerpc backend. + stage2_powerpc = 12, + + _, +}; + +/// This function type is used by the Zig language code generation and +/// therefore must be kept in sync with the compiler implementation. +pub const TestFn = struct { + name: []const u8, + func: *const fn () anyerror!void, +}; + +/// This namespace is used by the Zig compiler to emit various kinds of safety +/// panics. These can be overridden by making a public `panic` namespace in the +/// root source file. +pub const panic: type = p: { + if (@hasDecl(root, "panic")) { + if (@TypeOf(root.panic) != type) { + // Deprecated; make `panic` a namespace instead. + break :p std.debug.FullPanic(struct { + fn panic(msg: []const u8, ra: ?usize) noreturn { + root.panic(msg, @errorReturnTrace(), ra); + } + }.panic); + } + break :p root.panic; + } + break :p switch (builtin.zig_backend) { + .stage2_powerpc, + .stage2_riscv64, + => std.debug.simple_panic, + else => std.debug.FullPanic(std.debug.defaultPanic), + }; +}; + +pub noinline fn returnError() void { + @branchHint(.unlikely); + @setRuntimeSafety(false); + const st = @errorReturnTrace().?; + if (st.index < st.instruction_addresses.len) + st.instruction_addresses[st.index] = @returnAddress(); + st.index += 1; +} diff --git a/lib/std/lang/assembly.zig b/lib/std/lang/assembly.zig new file mode 100644 index 0000000000000000000000000000000000000000..f2ea98063674af603e9ee831f4dcf2fa76c8795c --- /dev/null +++ b/lib/std/lang/assembly.zig @@ -0,0 +1,3119 @@ +pub const Clobbers = switch (@import("builtin").cpu.arch) { + .x86_16, .x86, .x86_64 => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + /// Condition codes. Subset of the bits in `eflags` and `rflags`. + cc: bool = false, + dirflag: bool = false, + eflags: bool = false, + flags: bool = false, + fpcr: bool = false, + fpsr: bool = false, + mxcsr: bool = false, + rflags: bool = false, + + rax: bool = false, + rcx: bool = false, + rdx: bool = false, + rbx: bool = false, + rsp: bool = false, + rbp: bool = false, + rsi: bool = false, + rdi: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + eax: bool = false, + ecx: bool = false, + edx: bool = false, + ebx: bool = false, + esp: bool = false, + ebp: bool = false, + esi: bool = false, + edi: bool = false, + r8d: bool = false, + r9d: bool = false, + r10d: bool = false, + r11d: bool = false, + r12d: bool = false, + r13d: bool = false, + r14d: bool = false, + r15d: bool = false, + ax: bool = false, + cx: bool = false, + dx: bool = false, + bx: bool = false, + sp: bool = false, + bp: bool = false, + si: bool = false, + di: bool = false, + r8w: bool = false, + r9w: bool = false, + r10w: bool = false, + r11w: bool = false, + r12w: bool = false, + r13w: bool = false, + r14w: bool = false, + r15w: bool = false, + al: bool = false, + cl: bool = false, + dl: bool = false, + bl: bool = false, + spl: bool = false, + bpl: bool = false, + sil: bool = false, + dil: bool = false, + r8b: bool = false, + r9b: bool = false, + r10b: bool = false, + r11b: bool = false, + r12b: bool = false, + r13b: bool = false, + r14b: bool = false, + r15b: bool = false, + ah: bool = false, + ch: bool = false, + dh: bool = false, + bh: bool = false, + zmm0: bool = false, + zmm1: bool = false, + zmm2: bool = false, + zmm3: bool = false, + zmm4: bool = false, + zmm5: bool = false, + zmm6: bool = false, + zmm7: bool = false, + zmm8: bool = false, + zmm9: bool = false, + zmm10: bool = false, + zmm11: bool = false, + zmm12: bool = false, + zmm13: bool = false, + zmm14: bool = false, + zmm15: bool = false, + zmm16: bool = false, + zmm17: bool = false, + zmm18: bool = false, + zmm19: bool = false, + zmm20: bool = false, + zmm21: bool = false, + zmm22: bool = false, + zmm23: bool = false, + zmm24: bool = false, + zmm25: bool = false, + zmm26: bool = false, + zmm27: bool = false, + zmm28: bool = false, + zmm29: bool = false, + zmm30: bool = false, + zmm31: bool = false, + ymm0: bool = false, + ymm1: bool = false, + ymm2: bool = false, + ymm3: bool = false, + ymm4: bool = false, + ymm5: bool = false, + ymm6: bool = false, + ymm7: bool = false, + ymm8: bool = false, + ymm9: bool = false, + ymm10: bool = false, + ymm11: bool = false, + ymm12: bool = false, + ymm13: bool = false, + ymm14: bool = false, + ymm15: bool = false, + ymm16: bool = false, + ymm17: bool = false, + ymm18: bool = false, + ymm19: bool = false, + ymm20: bool = false, + ymm21: bool = false, + ymm22: bool = false, + ymm23: bool = false, + ymm24: bool = false, + ymm25: bool = false, + ymm26: bool = false, + ymm27: bool = false, + ymm28: bool = false, + ymm29: bool = false, + ymm30: bool = false, + ymm31: bool = false, + xmm0: bool = false, + xmm1: bool = false, + xmm2: bool = false, + xmm3: bool = false, + xmm4: bool = false, + xmm5: bool = false, + xmm6: bool = false, + xmm7: bool = false, + xmm8: bool = false, + xmm9: bool = false, + xmm10: bool = false, + xmm11: bool = false, + xmm12: bool = false, + xmm13: bool = false, + xmm14: bool = false, + xmm15: bool = false, + xmm16: bool = false, + xmm17: bool = false, + xmm18: bool = false, + xmm19: bool = false, + xmm20: bool = false, + xmm21: bool = false, + xmm22: bool = false, + xmm23: bool = false, + xmm24: bool = false, + xmm25: bool = false, + xmm26: bool = false, + xmm27: bool = false, + xmm28: bool = false, + xmm29: bool = false, + xmm30: bool = false, + xmm31: bool = false, + mm0: bool = false, + mm1: bool = false, + mm2: bool = false, + mm3: bool = false, + mm4: bool = false, + mm5: bool = false, + mm6: bool = false, + mm7: bool = false, + st0: bool = false, + st1: bool = false, + st2: bool = false, + st3: bool = false, + st4: bool = false, + st5: bool = false, + st6: bool = false, + st7: bool = false, + es: bool = false, + cs: bool = false, + ss: bool = false, + ds: bool = false, + fs: bool = false, + gs: bool = false, + }, + .aarch64, .aarch64_be => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + nzcv: bool = false, + + x0: bool = false, + x1: bool = false, + x2: bool = false, + x3: bool = false, + x4: bool = false, + x5: bool = false, + x6: bool = false, + x7: bool = false, + x8: bool = false, + x9: bool = false, + x10: bool = false, + x11: bool = false, + x12: bool = false, + x13: bool = false, + x14: bool = false, + x15: bool = false, + x16: bool = false, + x17: bool = false, + x18: bool = false, + x19: bool = false, + x20: bool = false, + x21: bool = false, + x22: bool = false, + x23: bool = false, + x24: bool = false, + x25: bool = false, + x26: bool = false, + x27: bool = false, + x28: bool = false, + x29: bool = false, + x30: bool = false, + + w0: bool = false, + w1: bool = false, + w2: bool = false, + w3: bool = false, + w4: bool = false, + w5: bool = false, + w6: bool = false, + w7: bool = false, + w8: bool = false, + w9: bool = false, + w10: bool = false, + w11: bool = false, + w12: bool = false, + w13: bool = false, + w14: bool = false, + w15: bool = false, + w16: bool = false, + w17: bool = false, + w18: bool = false, + w19: bool = false, + w20: bool = false, + w21: bool = false, + w22: bool = false, + w23: bool = false, + w24: bool = false, + w25: bool = false, + w26: bool = false, + w27: bool = false, + w28: bool = false, + w29: bool = false, + + lr: bool = false, + sp: bool = false, + wsp: bool = false, + fpcr: bool = false, + fpmr: bool = false, + fpsr: bool = false, + ffr: bool = false, + + p0: bool = false, + p1: bool = false, + p2: bool = false, + p3: bool = false, + p4: bool = false, + p5: bool = false, + p6: bool = false, + p7: bool = false, + p8: bool = false, + p9: bool = false, + p10: bool = false, + p11: bool = false, + p12: bool = false, + p13: bool = false, + p14: bool = false, + p15: bool = false, + + z0: bool = false, + z1: bool = false, + z2: bool = false, + z3: bool = false, + z4: bool = false, + z5: bool = false, + z6: bool = false, + z7: bool = false, + z8: bool = false, + z9: bool = false, + z10: bool = false, + z11: bool = false, + z12: bool = false, + z13: bool = false, + z14: bool = false, + z15: bool = false, + z16: bool = false, + z17: bool = false, + z18: bool = false, + z19: bool = false, + z20: bool = false, + z21: bool = false, + z22: bool = false, + z23: bool = false, + z24: bool = false, + z25: bool = false, + z26: bool = false, + z27: bool = false, + z28: bool = false, + z29: bool = false, + z30: bool = false, + z31: bool = false, + + v0: bool = false, + v1: bool = false, + v2: bool = false, + v3: bool = false, + v4: bool = false, + v5: bool = false, + v6: bool = false, + v7: bool = false, + v8: bool = false, + v9: bool = false, + v10: bool = false, + v11: bool = false, + v12: bool = false, + v13: bool = false, + v14: bool = false, + v15: bool = false, + v16: bool = false, + v17: bool = false, + v18: bool = false, + v19: bool = false, + v20: bool = false, + v21: bool = false, + v22: bool = false, + v23: bool = false, + v24: bool = false, + v25: bool = false, + v26: bool = false, + v27: bool = false, + v28: bool = false, + v29: bool = false, + v30: bool = false, + v31: bool = false, + + d0: bool = false, + d1: bool = false, + d2: bool = false, + d3: bool = false, + d4: bool = false, + d5: bool = false, + d6: bool = false, + d7: bool = false, + d8: bool = false, + d9: bool = false, + d10: bool = false, + d11: bool = false, + d12: bool = false, + d13: bool = false, + d14: bool = false, + d15: bool = false, + d16: bool = false, + d17: bool = false, + d18: bool = false, + d19: bool = false, + d20: bool = false, + d21: bool = false, + d22: bool = false, + d23: bool = false, + d24: bool = false, + d25: bool = false, + d26: bool = false, + d27: bool = false, + d28: bool = false, + d29: bool = false, + d30: bool = false, + d31: bool = false, + + s0: bool = false, + s1: bool = false, + s2: bool = false, + s3: bool = false, + s4: bool = false, + s5: bool = false, + s6: bool = false, + s7: bool = false, + s8: bool = false, + s9: bool = false, + s10: bool = false, + s11: bool = false, + s12: bool = false, + s13: bool = false, + s14: bool = false, + s15: bool = false, + s16: bool = false, + s17: bool = false, + s18: bool = false, + s19: bool = false, + s20: bool = false, + s21: bool = false, + s22: bool = false, + s23: bool = false, + s24: bool = false, + s25: bool = false, + s26: bool = false, + s27: bool = false, + s28: bool = false, + s29: bool = false, + s30: bool = false, + s31: bool = false, + + h0: bool = false, + h1: bool = false, + h2: bool = false, + h3: bool = false, + h4: bool = false, + h5: bool = false, + h6: bool = false, + h7: bool = false, + h8: bool = false, + h9: bool = false, + h10: bool = false, + h11: bool = false, + h12: bool = false, + h13: bool = false, + h14: bool = false, + h15: bool = false, + h16: bool = false, + h17: bool = false, + h18: bool = false, + h19: bool = false, + h20: bool = false, + h21: bool = false, + h22: bool = false, + h23: bool = false, + h24: bool = false, + h25: bool = false, + h26: bool = false, + h27: bool = false, + h28: bool = false, + h29: bool = false, + h30: bool = false, + h31: bool = false, + + b0: bool = false, + b1: bool = false, + b2: bool = false, + b3: bool = false, + b4: bool = false, + b5: bool = false, + b6: bool = false, + b7: bool = false, + b8: bool = false, + b9: bool = false, + b10: bool = false, + b11: bool = false, + b12: bool = false, + b13: bool = false, + b14: bool = false, + b15: bool = false, + b16: bool = false, + b17: bool = false, + b18: bool = false, + b19: bool = false, + b20: bool = false, + b21: bool = false, + b22: bool = false, + b23: bool = false, + b24: bool = false, + b25: bool = false, + b26: bool = false, + b27: bool = false, + b28: bool = false, + b29: bool = false, + b30: bool = false, + b31: bool = false, + + za0q: bool = false, + za1q: bool = false, + za2q: bool = false, + za3q: bool = false, + za4q: bool = false, + za5q: bool = false, + za6q: bool = false, + za7q: bool = false, + za8q: bool = false, + za9q: bool = false, + za10q: bool = false, + za11q: bool = false, + za12q: bool = false, + za13q: bool = false, + za14q: bool = false, + za15q: bool = false, + + za0d: bool = false, + za1d: bool = false, + za2d: bool = false, + za3d: bool = false, + za4d: bool = false, + za5d: bool = false, + za6d: bool = false, + za7d: bool = false, + + za0s: bool = false, + za1s: bool = false, + za2s: bool = false, + za3s: bool = false, + + za0h: bool = false, + za1h: bool = false, + za0b: bool = false, + + zt0: bool = false, + }, + .arm, .armeb, .thumb, .thumbeb => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + apsr: bool = false, + cpsr: bool = false, + spsr: bool = false, + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + + lr: bool = false, + sp: bool = false, + fpscr: bool = false, + vpr: bool = false, + + d0: bool = false, + d1: bool = false, + d2: bool = false, + d3: bool = false, + d4: bool = false, + d5: bool = false, + d6: bool = false, + d7: bool = false, + d8: bool = false, + d9: bool = false, + d10: bool = false, + d11: bool = false, + d12: bool = false, + d13: bool = false, + d14: bool = false, + d15: bool = false, + d16: bool = false, + d17: bool = false, + d18: bool = false, + d19: bool = false, + d20: bool = false, + d21: bool = false, + d22: bool = false, + d23: bool = false, + d24: bool = false, + d25: bool = false, + d26: bool = false, + d27: bool = false, + d28: bool = false, + d29: bool = false, + d30: bool = false, + d31: bool = false, + + s0: bool = false, + s1: bool = false, + s2: bool = false, + s3: bool = false, + s4: bool = false, + s5: bool = false, + s6: bool = false, + s7: bool = false, + s8: bool = false, + s9: bool = false, + s10: bool = false, + s11: bool = false, + s12: bool = false, + s13: bool = false, + s14: bool = false, + s15: bool = false, + s16: bool = false, + s17: bool = false, + s18: bool = false, + s19: bool = false, + s20: bool = false, + s21: bool = false, + s22: bool = false, + s23: bool = false, + s24: bool = false, + s25: bool = false, + s26: bool = false, + s27: bool = false, + s28: bool = false, + s29: bool = false, + s30: bool = false, + s31: bool = false, + + q0: bool = false, + q1: bool = false, + q2: bool = false, + q3: bool = false, + q4: bool = false, + q5: bool = false, + q6: bool = false, + q7: bool = false, + q8: bool = false, + q9: bool = false, + q10: bool = false, + q11: bool = false, + q12: bool = false, + q13: bool = false, + q14: bool = false, + q15: bool = false, + }, + .riscv32, .riscv32be, .riscv64, .riscv64be => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + ssp: bool = false, + + x1: bool = false, + x2: bool = false, + x3: bool = false, + x4: bool = false, + x5: bool = false, + x6: bool = false, + x7: bool = false, + x8: bool = false, + x9: bool = false, + x10: bool = false, + x11: bool = false, + x12: bool = false, + x13: bool = false, + x14: bool = false, + x15: bool = false, + x16: bool = false, + x17: bool = false, + x18: bool = false, + x19: bool = false, + x20: bool = false, + x21: bool = false, + x22: bool = false, + x23: bool = false, + x24: bool = false, + x25: bool = false, + x26: bool = false, + x27: bool = false, + x28: bool = false, + x29: bool = false, + x30: bool = false, + x31: bool = false, + + // ABI aliases for integer registers + ra: bool = false, + sp: bool = false, + gp: bool = false, + tp: bool = false, + t0: bool = false, + t1: bool = false, + t2: bool = false, + s0: bool = false, + fp: bool = false, + s1: bool = false, + a0: bool = false, + a1: bool = false, + a2: bool = false, + a3: bool = false, + a4: bool = false, + a5: bool = false, + a6: bool = false, + a7: bool = false, + s2: bool = false, + s3: bool = false, + s4: bool = false, + s5: bool = false, + s6: bool = false, + s7: bool = false, + s8: bool = false, + s9: bool = false, + s10: bool = false, + s11: bool = false, + t3: bool = false, + t4: bool = false, + t5: bool = false, + t6: bool = false, + + fflags: bool = false, + frm: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + f16: bool = false, + f17: bool = false, + f18: bool = false, + f19: bool = false, + f20: bool = false, + f21: bool = false, + f22: bool = false, + f23: bool = false, + f24: bool = false, + f25: bool = false, + f26: bool = false, + f27: bool = false, + f28: bool = false, + f29: bool = false, + f30: bool = false, + f31: bool = false, + + // ABI aliases for float registers + ft0: bool = false, + ft1: bool = false, + ft2: bool = false, + ft3: bool = false, + ft4: bool = false, + ft5: bool = false, + ft6: bool = false, + ft7: bool = false, + fs0: bool = false, + fs1: bool = false, + fa0: bool = false, + fa1: bool = false, + fa2: bool = false, + fa3: bool = false, + fa4: bool = false, + fa5: bool = false, + fa6: bool = false, + fa7: bool = false, + fs2: bool = false, + fs3: bool = false, + fs4: bool = false, + fs5: bool = false, + fs6: bool = false, + fs7: bool = false, + fs8: bool = false, + fs9: bool = false, + fs10: bool = false, + fs11: bool = false, + ft8: bool = false, + ft9: bool = false, + ft10: bool = false, + ft11: bool = false, + + vtype: bool = false, + vl: bool = false, + vxsat: bool = false, + vxrm: bool = false, + vcsr: bool = false, + + v0: bool = false, + v1: bool = false, + v2: bool = false, + v3: bool = false, + v4: bool = false, + v5: bool = false, + v6: bool = false, + v7: bool = false, + v8: bool = false, + v9: bool = false, + v10: bool = false, + v11: bool = false, + v12: bool = false, + v13: bool = false, + v14: bool = false, + v15: bool = false, + v16: bool = false, + v17: bool = false, + v18: bool = false, + v19: bool = false, + v20: bool = false, + v21: bool = false, + v22: bool = false, + v23: bool = false, + v24: bool = false, + v25: bool = false, + v26: bool = false, + v27: bool = false, + v28: bool = false, + v29: bool = false, + v30: bool = false, + v31: bool = false, + }, + .xcore => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + + cp: bool = false, + dp: bool = false, + sp: bool = false, + lr: bool = false, + sr: bool = false, + }, + .xtensa, .xtensaeb => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + sar: bool = false, + lbeg: bool = false, + lend: bool = false, + lcount: bool = false, + atomctl: bool = false, + scompare1: bool = false, + threadptr: bool = false, + litbase: bool = false, + windowbase: bool = false, + windowstart: bool = false, + ps: bool = false, + + a0: bool = false, + a1: bool = false, + a2: bool = false, + a3: bool = false, + a4: bool = false, + a5: bool = false, + a6: bool = false, + a7: bool = false, + a8: bool = false, + a9: bool = false, + a10: bool = false, + a11: bool = false, + a12: bool = false, + a13: bool = false, + a14: bool = false, + a15: bool = false, + + br: bool = false, + b0: bool = false, + b1: bool = false, + b2: bool = false, + b3: bool = false, + b4: bool = false, + b5: bool = false, + b6: bool = false, + b7: bool = false, + b8: bool = false, + b9: bool = false, + b10: bool = false, + b11: bool = false, + b12: bool = false, + b13: bool = false, + b14: bool = false, + b15: bool = false, + + acchi: bool = false, + acclo: bool = false, + m0: bool = false, + m1: bool = false, + m2: bool = false, + m3: bool = false, + fcr: bool = false, + fsr: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + }, + .kvx => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + cs: bool = false, + + ra: bool = false, + + ls: bool = false, + le: bool = false, + lc: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + r32: bool = false, + r33: bool = false, + r34: bool = false, + r35: bool = false, + r36: bool = false, + r37: bool = false, + r38: bool = false, + r39: bool = false, + r40: bool = false, + r41: bool = false, + r42: bool = false, + r43: bool = false, + r44: bool = false, + r45: bool = false, + r46: bool = false, + r47: bool = false, + r48: bool = false, + r49: bool = false, + r50: bool = false, + r51: bool = false, + r52: bool = false, + r53: bool = false, + r54: bool = false, + r55: bool = false, + r56: bool = false, + r57: bool = false, + r58: bool = false, + r59: bool = false, + r60: bool = false, + r61: bool = false, + r62: bool = false, + r63: bool = false, + + a0: bool = false, + a1: bool = false, + a2: bool = false, + a3: bool = false, + a4: bool = false, + a5: bool = false, + a6: bool = false, + a7: bool = false, + a8: bool = false, + a9: bool = false, + a10: bool = false, + a11: bool = false, + a12: bool = false, + a13: bool = false, + a14: bool = false, + a15: bool = false, + a16: bool = false, + a17: bool = false, + a18: bool = false, + a19: bool = false, + a20: bool = false, + a21: bool = false, + a22: bool = false, + a23: bool = false, + a24: bool = false, + a25: bool = false, + a26: bool = false, + a27: bool = false, + a28: bool = false, + a29: bool = false, + a30: bool = false, + a31: bool = false, + a32: bool = false, + a33: bool = false, + a34: bool = false, + a35: bool = false, + a36: bool = false, + a37: bool = false, + a38: bool = false, + a39: bool = false, + a40: bool = false, + a41: bool = false, + a42: bool = false, + a43: bool = false, + a44: bool = false, + a45: bool = false, + a46: bool = false, + a47: bool = false, + a48: bool = false, + a49: bool = false, + a50: bool = false, + a51: bool = false, + a52: bool = false, + a53: bool = false, + a54: bool = false, + a55: bool = false, + a56: bool = false, + a57: bool = false, + a58: bool = false, + a59: bool = false, + a60: bool = false, + a61: bool = false, + a62: bool = false, + a63: bool = false, + + a0_lo: bool = false, + a0_hi: bool = false, + a1_lo: bool = false, + a1_hi: bool = false, + a2_lo: bool = false, + a2_hi: bool = false, + a3_lo: bool = false, + a3_hi: bool = false, + a4_lo: bool = false, + a4_hi: bool = false, + a5_lo: bool = false, + a5_hi: bool = false, + a6_lo: bool = false, + a6_hi: bool = false, + a7_lo: bool = false, + a7_hi: bool = false, + a8_lo: bool = false, + a8_hi: bool = false, + a9_lo: bool = false, + a9_hi: bool = false, + a10_lo: bool = false, + a10_hi: bool = false, + a11_lo: bool = false, + a11_hi: bool = false, + a12_lo: bool = false, + a12_hi: bool = false, + a13_lo: bool = false, + a13_hi: bool = false, + a14_lo: bool = false, + a14_hi: bool = false, + a15_lo: bool = false, + a15_hi: bool = false, + a16_lo: bool = false, + a16_hi: bool = false, + a17_lo: bool = false, + a17_hi: bool = false, + a18_lo: bool = false, + a18_hi: bool = false, + a19_lo: bool = false, + a19_hi: bool = false, + a20_lo: bool = false, + a20_hi: bool = false, + a21_lo: bool = false, + a21_hi: bool = false, + a22_lo: bool = false, + a22_hi: bool = false, + a23_lo: bool = false, + a23_hi: bool = false, + a24_lo: bool = false, + a24_hi: bool = false, + a25_lo: bool = false, + a25_hi: bool = false, + a26_lo: bool = false, + a26_hi: bool = false, + a27_lo: bool = false, + a27_hi: bool = false, + a28_lo: bool = false, + a28_hi: bool = false, + a29_lo: bool = false, + a29_hi: bool = false, + a30_lo: bool = false, + a30_hi: bool = false, + a31_lo: bool = false, + a31_hi: bool = false, + a32_lo: bool = false, + a32_hi: bool = false, + a33_lo: bool = false, + a33_hi: bool = false, + a34_lo: bool = false, + a34_hi: bool = false, + a35_lo: bool = false, + a35_hi: bool = false, + a36_lo: bool = false, + a36_hi: bool = false, + a37_lo: bool = false, + a37_hi: bool = false, + a38_lo: bool = false, + a38_hi: bool = false, + a39_lo: bool = false, + a39_hi: bool = false, + a40_lo: bool = false, + a40_hi: bool = false, + a41_lo: bool = false, + a41_hi: bool = false, + a42_lo: bool = false, + a42_hi: bool = false, + a43_lo: bool = false, + a43_hi: bool = false, + a44_lo: bool = false, + a44_hi: bool = false, + a45_lo: bool = false, + a45_hi: bool = false, + a46_lo: bool = false, + a46_hi: bool = false, + a47_lo: bool = false, + a47_hi: bool = false, + a48_lo: bool = false, + a48_hi: bool = false, + a49_lo: bool = false, + a49_hi: bool = false, + a50_lo: bool = false, + a50_hi: bool = false, + a51_lo: bool = false, + a51_hi: bool = false, + a52_lo: bool = false, + a52_hi: bool = false, + a53_lo: bool = false, + a53_hi: bool = false, + a54_lo: bool = false, + a54_hi: bool = false, + a55_lo: bool = false, + a55_hi: bool = false, + a56_lo: bool = false, + a56_hi: bool = false, + a57_lo: bool = false, + a57_hi: bool = false, + a58_lo: bool = false, + a58_hi: bool = false, + a59_lo: bool = false, + a59_hi: bool = false, + a60_lo: bool = false, + a60_hi: bool = false, + a61_lo: bool = false, + a61_hi: bool = false, + a62_lo: bool = false, + a62_hi: bool = false, + a63_lo: bool = false, + a63_hi: bool = false, + + a0_x: bool = false, + a0_y: bool = false, + a0_z: bool = false, + a0_t: bool = false, + a1_x: bool = false, + a1_y: bool = false, + a1_z: bool = false, + a1_t: bool = false, + a2_x: bool = false, + a2_y: bool = false, + a2_z: bool = false, + a2_t: bool = false, + a3_x: bool = false, + a3_y: bool = false, + a3_z: bool = false, + a3_t: bool = false, + a4_x: bool = false, + a4_y: bool = false, + a4_z: bool = false, + a4_t: bool = false, + a5_x: bool = false, + a5_y: bool = false, + a5_z: bool = false, + a5_t: bool = false, + a6_x: bool = false, + a6_y: bool = false, + a6_z: bool = false, + a6_t: bool = false, + a7_x: bool = false, + a7_y: bool = false, + a7_z: bool = false, + a7_t: bool = false, + a8_x: bool = false, + a8_y: bool = false, + a8_z: bool = false, + a8_t: bool = false, + a9_x: bool = false, + a9_y: bool = false, + a9_z: bool = false, + a9_t: bool = false, + a10_x: bool = false, + a10_y: bool = false, + a10_z: bool = false, + a10_t: bool = false, + a11_x: bool = false, + a11_y: bool = false, + a11_z: bool = false, + a11_t: bool = false, + a12_x: bool = false, + a12_y: bool = false, + a12_z: bool = false, + a12_t: bool = false, + a13_x: bool = false, + a13_y: bool = false, + a13_z: bool = false, + a13_t: bool = false, + a14_x: bool = false, + a14_y: bool = false, + a14_z: bool = false, + a14_t: bool = false, + a15_x: bool = false, + a15_y: bool = false, + a15_z: bool = false, + a15_t: bool = false, + a16_x: bool = false, + a16_y: bool = false, + a16_z: bool = false, + a16_t: bool = false, + a17_x: bool = false, + a17_y: bool = false, + a17_z: bool = false, + a17_t: bool = false, + a18_x: bool = false, + a18_y: bool = false, + a18_z: bool = false, + a18_t: bool = false, + a19_x: bool = false, + a19_y: bool = false, + a19_z: bool = false, + a19_t: bool = false, + a20_x: bool = false, + a20_y: bool = false, + a20_z: bool = false, + a20_t: bool = false, + a21_x: bool = false, + a21_y: bool = false, + a21_z: bool = false, + a21_t: bool = false, + a22_x: bool = false, + a22_y: bool = false, + a22_z: bool = false, + a22_t: bool = false, + a23_x: bool = false, + a23_y: bool = false, + a23_z: bool = false, + a23_t: bool = false, + a24_x: bool = false, + a24_y: bool = false, + a24_z: bool = false, + a24_t: bool = false, + a25_x: bool = false, + a25_y: bool = false, + a25_z: bool = false, + a25_t: bool = false, + a26_x: bool = false, + a26_y: bool = false, + a26_z: bool = false, + a26_t: bool = false, + a27_x: bool = false, + a27_y: bool = false, + a27_z: bool = false, + a27_t: bool = false, + a28_x: bool = false, + a28_y: bool = false, + a28_z: bool = false, + a28_t: bool = false, + a29_x: bool = false, + a29_y: bool = false, + a29_z: bool = false, + a29_t: bool = false, + a30_x: bool = false, + a30_y: bool = false, + a30_z: bool = false, + a30_t: bool = false, + a31_x: bool = false, + a31_y: bool = false, + a31_z: bool = false, + a31_t: bool = false, + a32_x: bool = false, + a32_y: bool = false, + a32_z: bool = false, + a32_t: bool = false, + a33_x: bool = false, + a33_y: bool = false, + a33_z: bool = false, + a33_t: bool = false, + a34_x: bool = false, + a34_y: bool = false, + a34_z: bool = false, + a34_t: bool = false, + a35_x: bool = false, + a35_y: bool = false, + a35_z: bool = false, + a35_t: bool = false, + a36_x: bool = false, + a36_y: bool = false, + a36_z: bool = false, + a36_t: bool = false, + a37_x: bool = false, + a37_y: bool = false, + a37_z: bool = false, + a37_t: bool = false, + a38_x: bool = false, + a38_y: bool = false, + a38_z: bool = false, + a38_t: bool = false, + a39_x: bool = false, + a39_y: bool = false, + a39_z: bool = false, + a39_t: bool = false, + a40_x: bool = false, + a40_y: bool = false, + a40_z: bool = false, + a40_t: bool = false, + a41_x: bool = false, + a41_y: bool = false, + a41_z: bool = false, + a41_t: bool = false, + a42_x: bool = false, + a42_y: bool = false, + a42_z: bool = false, + a42_t: bool = false, + a43_x: bool = false, + a43_y: bool = false, + a43_z: bool = false, + a43_t: bool = false, + a44_x: bool = false, + a44_y: bool = false, + a44_z: bool = false, + a44_t: bool = false, + a45_x: bool = false, + a45_y: bool = false, + a45_z: bool = false, + a45_t: bool = false, + a46_x: bool = false, + a46_y: bool = false, + a46_z: bool = false, + a46_t: bool = false, + a47_x: bool = false, + a47_y: bool = false, + a47_z: bool = false, + a47_t: bool = false, + a48_x: bool = false, + a48_y: bool = false, + a48_z: bool = false, + a48_t: bool = false, + a49_x: bool = false, + a49_y: bool = false, + a49_z: bool = false, + a49_t: bool = false, + a50_x: bool = false, + a50_y: bool = false, + a50_z: bool = false, + a50_t: bool = false, + a51_x: bool = false, + a51_y: bool = false, + a51_z: bool = false, + a51_t: bool = false, + a52_x: bool = false, + a52_y: bool = false, + a52_z: bool = false, + a52_t: bool = false, + a53_x: bool = false, + a53_y: bool = false, + a53_z: bool = false, + a53_t: bool = false, + a54_x: bool = false, + a54_y: bool = false, + a54_z: bool = false, + a54_t: bool = false, + a55_x: bool = false, + a55_y: bool = false, + a55_z: bool = false, + a55_t: bool = false, + a56_x: bool = false, + a56_y: bool = false, + a56_z: bool = false, + a56_t: bool = false, + a57_x: bool = false, + a57_y: bool = false, + a57_z: bool = false, + a57_t: bool = false, + a58_x: bool = false, + a58_y: bool = false, + a58_z: bool = false, + a58_t: bool = false, + a59_x: bool = false, + a59_y: bool = false, + a59_z: bool = false, + a59_t: bool = false, + a60_x: bool = false, + a60_y: bool = false, + a60_z: bool = false, + a60_t: bool = false, + a61_x: bool = false, + a61_y: bool = false, + a61_z: bool = false, + a61_t: bool = false, + a62_x: bool = false, + a62_y: bool = false, + a62_z: bool = false, + a62_t: bool = false, + a63_x: bool = false, + a63_y: bool = false, + a63_z: bool = false, + a63_t: bool = false, + }, + .lanai => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + /// Condition flags which aren't accessible outside of conditional execution. + sw: bool = false, + + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + }, + .avr => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + flags: bool = false, + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + }, + .msp430 => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + }, + .m68k => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + ccr: bool = false, + + d0: bool = false, + d1: bool = false, + d2: bool = false, + d3: bool = false, + d4: bool = false, + d5: bool = false, + d6: bool = false, + d7: bool = false, + + a0: bool = false, + a1: bool = false, + a2: bool = false, + a3: bool = false, + a4: bool = false, + a5: bool = false, + a6: bool = false, + a7: bool = false, + + macsr: bool = false, + acc: bool = false, + acc0: bool = false, + acc1: bool = false, + acc2: bool = false, + acc3: bool = false, + + mask: bool = false, + fpcr: bool = false, + fpsr: bool = false, + + fp0: bool = false, + fp1: bool = false, + fp2: bool = false, + fp3: bool = false, + fp4: bool = false, + fp5: bool = false, + fp6: bool = false, + fp7: bool = false, + }, + .sparc, .sparc64 => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + psr: bool = false, + gsr: bool = false, + y: bool = false, + + /// asr2; v9+ + ccr: bool = false, + /// Lower bits of `ccr`. + icc: bool = false, + /// Upper bits of `ccr`. + xcc: bool = false, + + g1: bool = false, + g2: bool = false, + g3: bool = false, + g4: bool = false, + g5: bool = false, + g6: bool = false, + g7: bool = false, + + o0: bool = false, + o1: bool = false, + o2: bool = false, + o3: bool = false, + o4: bool = false, + o5: bool = false, + o6: bool = false, + o7: bool = false, + + l0: bool = false, + l1: bool = false, + l2: bool = false, + l3: bool = false, + l4: bool = false, + l5: bool = false, + l6: bool = false, + l7: bool = false, + + i0: bool = false, + i1: bool = false, + i2: bool = false, + i3: bool = false, + i4: bool = false, + i5: bool = false, + i6: bool = false, + i7: bool = false, + + fsr: bool = false, + fprs: bool = false, + + q0: bool = false, + q1: bool = false, + q2: bool = false, + q3: bool = false, + q4: bool = false, + q5: bool = false, + q6: bool = false, + q7: bool = false, + q8: bool = false, + q9: bool = false, + q10: bool = false, + q11: bool = false, + q12: bool = false, + q13: bool = false, + q14: bool = false, + q15: bool = false, + }, + .bpfel, .bpfeb => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + + w0: bool = false, + w1: bool = false, + w2: bool = false, + w3: bool = false, + w4: bool = false, + w5: bool = false, + w6: bool = false, + w7: bool = false, + w8: bool = false, + w9: bool = false, + }, + .hexagon => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + sa0: bool = false, + sa1: bool = false, + lc0: bool = false, + lc1: bool = false, + m0: bool = false, + m1: bool = false, + usr: bool = false, + ugp: bool = false, + gp: bool = false, + cs0: bool = false, + cs1: bool = false, + framelimit: bool = false, + framekey: bool = false, + + p0: bool = false, + p1: bool = false, + p2: bool = false, + p3: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + + q0: bool = false, + q1: bool = false, + q2: bool = false, + q3: bool = false, + + v0: bool = false, + v1: bool = false, + v2: bool = false, + v3: bool = false, + v4: bool = false, + v5: bool = false, + v6: bool = false, + v7: bool = false, + v8: bool = false, + v9: bool = false, + v10: bool = false, + v11: bool = false, + v12: bool = false, + v13: bool = false, + v14: bool = false, + v15: bool = false, + v16: bool = false, + v17: bool = false, + v18: bool = false, + v19: bool = false, + v20: bool = false, + v21: bool = false, + v22: bool = false, + v23: bool = false, + v24: bool = false, + v25: bool = false, + v26: bool = false, + v27: bool = false, + v28: bool = false, + v29: bool = false, + v30: bool = false, + v31: bool = false, + }, + .s390x => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + ps: bool = false, + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + + fpc: bool = false, + + v0: bool = false, + v1: bool = false, + v2: bool = false, + v3: bool = false, + v4: bool = false, + v5: bool = false, + v6: bool = false, + v7: bool = false, + v8: bool = false, + v9: bool = false, + v10: bool = false, + v11: bool = false, + v12: bool = false, + v13: bool = false, + v14: bool = false, + v15: bool = false, + v16: bool = false, + v17: bool = false, + v18: bool = false, + v19: bool = false, + v20: bool = false, + v21: bool = false, + v22: bool = false, + v23: bool = false, + v24: bool = false, + v25: bool = false, + v26: bool = false, + v27: bool = false, + v28: bool = false, + v29: bool = false, + v30: bool = false, + v31: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + }, + .ve => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + psw: bool = false, + + s0: bool = false, + s1: bool = false, + s2: bool = false, + s3: bool = false, + s4: bool = false, + s5: bool = false, + s6: bool = false, + s7: bool = false, + s8: bool = false, + s9: bool = false, + s10: bool = false, + s11: bool = false, + s12: bool = false, + s13: bool = false, + s14: bool = false, + s15: bool = false, + s16: bool = false, + s17: bool = false, + s18: bool = false, + s19: bool = false, + s20: bool = false, + s21: bool = false, + s22: bool = false, + s23: bool = false, + s24: bool = false, + s25: bool = false, + s26: bool = false, + s27: bool = false, + s28: bool = false, + s29: bool = false, + s30: bool = false, + s31: bool = false, + s32: bool = false, + s33: bool = false, + s34: bool = false, + s35: bool = false, + s36: bool = false, + s37: bool = false, + s38: bool = false, + s39: bool = false, + s40: bool = false, + s41: bool = false, + s42: bool = false, + s43: bool = false, + s44: bool = false, + s45: bool = false, + s46: bool = false, + s47: bool = false, + s48: bool = false, + s49: bool = false, + s50: bool = false, + s51: bool = false, + s52: bool = false, + s53: bool = false, + s54: bool = false, + s55: bool = false, + s56: bool = false, + s57: bool = false, + s58: bool = false, + s59: bool = false, + s60: bool = false, + s61: bool = false, + s62: bool = false, + s63: bool = false, + + vixr: bool = false, + vl: bool = false, + + vm0: bool = false, + vm1: bool = false, + vm2: bool = false, + vm3: bool = false, + vm4: bool = false, + vm5: bool = false, + vm6: bool = false, + vm7: bool = false, + vm8: bool = false, + vm9: bool = false, + vm10: bool = false, + vm11: bool = false, + vm12: bool = false, + vm13: bool = false, + vm14: bool = false, + vm15: bool = false, + + v0: bool = false, + v1: bool = false, + v2: bool = false, + v3: bool = false, + v4: bool = false, + v5: bool = false, + v6: bool = false, + v7: bool = false, + v8: bool = false, + v9: bool = false, + v10: bool = false, + v11: bool = false, + v12: bool = false, + v13: bool = false, + v14: bool = false, + v15: bool = false, + v16: bool = false, + v17: bool = false, + v18: bool = false, + v19: bool = false, + v20: bool = false, + v21: bool = false, + v22: bool = false, + v23: bool = false, + v24: bool = false, + v25: bool = false, + v26: bool = false, + v27: bool = false, + v28: bool = false, + v29: bool = false, + v30: bool = false, + v31: bool = false, + v32: bool = false, + v33: bool = false, + v34: bool = false, + v35: bool = false, + v36: bool = false, + v37: bool = false, + v38: bool = false, + v39: bool = false, + v40: bool = false, + v41: bool = false, + v42: bool = false, + v43: bool = false, + v44: bool = false, + v45: bool = false, + v46: bool = false, + v47: bool = false, + v48: bool = false, + v49: bool = false, + v50: bool = false, + v51: bool = false, + v52: bool = false, + v53: bool = false, + v54: bool = false, + v55: bool = false, + v56: bool = false, + v57: bool = false, + v58: bool = false, + v59: bool = false, + v60: bool = false, + v61: bool = false, + v62: bool = false, + v63: bool = false, + }, + .kalimba => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + i0: bool = false, + i1: bool = false, + i2: bool = false, + i3: bool = false, + i4: bool = false, + i5: bool = false, + i6: bool = false, + i7: bool = false, + + m0: bool = false, + m1: bool = false, + m2: bool = false, + m3: bool = false, + l0: bool = false, + l1: bool = false, + l2: bool = false, + l3: bool = false, + l4: bool = false, + l5: bool = false, + doloopstart: bool = false, + doloopend: bool = false, + divresult: bool = false, + divremainder: bool = false, + rmac: bool = false, + rmac0: bool = false, + rmac1: bool = false, + rmac2: bool = false, + rlink: bool = false, + rflags: bool = false, + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + }, + .or1k => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + maclo: bool = false, + machi: bool = false, + fpcsr: bool = false, + fpmaddlo: bool = false, + fpmaddhi: bool = false, + vmaclo: bool = false, + vmachi: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + }, + .csky => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + psr: bool = false, + hi: bool = false, + lo: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + + vr0: bool = false, + vr1: bool = false, + vr2: bool = false, + vr3: bool = false, + vr4: bool = false, + vr5: bool = false, + vr6: bool = false, + vr7: bool = false, + vr8: bool = false, + vr9: bool = false, + vr10: bool = false, + vr11: bool = false, + vr12: bool = false, + vr13: bool = false, + vr14: bool = false, + vr15: bool = false, + vr16: bool = false, + vr17: bool = false, + vr18: bool = false, + vr19: bool = false, + vr20: bool = false, + vr21: bool = false, + vr22: bool = false, + vr23: bool = false, + vr24: bool = false, + vr25: bool = false, + vr26: bool = false, + vr27: bool = false, + vr28: bool = false, + vr29: bool = false, + vr30: bool = false, + vr31: bool = false, + }, + .arc, .arceb => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + status32: bool = false, + aux_macmode: bool = false, + mulhi: bool = false, + lp_start: bool = false, + lp_end: bool = false, + jli_base: bool = false, + ldi_base: bool = false, + ei_base: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + r32: bool = false, + r33: bool = false, + r34: bool = false, + r35: bool = false, + r36: bool = false, + r37: bool = false, + r38: bool = false, + r39: bool = false, + r40: bool = false, + r41: bool = false, + r42: bool = false, + r43: bool = false, + r44: bool = false, + r45: bool = false, + r46: bool = false, + r47: bool = false, + r48: bool = false, + r49: bool = false, + r50: bool = false, + r51: bool = false, + r52: bool = false, + r53: bool = false, + r54: bool = false, + r55: bool = false, + r56: bool = false, + r57: bool = false, + r58: bool = false, + r59: bool = false, + r60: bool = false, + + fmp_ctrl: bool = false, + dsp_ctrl: bool = false, + acc0_lo: bool = false, + acc0_glo: bool = false, + acc0_hi: bool = false, + acc0_ghi: bool = false, + fp_ctrl: bool = false, + fpu_status: bool = false, + vfpu_status: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + f16: bool = false, + f17: bool = false, + f18: bool = false, + f19: bool = false, + f20: bool = false, + f21: bool = false, + f22: bool = false, + f23: bool = false, + f24: bool = false, + f25: bool = false, + f26: bool = false, + f27: bool = false, + f28: bool = false, + f29: bool = false, + f30: bool = false, + f31: bool = false, + }, + .loongarch32, .loongarch64 => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + + fcc0: bool = false, + fcc1: bool = false, + fcc2: bool = false, + fcc3: bool = false, + fcc4: bool = false, + fcc5: bool = false, + fcc6: bool = false, + fcc7: bool = false, + + fcsr0: bool = false, + fcsr1: bool = false, + fcsr2: bool = false, + fcsr3: bool = false, + + xr0: bool = false, + xr1: bool = false, + xr2: bool = false, + xr3: bool = false, + xr4: bool = false, + xr5: bool = false, + xr6: bool = false, + xr7: bool = false, + xr8: bool = false, + xr9: bool = false, + xr10: bool = false, + xr11: bool = false, + xr12: bool = false, + xr13: bool = false, + xr14: bool = false, + xr15: bool = false, + xr16: bool = false, + xr17: bool = false, + xr18: bool = false, + xr19: bool = false, + xr20: bool = false, + xr21: bool = false, + xr22: bool = false, + xr23: bool = false, + xr24: bool = false, + xr25: bool = false, + xr26: bool = false, + xr27: bool = false, + xr28: bool = false, + xr29: bool = false, + xr30: bool = false, + xr31: bool = false, + + vr0: bool = false, + vr1: bool = false, + vr2: bool = false, + vr3: bool = false, + vr4: bool = false, + vr5: bool = false, + vr6: bool = false, + vr7: bool = false, + vr8: bool = false, + vr9: bool = false, + vr10: bool = false, + vr11: bool = false, + vr12: bool = false, + vr13: bool = false, + vr14: bool = false, + vr15: bool = false, + vr16: bool = false, + vr17: bool = false, + vr18: bool = false, + vr19: bool = false, + vr20: bool = false, + vr21: bool = false, + vr22: bool = false, + vr23: bool = false, + vr24: bool = false, + vr25: bool = false, + vr26: bool = false, + vr27: bool = false, + vr28: bool = false, + vr29: bool = false, + vr30: bool = false, + vr31: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + f16: bool = false, + f17: bool = false, + f18: bool = false, + f19: bool = false, + f20: bool = false, + f21: bool = false, + f22: bool = false, + f23: bool = false, + f24: bool = false, + f25: bool = false, + f26: bool = false, + f27: bool = false, + f28: bool = false, + f29: bool = false, + f30: bool = false, + f31: bool = false, + }, + .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + cr0: bool = false, + cr1: bool = false, + cr2: bool = false, + cr3: bool = false, + cr4: bool = false, + cr5: bool = false, + cr6: bool = false, + cr7: bool = false, + + xer: bool = false, + ctr: bool = false, + lr: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + + fpscr: bool = false, + vscr: bool = false, + + vs0: bool = false, + vs1: bool = false, + vs2: bool = false, + vs3: bool = false, + vs4: bool = false, + vs5: bool = false, + vs6: bool = false, + vs7: bool = false, + vs8: bool = false, + vs9: bool = false, + vs10: bool = false, + vs11: bool = false, + vs12: bool = false, + vs13: bool = false, + vs14: bool = false, + vs15: bool = false, + vs16: bool = false, + vs17: bool = false, + vs18: bool = false, + vs19: bool = false, + vs20: bool = false, + vs21: bool = false, + vs22: bool = false, + vs23: bool = false, + vs24: bool = false, + vs25: bool = false, + vs26: bool = false, + vs27: bool = false, + vs28: bool = false, + vs29: bool = false, + vs30: bool = false, + vs31: bool = false, + vs32: bool = false, + vs33: bool = false, + vs34: bool = false, + vs35: bool = false, + vs36: bool = false, + vs37: bool = false, + vs38: bool = false, + vs39: bool = false, + vs40: bool = false, + vs41: bool = false, + vs42: bool = false, + vs43: bool = false, + vs44: bool = false, + vs45: bool = false, + vs46: bool = false, + vs47: bool = false, + vs48: bool = false, + vs49: bool = false, + vs50: bool = false, + vs51: bool = false, + vs52: bool = false, + vs53: bool = false, + vs54: bool = false, + vs55: bool = false, + vs56: bool = false, + vs57: bool = false, + vs58: bool = false, + vs59: bool = false, + vs60: bool = false, + vs61: bool = false, + vs62: bool = false, + vs63: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + f16: bool = false, + f17: bool = false, + f18: bool = false, + f19: bool = false, + f20: bool = false, + f21: bool = false, + f22: bool = false, + f23: bool = false, + f24: bool = false, + f25: bool = false, + f26: bool = false, + f27: bool = false, + f28: bool = false, + f29: bool = false, + f30: bool = false, + f31: bool = false, + + v0: bool = false, + v1: bool = false, + v2: bool = false, + v3: bool = false, + v4: bool = false, + v5: bool = false, + v6: bool = false, + v7: bool = false, + v8: bool = false, + v9: bool = false, + v10: bool = false, + v11: bool = false, + v12: bool = false, + v13: bool = false, + v14: bool = false, + v15: bool = false, + v16: bool = false, + v17: bool = false, + v18: bool = false, + v19: bool = false, + v20: bool = false, + v21: bool = false, + v22: bool = false, + v23: bool = false, + v24: bool = false, + v25: bool = false, + v26: bool = false, + v27: bool = false, + v28: bool = false, + v29: bool = false, + v30: bool = false, + v31: bool = false, + + acc0: bool = false, + acc1: bool = false, + acc2: bool = false, + acc3: bool = false, + acc4: bool = false, + acc5: bool = false, + acc6: bool = false, + acc7: bool = false, + + acc: bool = false, + spefsc: bool = false, + }, + .mips, .mipsel, .mips64, .mips64el => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + lr: bool = false, + + hi: bool = false, + lo: bool = false, + ac0: bool = false, + ac1: bool = false, + ac2: bool = false, + ac3: bool = false, + acx: bool = false, + + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + + fcsr: bool = false, + fcc0: bool = false, + fcc1: bool = false, + fcc2: bool = false, + fcc3: bool = false, + fcc4: bool = false, + fcc5: bool = false, + fcc6: bool = false, + fcc7: bool = false, + + w0: bool = false, + w1: bool = false, + w2: bool = false, + w3: bool = false, + w4: bool = false, + w5: bool = false, + w6: bool = false, + w7: bool = false, + w8: bool = false, + w9: bool = false, + w10: bool = false, + w11: bool = false, + w12: bool = false, + w13: bool = false, + w14: bool = false, + w15: bool = false, + w16: bool = false, + w17: bool = false, + w18: bool = false, + w19: bool = false, + w20: bool = false, + w21: bool = false, + w22: bool = false, + w23: bool = false, + w24: bool = false, + w25: bool = false, + w26: bool = false, + w27: bool = false, + w28: bool = false, + w29: bool = false, + w30: bool = false, + w31: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + f16: bool = false, + f17: bool = false, + f18: bool = false, + f19: bool = false, + f20: bool = false, + f21: bool = false, + f22: bool = false, + f23: bool = false, + f24: bool = false, + f25: bool = false, + f26: bool = false, + f27: bool = false, + f28: bool = false, + f29: bool = false, + f30: bool = false, + f31: bool = false, + + mpl0: bool = false, + mpl1: bool = false, + mpl2: bool = false, + + p0: bool = false, + p1: bool = false, + p2: bool = false, + + msa_ir: bool = false, + msa_csr: bool = false, + msa_access: bool = false, + msa_save: bool = false, + msa_modify: bool = false, + msa_request: bool = false, + msa_map: bool = false, + msa_unmap: bool = false, + }, + .alpha => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + + f0: bool = false, + f1: bool = false, + f2: bool = false, + f3: bool = false, + f4: bool = false, + f5: bool = false, + f6: bool = false, + f7: bool = false, + f8: bool = false, + f9: bool = false, + f10: bool = false, + f11: bool = false, + f12: bool = false, + f13: bool = false, + f14: bool = false, + f15: bool = false, + f16: bool = false, + f17: bool = false, + f18: bool = false, + f19: bool = false, + f20: bool = false, + f21: bool = false, + f22: bool = false, + f23: bool = false, + f24: bool = false, + f25: bool = false, + f26: bool = false, + f27: bool = false, + f28: bool = false, + f29: bool = false, + f30: bool = false, + }, + .hppa, .hppa64 => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + sar: bool = false, + + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + + fr4: bool = false, + fr5: bool = false, + fr6: bool = false, + fr7: bool = false, + fr8: bool = false, + fr9: bool = false, + fr10: bool = false, + fr11: bool = false, + fr12: bool = false, + fr13: bool = false, + fr14: bool = false, + fr15: bool = false, + fr16: bool = false, + fr17: bool = false, + fr18: bool = false, + fr19: bool = false, + fr20: bool = false, + fr21: bool = false, + fr22: bool = false, + fr23: bool = false, + fr24: bool = false, + fr25: bool = false, + fr26: bool = false, + fr27: bool = false, + fr28: bool = false, + fr29: bool = false, + fr30: bool = false, + fr31: bool = false, + + fr4r: bool = false, + fr5r: bool = false, + fr6r: bool = false, + fr7r: bool = false, + fr8r: bool = false, + fr9r: bool = false, + fr10r: bool = false, + fr11r: bool = false, + fr12r: bool = false, + fr13r: bool = false, + fr14r: bool = false, + fr15r: bool = false, + fr16r: bool = false, + fr17r: bool = false, + fr18r: bool = false, + fr19r: bool = false, + fr20r: bool = false, + fr21r: bool = false, + fr22r: bool = false, + fr23r: bool = false, + fr24r: bool = false, + fr25r: bool = false, + fr26r: bool = false, + fr27r: bool = false, + fr28r: bool = false, + fr29r: bool = false, + fr30r: bool = false, + fr31r: bool = false, + }, + .microblaze, .microblazeel => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + rmsr: bool = false, + + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + r16: bool = false, + r17: bool = false, + r18: bool = false, + r19: bool = false, + r20: bool = false, + r21: bool = false, + r22: bool = false, + r23: bool = false, + r24: bool = false, + r25: bool = false, + r26: bool = false, + r27: bool = false, + r28: bool = false, + r29: bool = false, + r30: bool = false, + r31: bool = false, + }, + .sh, .sheb => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + + sr: bool = false, + gbr: bool = false, + pr: bool = false, + + r0: bool = false, + r1: bool = false, + r2: bool = false, + r3: bool = false, + r4: bool = false, + r5: bool = false, + r6: bool = false, + r7: bool = false, + r8: bool = false, + r9: bool = false, + r10: bool = false, + r11: bool = false, + r12: bool = false, + r13: bool = false, + r14: bool = false, + r15: bool = false, + + mach: bool = false, + macl: bool = false, + + fr0: bool = false, + fr1: bool = false, + fr2: bool = false, + fr3: bool = false, + fr4: bool = false, + fr5: bool = false, + fr6: bool = false, + fr7: bool = false, + fr8: bool = false, + fr9: bool = false, + fr10: bool = false, + fr11: bool = false, + fr12: bool = false, + fr13: bool = false, + fr14: bool = false, + fr15: bool = false, + + dr0: bool = false, + dr2: bool = false, + dr4: bool = false, + dr6: bool = false, + dr8: bool = false, + dr10: bool = false, + dr12: bool = false, + dr14: bool = false, + + fv0: bool = false, + fv4: bool = false, + fv8: bool = false, + fv12: bool = false, + + xf0: bool = false, + xf1: bool = false, + xf2: bool = false, + xf3: bool = false, + xf4: bool = false, + xf5: bool = false, + xf6: bool = false, + xf7: bool = false, + xf8: bool = false, + xf9: bool = false, + xf10: bool = false, + xf11: bool = false, + xf12: bool = false, + xf13: bool = false, + xf14: bool = false, + xf15: bool = false, + + xd0: bool = false, + xd2: bool = false, + xd4: bool = false, + xd6: bool = false, + xd8: bool = false, + xd10: bool = false, + xd12: bool = false, + xd14: bool = false, + + xmtrx: bool = false, + + fpul: bool = false, + fpscr: bool = false, + + ms: bool = false, + me: bool = false, + + rs: bool = false, + re: bool = false, + + a0: bool = false, + a0g: bool = false, + a1: bool = false, + a1g: bool = false, + m0: bool = false, + m1: bool = false, + x0: bool = false, + x1: bool = false, + y0: bool = false, + y1: bool = false, + + dsr: bool = false, + }, + else => packed struct { + /// Whether the inline assembly code may perform stores to memory + /// addresses other than those derived from input pointer provenance. + memory: bool = false, + }, +}; diff --git a/lib/std/std.zig b/lib/std/std.zig index a700a15b077f74d02e25e73969b0f47ccf7c781a..3f2fb1d62d0fb91d048c251c5c9ca569cccd4263 100644 --- a/lib/std/std.zig +++ b/lib/std/std.zig @@ -65,8 +65,11 @@ pub const array_hash_map = @import("array_hash_map.zig"); pub const atomic = @import("atomic.zig"); pub const base64 = @import("base64.zig"); pub const bit_set = @import("bit_set.zig"); +/// Deprecated; use `lang`. +/// +/// To be removed after Zig 0.17.0. pub const builtin = lang; -pub const lang = @import("builtin.zig"); +pub const lang = @import("lang.zig"); pub const c = @import("c.zig"); pub const coff = @import("coff.zig"); pub const compress = @import("compress.zig");