aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
13 dayssummary description of opt workHEAD2.0.0no-gods-no-iximeow
this empty commit reproduces a github comment that describes the work on commits from this point back to, roughly, 1.2.2. since many commits between these two points are interesting in the context of performance optimization (especially uarch-relevant tweaks), many WIP commits are preserved. as a result there is no clear squash merge, and this commit will be the next best thing. on Rust 1.68.0 and a Xeon E3-1230 V2, relative changes are measured roughly as: starting at ed4f238a4c2d860e6fadc8abeaa0cba36ed1df8a: - non-fmt ns/decode: 15ns - non-fmt instructions/decode: 94.6 - non-fmt IPC: 1.71 - fmt ns/decode+display: 91ns - fmt instructions/decode+display: 683.8 - fmt IPC: 2.035 ending at 6a5ea107475284756070614a566970fbb383c4e6 - non-fmt ns/decode: 15ns - non-fmt instructions/decode: 94.6 - non-fmt IPC: 1.71 - fmt ns/decode+display: 47ns - fmt instructions/decode+display: 329.6 - fmt IPC: 1.898 for an overall ~50% reduction in runtimes to display instructions. writing into InstructionTextBuffer reduces overhead another ~10%. -- original message follows -- this is where much of https://github.com/iximeow/yaxpeax-arch/pull/7 originated. `std::fmt` as a primary writing mechanism has.. some limitations: * https://github.com/rust-lang/rust/issues/92993#issuecomment-2028915232 * https://github.com/llvm/llvm-project/issues/87440 * https://github.com/rust-lang/rust/pull/122770 and some more interesting more fundamental limitations - writing to a `T: fmt::Write` means implementations don't know if it's possible to write bytes in reverse order (useful for printing digits) or if it's OK to write too many bytes and then only advance `len` by the correct amount (useful for copying variable-length-but-short strings like register names). these are both perfectly fine to a `String` or `Vec`, less fine to do to a file descriptor like stdout. at the same time, `Colorize` and traits depending on it are very broken, for reasons described in yaxpeax-arch. so, this adapts `yaxpeax-x86` to use the new `DisplaySink` type for writing, with optimizations where appropriate and output spans for certain kinds of tokens - registers, integers, opcodes, etc. it's not a perfect replacement for Colorize-to-ANSI-supporting-outputs but it's more flexible and i think can be made right. along the way this completes the move of `safer_unchecked` out to yaxpeax-arch (ty @5225225 it's still so useful), cleans up some docs, and comes with a few new test cases. because of the major version bump of yaxpeax-arch, and because this removes most functionality of the Colorize impl - it prints the correct words, just without coloring - this is itself a major version bump to 2.0.0. yay! this in turn is a good point to change the `Opcode` enums from being tuple-like to struct-like, and i've done so in https://github.com/iximeow/yaxpeax-x86/commit/1b8019d5b39a05c109399b8628a1082bfec79755. full notes in CHANGELOG ofc. this is notes for myself when i'm trying to remember any of this in two years :)
13 daysdocument one more stray unsafeiximeow
13 daysadd missing feature flag to real-mode ffi libraryiximeow
ffi/ still needs... much more work
13 daysbench: fetch from fork updated for yaxpeax-x86 2.0.0iximeow
13 daysbump cargo version to 2.0.0, not quite releasing yetiximeow
13 daysjustify the current max instruction lengthiximeow
this is also checked by a new fuzz target
13 daysconsistently enter register/number/opcode spansiximeow
13 daysone more stray docs erroriximeow
13 daysrename most operand variants, make them structy rather than tupleyiximeow
13 daysremove selects_cs(), cs() now does the right thingiximeow
13 daysnote yaxpeax-arch version bump in changelogiximeow
13 daysupdate yaxpeax-arch to 0.3.1, fix fuzz target warningsiximeow
13 daysnightly correctly remarked that == on fat pointers is ambiguousiximeow
13 daysfix several sources of dead code warnings in various crate configsiximeow
14 daysremove yaxpeax-x86 safer_unchecked.rs, it is now in yaxpeax-archiximeow
14 dayscfg_attr wants feature, not features pluraliximeow
14 dayslast vestiges of initial perf experimentsiximeow
14 daysanother fuzz bugiximeow
14 daysfuzz caught negation bugiximeow
14 daysInstructionTextBuffer for all three modes, adjust fuzzer to matchiximeow
14 daysstale fileiximeow
14 daysadd additional `call` test casesiximeow
fix 32-bit 66-prefixed ff /2 call not having 16-bit operands fix momentary regression in rendering `call` instructions to string
14 daysforward long deprecation allowances as appropriateiximeow
14 daysadapt protected-mode display to real modeiximeow
14 daysnormalize imports, pull safer_unchecked from yaxpeax-archiximeow
14 daysfix inlining attributes re. profiling flag in protected_modeiximeow
14 daysadapt OperandVisitor and related to real_modeiximeow
14 daysadapt the rest of formating changes to protected_modeiximeow
14 daysfix AbsoluteFarAddress being tagged as a memory operandiximeow
14 daysadapt OperandVisitor to protected mode tooiximeow
14 dayscentralize unsafe claims and better validateiximeow
14 daysactually use new can_lock in 32b and 16b modesiximeow
14 daysactually use new can_rep in 32b and 16b modesiximeow
14 daysport opcode helpers and reordering to 32-bit and 16-bit decodersiximeow
14 daysInstructionTextBuffer is only present with alloc (new crate flag)iximeow
14 daysadd more conditional inlining for 32-bit and 16-bit decodersiximeow
2024-06-22NoColorsSink has a decent name nowiximeow
2024-06-22extract reusable display bits into yaxpeax-arch, add a visitor fn to Operandiximeow
comes with deleting the body of impl Colorize for Operand, because we can reuse the normal operand formatting code
2024-06-21things compile again, add a few more caution signs around InstructionTextBufferiximeow
2024-06-21separate out display code further, reword comments on InstructionTextSink to ↵iximeow
be ... stern
2024-06-20swap printed size check and lzcntiximeow
if printed_size == 0 then the value must be 0, but we can check if the value is 0 before doing all that stuff
2024-06-20slightly simpler (?) write_u* implsiximeow
2024-06-20starting to get new DisplaySink stuff ready to extract...iximeow
2024-06-19better testing for alternate sinks, fix hex formatting bug....iximeow
2024-06-19more warning cleanupiximeow
2024-06-19no more fmt in display code, remove more dead struct fieldsiximeow
2024-06-19dedup mem size prefix printingiximeow
2024-06-19visit_disp is only outlined for bad reasonsiximeow
2024-06-19clean up warnings, scope unsafe blocks betteriximeow
2024-06-19write_2 did its job, seem to have reaped all that can be reapediximeow