gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N > Class Template Reference

A pattern that checks whether the value is an N bits sign-extended value, that is, all the MSB starting from the Nth are equal to the (N-1)th bit. More...

#include <dictionary_compressor.hh>

Inheritance diagram for gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N >:
gem5::compression::DictionaryCompressor< T >::Pattern

Public Member Functions

 SignExtendedPattern (const int number, const uint64_t code, const uint64_t metadata_length, const DictionaryEntry bytes, const bool allocate=false)
 
DictionaryEntry decompress (const DictionaryEntry dict_bytes) const override
 Decompress the pattern.
 
- Public Member Functions inherited from gem5::compression::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.
 
virtual ~Pattern ()=default
 Default destructor.
 
int getPatternNumber () const
 Get enum number associated to this pattern.
 
uint8_t getCode () const
 Get code of this pattern.
 
uint8_t getMatchLocation () const
 Get the index of the dictionary match location.
 
virtual std::size_t getSizeBits () const
 Get size, in bits, of the pattern (excluding prefix).
 
bool shouldAllocate () const
 Determine if pattern allocates a dictionary entry.
 
std::string print () const
 Extract pattern's information to a string.
 

Static Public Member Functions

static bool isPattern (const DictionaryEntry &bytes, const DictionaryEntry &dict_bytes, const int match_location)
 

Private Attributes

const T bits: N
 The non-extended original value.
 

Additional Inherited Members

- Protected Attributes inherited from gem5::compression::DictionaryCompressor< T >::Pattern
const int patternNumber
 Pattern enum number.
 
const uint8_t code
 Code associated to the pattern.
 
const uint8_t length
 Length, in bits, of the code and match location.
 
const uint8_t numUnmatchedBits
 Number of unmatched bits.
 
const int matchLocation
 Index representing the the match location.
 
const bool allocate
 Wether the pattern allocates a dictionary entry or not.
 

Detailed Description

template<class T>
template<unsigned N>
class gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N >

A pattern that checks whether the value is an N bits sign-extended value, that is, all the MSB starting from the Nth are equal to the (N-1)th bit.

Therefore, if N = 8, and T has 16 bits, the values within the ranges [0x0000, 0x007F] and [0xFF80, 0xFFFF] would match this pattern.

Template Parameters
NThe number of bits in the non-extended original value. It must fit in a dictionary entry.

Definition at line 756 of file dictionary_compressor.hh.

Constructor & Destructor Documentation

◆ SignExtendedPattern()

template<class T >
template<unsigned N>
gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N >::SignExtendedPattern ( const int number,
const uint64_t code,
const uint64_t metadata_length,
const DictionaryEntry bytes,
const bool allocate = false )
inline

Definition at line 767 of file dictionary_compressor.hh.

Member Function Documentation

◆ decompress()

template<class T >
template<unsigned N>
DictionaryEntry gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N >::decompress ( const DictionaryEntry dict_bytes) const
inlineoverridevirtual

Decompress the pattern.

Each pattern has its own way of interpreting its data.

Parameters
dict_bytesThe bytes in the corresponding matching entry.
Returns
The decompressed pattern.

Implements gem5::compression::DictionaryCompressor< T >::Pattern.

Definition at line 787 of file dictionary_compressor.hh.

References gem5::bits(), gem5::sext(), and gem5::compression::DictionaryCompressor< T >::toDictionaryEntry().

◆ isPattern()

template<class T >
template<unsigned N>
static bool gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N >::isPattern ( const DictionaryEntry & bytes,
const DictionaryEntry & dict_bytes,
const int match_location )
inlinestatic

Member Data Documentation

◆ bits

template<class T >
template<unsigned N>
const T gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N >::bits
private

The non-extended original value.

Definition at line 764 of file dictionary_compressor.hh.


The documentation for this class was generated from the following file:

Generated on Tue Jun 18 2024 16:24:18 for gem5 by doxygen 1.11.0