Struct yaxpeax_x86::long_mode::InstDecoder[][src]

pub struct InstDecoder { /* fields omitted */ }
Expand description

an x86_64 instruction decoder.

fundamentally this is one or two primitives with no additional state kept during decoding. it can be copied cheaply, hashed cheaply, compared cheaply. if you really want to share an InstDecoder between threads, you could - but you might want to clone it instead.

unless you’re using an Arc<Mutex<InstDecoder>>, which is fine but i’d be very curious about the design requiring that.

Implementations

instantiates an x86_64 decoder that decodes the bare minimum of x86_64.

pedantic and only decodes what the spec says is well-defined, rejecting undefined sequences and any instructions defined by extensions.

helper to decode an instruction directly from a byte slice.

this lets callers avoid the work of setting up a yaxpeax_arch::U8Reader for the slice to decode.

bmi2 indicates support for the BZHI, MULX, PDEP, PEXT, RORX, SARX, SHRX, and SHLX instructions. bmi2 is implemented in all x86_64 chips that implement bmi, except the amd piledriver and steamroller microarchitectures.

returns true if this InstDecoder has all avx512 features enabled.

enable all avx512 features on this InstDecoder. no real CPU, at time of writing, actually has such a feature comination, but this is a useful overestimate for avx512 generally.

lahfsahf is only unset for early revisions of 64-bit amd and intel chips. unfortunately the clearest documentation on when these instructions were reintroduced into 64-bit architectures seems to be wikipedia:

Early AMD64 and Intel 64 CPUs lacked LAHF and SAHF instructions in 64-bit mode. AMD
introduced these instructions (also in 64-bit mode) with their Athlon 64, Opteron and
Turion 64 revision D processors in March 2005[48][49][50] while Intel introduced the
instructions with the Pentium 4 G1 stepping in December 2005. The 64-bit version of Windows
8.1 requires this feature.[47]

this puts reintroduction of these instructions somewhere in the middle of prescott and k8 lifecycles, for intel and amd respectively. because there is no specific uarch where these features become enabled, prescott and k8 default to not supporting these instructions, where later uarches support these instructions.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

decode one instruction for this architecture from the yaxpeax_arch::Reader of this architecture’s Word. Read more

decode one instruction for this architecture from the yaxpeax_arch::Reader of this architecture’s Word, writing into the provided inst. Read more

Instantiates an x86_64 decoder that probably decodes what you want.

Attempts to match real processors in interpretation of undefined sequences, and decodes any instruction defined in any extension.

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.