gem5
v20.1.0.0
|
A pattern that checks whether the difference of the value and the dictionary entries' is below a certain threshold. More...
#include <dictionary_compressor.hh>
Public Member Functions | |
DeltaPattern (const int number, const uint64_t code, const uint64_t metadata_length, const int match_location, const DictionaryEntry bytes) | |
DictionaryEntry | decompress (const DictionaryEntry dict_bytes) const override |
Decompress the pattern. More... | |
Public Member Functions inherited from Compressor::DictionaryCompressor< T >::Pattern | |
Pattern (const int number, const uint64_t code, const uint64_t metadata_length, const uint64_t num_unmatched_bits, const int match_location, const bool allocate=true) | |
Default constructor. More... | |
virtual | ~Pattern ()=default |
Default destructor. More... | |
int | getPatternNumber () const |
Get enum number associated to this pattern. More... | |
uint8_t | getCode () const |
Get code of this pattern. More... | |
uint8_t | getMatchLocation () const |
Get the index of the dictionary match location. More... | |
std::size_t | getSizeBits () const |
Get size, in bits, of the pattern (excluding prefix). More... | |
bool | shouldAllocate () const |
Determine if pattern allocates a dictionary entry. More... | |
std::string | print () const |
Extract pattern's information to a string. More... | |
Static Public Member Functions | |
static bool | isValidDelta (const DictionaryEntry &bytes, const DictionaryEntry &base_bytes) |
Compares a given value against a base to calculate their delta, and then determines whether it fits a limited sized container. More... | |
static bool | isPattern (const DictionaryEntry &bytes, const DictionaryEntry &dict_bytes, const int match_location) |
Private Attributes | |
const DictionaryEntry | bytes |
The original value. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Compressor::DictionaryCompressor< T >::Pattern | |
const int | patternNumber |
Pattern enum number. More... | |
const uint8_t | code |
Code associated to the pattern. More... | |
const uint8_t | length |
Length, in bits, of the code and match location. More... | |
const uint8_t | numUnmatchedBits |
Number of unmatched bits. More... | |
const int | matchLocation |
Index representing the the match location. More... | |
const bool | allocate |
Wether the pattern allocates a dictionary entry or not. More... | |
A pattern that checks whether the difference of the value and the dictionary entries' is below a certain threshold.
If so, the pattern is successful, and only the delta bits need to be stored.
For example, if the delta can only contain up to 4 bits, and the dictionary contains the entry 0xA231, the value 0xA232 would be compressible, and the delta 0x1 would be stored. The value 0xA249, on the other hand, would not be compressible, since its delta (0x18) needs 5 bits to be stored.
DeltaSizeBits | Size of a delta entry, in number of bits, which determines the threshold. Must always be smaller than the dictionary entry type's size. |
Definition at line 136 of file dictionary_compressor.hh.
|
inline |
Definition at line 692 of file dictionary_compressor.hh.
|
inlineoverridevirtual |
Decompress the pattern.
Each pattern has its own way of interpreting its data.
dict_bytes | The bytes in the corresponding matching entry. |
Implements Compressor::DictionaryCompressor< T >::Pattern.
Definition at line 733 of file dictionary_compressor.hh.
|
inlinestatic |
Definition at line 726 of file dictionary_compressor.hh.
|
inlinestatic |
Compares a given value against a base to calculate their delta, and then determines whether it fits a limited sized container.
bytes | Value to be compared against base. |
base_bytes | Base value. |
Definition at line 712 of file dictionary_compressor.hh.
References X86ISA::base, Compressor::DictionaryCompressor< T >::fromDictionaryEntry(), X86ISA::limit, ArmISA::mask, and type.
|
private |
The original value.
In theory we should keep only the deltas, but the dictionary entry is not inserted in the dictionary before the call to the constructor, so the delta cannot be calculated then.
Definition at line 682 of file dictionary_compressor.hh.