35#ifndef __MEM_CACHE_COMPRESSORS_FPC_HH__
36#define __MEM_CACHE_COMPRESSORS_FPC_HH__
101 static std::map<int, std::string> patternNames = {
112 return patternNames[number];
118 const int match_location)
const override
123 return PatternFactory::getPattern(bytes, dict_bytes, match_location);
128 std::unique_ptr<DictionaryCompressor::CompData>
150 void addEntry(std::unique_ptr<Pattern> pattern)
override;
256 const int match_location)
269 const int16_t halfwords[2] = {
273 return (halfwords[0] == (uint16_t)
szext<8>(halfwords[0])) &&
274 (halfwords[1] == (uint16_t)
szext<8>(halfwords[1]));
280 uint16_t halfwords[2] = {
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
A template version of the dictionary compressor that allows to choose the dictionary size.
static uint32_t fromDictionaryEntry(const DictionaryEntry &entry)
std::array< uint8_t, sizeof(T)> DictionaryEntry
Convenience typedef for a dictionary entry.
static DictionaryEntry toDictionaryEntry(uint32_t value)
const int zeroRunSizeBits
Number of bits of the zero run size bitfield.
void addEntry(std::unique_ptr< Pattern > pattern) override
FPCCompData(int zeroRunSizeBits)
RepBytes(const DictionaryEntry bytes, const int match_location)
SignExtended1Byte(const DictionaryEntry bytes, const int match_location)
SignExtended4Bits(const DictionaryEntry bytes, const int match_location)
SignExtendedHalfword(const DictionaryEntry bytes, const int match_location)
DictionaryEntry decompress(const DictionaryEntry dict_bytes) const override
static bool isPattern(const DictionaryEntry &bytes, const DictionaryEntry &dict_bytes, const int match_location)
SignExtendedTwoHalfwords(const DictionaryEntry bytes, const int match_location)
const int8_t extendedBytes[2]
These are the bytes that are extended to form the two halfwords.
Uncompressed(const DictionaryEntry bytes, const int match_location)
ZeroPaddedHalfword(const DictionaryEntry bytes, const int match_location)
void setRealSize(int size)
When the real size is set it means that we are adding the main zero run pattern.
ZeroRun(const DictionaryEntry bytes, const int match_location)
int _realSize
A zero run consists of a main ZeroRun pattern, which has a meaningful real size (i....
std::size_t getSizeBits() const override
int getRunLength() const
Get the number of zeros in the run so far.
void setRunLength(int length)
Set the number of zeros in the run so far.
int _runLength
Run length so far.
std::string getName(int number) const override
Get meta-name assigned to the given pattern.
const int zeroRunSizeBits
Number of bits of the zero run size bitfield.
uint64_t getNumPatterns() const override
Trick function to get the number of patterns.
PatternNumber
The possible patterns.
@ SIGN_EXTENDED_TWO_HALFWORDS
DictionaryCompressor< uint32_t >::DictionaryEntry DictionaryEntry
std::unique_ptr< Pattern > getPattern(const DictionaryEntry &bytes, const DictionaryEntry &dict_bytes, const int match_location) const override
std::unique_ptr< DictionaryCompressor::CompData > instantiateDictionaryCompData() const override
Instantiate a compression data of the sub-class compressor.
void addToDictionary(const DictionaryEntry data) override
Definition of a dictionary based cache compressor.
constexpr uint64_t szext(uint64_t val)
Sign-extend an N-bit value to 64 bits.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.