You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
Most instructions have the same stage- and commit-encoding, meaning that they don't depend on anything specific to their encoded location (such as having a RIP-relative operand). For such instructions, I think we could benefit from having a simple "cache" for these instruction encodings, so that we don't waste time re-encoding them. There are some options available to us.
One option is to re-use operand memory for this purpose, as there are almost certainly unused operands. This enables re-use of existing space.
Another option is to use Instruction::transient_meta. This would limit cached encodings to 8 bytes, but this is not too onerous.
Another option is to add in a whole new char[arch::Instruction::MAX_INSTRUCTION_LENGTH] array into the instruction. arch::Instructions are massive anyway so, in the grand scheme of things it's not making things much worse--especially if sizeof(NativeInstruction) is not a multiple of the cache line size, so there's that.
Anyway, this is a nice, simple-to-do thing that would require a bit of poking about in the instruction encoding to flag "uncachable" instructions as stage-encode time, then re-use cached encodings at commit-encode time.
The text was updated successfully, but these errors were encountered:
Most instructions have the same stage- and commit-encoding, meaning that they don't depend on anything specific to their encoded location (such as having a
RIP
-relative operand). For such instructions, I think we could benefit from having a simple "cache" for these instruction encodings, so that we don't waste time re-encoding them. There are some options available to us.One option is to re-use operand memory for this purpose, as there are almost certainly unused operands. This enables re-use of existing space.
Another option is to use
Instruction::transient_meta
. This would limit cached encodings to 8 bytes, but this is not too onerous.Another option is to add in a whole new
char[arch::Instruction::MAX_INSTRUCTION_LENGTH]
array into the instruction.arch::Instruction
s are massive anyway so, in the grand scheme of things it's not making things much worse--especially ifsizeof(NativeInstruction)
is not a multiple of the cache line size, so there's that.Anyway, this is a nice, simple-to-do thing that would require a bit of poking about in the instruction encoding to flag "uncachable" instructions as stage-encode time, then re-use cached encodings at commit-encode time.
The text was updated successfully, but these errors were encountered: