arch+x86_64 +linux

arch: architecture-specific interface

The arch module provides non-portable access to CPU information and the floating point environment.

Note that the compiler currently optimizes under the assumption that the floating point environment is never modified. Because of this, you're *strongly* advised to not touch the floating point environment unless you absolutely have to. No compatibility or correctness guarantees are provided if you choose to do so anyway.

Index

Types

// Undocumented types:
type arch_jmp_buf;
type cpuid_ecxflag;
type cpuid_edxflag;
type cpuid_vendor;
type jmp_buf;

Errors

// Undocumented Errors:
type cpuid_unknownvendor;

Functions

fn cpuid_getvendor() (cpuid_vendor | cpuid_unknownvendor);
fn cpuid_hasflags(edx: u32, ecx: u32) bool;

// Undocumented functions:
fn feclearexcept(ex: uint) void;
fn fegetround() uint;
fn feraiseexcept(ex: uint) void;
fn fesetround(mode: uint) void;
fn fetestexcept(ex: uint) uint;
fn longjmp(buf: *jmp_buf, n: int) never;
fn setjmp(buf: *jmp_buf) int;

Types

type arch_jmp_buf[permalink] [source]

Show undocumented member
type arch_jmp_buf = [8]u64;

type cpuid_ecxflag[permalink] [source]

Show undocumented member
type cpuid_ecxflag = enum uint {
	SSE3 = 1 << 0,
	AES = 1 << 25,
	AVX = 1 << 28,
};

type cpuid_edxflag[permalink] [source]

Show undocumented member
type cpuid_edxflag = enum uint {
	SSE = 1 << 25,
	SSE2 = 1 << 26,
};

type cpuid_vendor[permalink] [source]

Show undocumented member
type cpuid_vendor = enum {
	AMD,
	INTEL,
	WINCHIP,
	TRANSMETA,
	CYRIX,
	CENTAUR,
	NEXGEN,
	UMC,
	SIS,
	NSC,
	RISE,
	VORTEX,
	VIA,
	ZHAOXIN,
	HYGON,
	MCST_ELBRUS,
	VMWARE, // Virtual Machines.
	XENHVM,
	MICROSOFT_HV,
	PARALLELS,
};

type jmp_buf[permalink] [source]

Show undocumented member
type jmp_buf = struct {
	__jb: arch_jmp_buf,
	__fl: size,
	__ss: [128 / size(size)]size,
};

Errors

type cpuid_unknownvendor[permalink] [source]

Show undocumented member
type cpuid_unknownvendor = !void;

Functions

fn cpuid_getvendor[permalink] [source]

fn cpuid_getvendor() (cpuid_vendor | cpuid_unknownvendor);

Figures out cpu vendor using cpuid

fn cpuid_hasflags[permalink] [source]

fn cpuid_hasflags(edx: u32, ecx: u32) bool;

Checks if cpu has given features. See cpuid_edxflag and cpuid_ecxflag for available options.

fn feclearexcept[permalink] [source]

Show undocumented member
fn feclearexcept(ex: uint) void;

fn fegetround[permalink] [source]

Show undocumented member
fn fegetround() uint;

fn feraiseexcept[permalink] [source]

Show undocumented member
fn feraiseexcept(ex: uint) void;

fn fesetround[permalink] [source]

Show undocumented member
fn fesetround(mode: uint) void;

fn fetestexcept[permalink] [source]

Show undocumented member
fn fetestexcept(ex: uint) uint;

fn longjmp[permalink] [source]

Show undocumented member
fn longjmp(buf: *jmp_buf, n: int) never;

fn setjmp[permalink] [source]

Show undocumented member
fn setjmp(buf: *jmp_buf) int;