WO2016048516A1 - Technologies for efficient lz77-based data decompression - Google Patents
Technologies for efficient lz77-based data decompression Download PDFInfo
- Publication number
- WO2016048516A1 WO2016048516A1 PCT/US2015/046540 US2015046540W WO2016048516A1 WO 2016048516 A1 WO2016048516 A1 WO 2016048516A1 US 2015046540 W US2015046540 W US 2015046540W WO 2016048516 A1 WO2016048516 A1 WO 2016048516A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- value
- symbol
- computing device
- pointer
- tag
- Prior art date
Links
- 230000006837 decompression Effects 0.000 title claims abstract description 43
- 238000005516 engineering process Methods 0.000 title abstract description 7
- 238000000034 method Methods 0.000 claims abstract description 56
- 230000004044 response Effects 0.000 claims description 52
- 230000006870 function Effects 0.000 claims description 22
- 230000001419 dependent effect Effects 0.000 abstract description 4
- 230000008569 process Effects 0.000 abstract description 3
- 238000004891 communication Methods 0.000 description 8
- 238000012360 testing method Methods 0.000 description 8
- 238000013500 data storage Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000007906 compression Methods 0.000 description 4
- 230000006835 compression Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/3084—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
- H03M7/3086—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method employing a sliding window, e.g. LZ77
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0875—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/065—Replication mechanisms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3818—Decoding for concurrent execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3861—Recovery, e.g. branch miss-prediction, exception handling
- G06F9/3863—Recovery, e.g. branch miss-prediction, exception handling using multiple copies of the architectural state, e.g. shadow registers
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/3084—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
- H03M7/3091—Data deduplication
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/60—General implementation details not specific to a particular type of compression
- H03M7/6005—Decoder aspects
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/60—General implementation details not specific to a particular type of compression
- H03M7/6017—Methods or arrangements to increase the throughput
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1041—Resource optimization
- G06F2212/1044—Space efficiency improvement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/45—Caching of specific data in cache memory
- G06F2212/452—Instruction code
Definitions
- LZ77-based algorithms typically include a stream of symbols. Each symbol may include literal data that is to be copied to the output or a reference to repeat data that has already been decompressed. Compared to other lossless compression algorithms such as DEFLATE, LZ77- based algorithms typically achieve lower compression levels but provider higher performance, particularly for decompression.
- One typical LZ77-based format is "Snappy,” developed by Google Inc. and used by the Apache HadoopTM project and others.
- Other LZ77-based formats include LZO and LZF.
- Typical implementations of decompression algorithms include numerous conditional branches used to categorize input symbols. The outcome of those conditional branches is dependent on the input data. Branch prediction hardware for typical processors may have difficulty correctly predicting the outcome of those conditional branches. Branch misprediction penalties may reduce achievable decompression performance.
- FIG. 1 is a simplified block diagram of at least one embodiment of a computing device for efficient data decompression
- FIG. 2 is a simplified block diagram of at least one embodiment of an environment of the computing device of FIG. 1;
- FIGS. 3 A and 3B are a simplified flow diagram of at least one embodiment of a method for efficient data decompression that may be executed by the computing device of FIGS. 1 and 2;
- FIG. 4 is a schematic diagram of compressed data symbols that may be decompressed by the method of FIGS. 3 A and 3B;
- FIG. 5 is a pseudocode listing of at least one embodiment of the method of
- FIGS. 3 A and 3B are identical to FIGS. 3 A and 3B; and
- FIG. 6 is a pseudocode listing of another embodiment of part of the method of
- FIGS. 3 A and 3B are identical to FIGS. 3 A and 3B.
- references in the specification to "one embodiment,” “an embodiment,” “an illustrative embodiment,” etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may or may not necessarily include that particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
- items included in a list in the form of "at least one A, B, and C” can mean (A); (B); (C); (A and B); (A and C); (B and C); or (A, B, and C).
- items listed in the form of "at least one of A, B, or C” can mean (A); (B); (C); (A and B); (A and C); (B and C); or (A, B, and C).
- the disclosed embodiments may be implemented, in some cases, in hardware, firmware, software, or any combination thereof.
- the disclosed embodiments may also be implemented as instructions carried by or stored on a transitory or non-transitory machine- readable (e.g., computer-readable) storage medium, which may be read and executed by one or more processors.
- a machine-readable storage medium may be embodied as any storage device, mechanism, or other physical structure for storing or transmitting information in a form readable by a machine (e.g., a volatile or non-volatile memory, a media disc, or other media device).
- an illustrative computing device 100 for efficient data decompression includes a processor 120, an I/O subsystem 122, a memory 124, and a data storage device 126.
- the computing device 100 is configured to read symbols from compressed input data, decode the symbols, and output decompressed data.
- the computing device 100 determines whether each input symbol may be decompressed using a fast-path decompression routine or using a traditional slow-path decompression routine. Most symbols may be decompressed using the fast-path routine and thus the determination of whether to apply the fast-path routine may be predicted with high accuracy by branch prediction hardware of the processor 120.
- the computing device 100 determines the starting address and length of data to be copied without performing data-dependent branch instructions that may be unpredictable using branch prediction hardware.
- the computing device 100 may use small data tables or other fast techniques to determine the location of the next symbol in the input stream, again without performing data-dependent branch instructions. By avoiding unpredictable branch instructions, the computing device 100 may avoid branch misprediction penalties.
- the computing device 100 may improve throughput, especially when using a processor 120 capable of out-of-order execution.
- a computing device 100 as described herein may achieve decompression speeds of up to 50-100% faster than previously known, optimized software decompression techniques.
- the computing device 100 may be embodied as any type of device capable of efficient data decompression and otherwise performing the functions described herein.
- the computing device 100 may be embodied as, without limitation, a laptop computer, a notebook computer, a tablet computer, a smartphone, a mobile computing device, a wearable computing device, a computer, a desktop computer, a workstation, a server computer, a distributed computing system, a multiprocessor system, a consumer electronic device, a smart appliance, and/or any other computing device capable of efficient data decompression.
- the illustrative computing device 100 includes the processor 120, the I/O subsystem 122, the memory 124, and the data storage device 126.
- the computing device 100 may include other or additional components, such as those commonly found in a computer (e.g., various input/output devices), in other embodiments. Additionally, in some embodiments, one or more of the illustrative components may be incorporated in, or otherwise form a portion of, another component. For example, the memory 124, or portions thereof, may be incorporated in the processor 120 in some embodiments.
- the processor 120 may be embodied as any type of processor capable of performing the functions described herein.
- the processor 120 may be embodied as a single or multi-core processor(s), digital signal processor, microcontroller, or other processor or processing/controlling circuit.
- the memory 124 may be embodied as any type of volatile or non- volatile memory or data storage capable of performing the functions described herein. In operation, the memory 124 may store various data and software used during operation of the computing device 100 such operating systems, applications, programs, libraries, and drivers.
- the memory 124 is communicatively coupled to the processor 120 via the I/O subsystem 122, which may be embodied as circuitry and/or components to facilitate input/output operations with the processor 120, the memory 124, and other components of the computing device 100.
- the I O subsystem 122 may be embodied as, or otherwise include, memory controller hubs, input/output control hubs, firmware devices, communication links (i.e., point-to-point links, bus links, wires, cables, light guides, printed circuit board traces, etc.) and/or other components and subsystems to facilitate the input/output operations.
- the I/O subsystem 122 may form a portion of a system- on- a-chip (SoC) and be incorporated, along with the processor 120, the memory 124, and other components of the computing device 100, on a single integrated circuit chip.
- SoC system- on- a-chip
- the data storage device 126 may be embodied as any type of device or devices configured for short-term or long-term storage of data such as, for example, memory devices and circuits, memory cards, hard disk drives, solid-state drives, or other data storage devices.
- the data storage device 126 may store compressed and/or decompressed data processed by the computing device 100.
- the computing device 100 may also include a communication subsystem 128, which may be embodied as any communication circuit, device, or collection thereof, capable of enabling communications between the computing device 100 and other remote devices over a computer network (not shown).
- the communication subsystem 128 may be configured to use any one or more communication technology (e.g., wired or wireless communications) and associated protocols (e.g., Ethernet, Bluetooth®, Wi-Fi®, WiMAX, etc.) to effect such communication.
- the computing device in the illustrative embodiment, the computing device
- the 100 establishes an environment 200 during operation.
- the illustrative embodiment 200 includes an input module 202, a symbol tag decoding module 204, a data source module 206, an output module 208, and a slow-path module 210.
- the computing device 100 is configured to read compressed data from an input stream 212, decode the compressed data, and write decompressed data to an output stream 214.
- the various modules of the environment 200 may be embodied as hardware, firmware, software, or a combination thereof.
- the various modules, logic, and other components of the environment 200 may form a portion of, or otherwise be established by, the processor 120 or other hardware components of the computing device 100.
- the input module 202 is configured to manage access to the input stream 212.
- the input module 202 is configured to open the input stream 212 and read symbols and other data from the input stream 212.
- the input module 202 may maintain an input stream pointer that may be used to access compressed data from the input stream 212.
- the input stream 212 may be embodied as any in-memory data structure including compressed data.
- the input stream 212 may be backed by or otherwise associated with a file, network connection, memory buffer, or any other source of compressed data.
- the symbol tag decoding module 204 is configured to determine a next symbol increment value, a literal increment value, a data length, and an offset value based on a symbol tag value read by the input module 202.
- the compressed data includes a series of symbols. Each symbol may be a literal symbol or a reference symbol, and each symbol may occupy a variable number of bytes in the input stream 212.
- Literal symbols include literal data that is to be copied to the output stream 214 during decompression. Reference symbols refer to previously decompressed data that is to be copied to the output stream 214 during decompression, for example by copying data that was previously copied to the output stream 214.
- the next symbol increment value may be used to identify the location in the input stream 212 of the beginning of the next symbol.
- the data length indicates how many bytes of data are to be copied, for both literal symbols and reference symbols.
- the literal increment value may be used to locate the start of literal data in the input stream 212, and the offset value may be used to locate the start of reference data in the output stream 214.
- the symbol tag decoding module 204 may be configured to determine the next symbol increment value, the literal increment, and the data length by indexing a next symbol increment table 216, a literal increment table 218, and a length table 220, respectively. Additionally or alternatively, in some embodiments the symbol tag decoding module 204 may be configured to determine those values programmatically.
- the data source module 206 is configured to maintain a source pointer used to access data to be copied to the decompressed output.
- the data source module 206 is configured to set the source pointer to point to literal data from the input stream 212 or to reference previously decompressed data from the output stream 214 based on the type of the current symbol (i.e., a literal symbol or a reference symbol).
- the data source module 206 is configured to set the source pointer without executing any unpredictable branch instructions, for example by using conditional move instructions.
- the output module 208 is configured to manage access to the output stream 214.
- the output module 208 is configured to open the output stream 214 and write decompressed data to the output stream 214.
- the output module 208 is also configured to allow copying already-written data from the output stream 214, used to decompress reference symbols.
- the output module 208 may maintain an output stream pointer that may be used to read and/or write decompressed data from the output stream 214.
- the output stream 214 may be embodied as any in-memory data structure capable of storing and referencing decompressed data.
- the output stream 214 may be backed by or otherwise associated with a file, network connection, memory buffer, or any other destination for decompressed data.
- the slow-path module 210 is configured to execute a slow-path decompression routine to decode symbols that cannot be decoded by the fast path (i.e., by the input module 202, the symbol tag decoding module 204, the data source module 206, and the output module 208).
- the slow-path decompression routine may be embodied as any optimized or unoptimized decompression algorithm capable of decoding the symbols that cannot be decoded by the fast path such as, for example, the Snappy decompression library developed by Google Inc.
- the slow-path decompression routine may include unpredictable branch instructions based on the class of the current symbol, for example.
- the computing device 100 may execute a method 300 for efficient data decompression.
- the method 300 begins in block 302, in which the computing device 100 opens the input stream 212 and sets an input stream pointer to the first symbol included in the stream.
- the computing device 100 may use any technique for opening the input stream 212, such as copying the contents of the file to a memory buffer or memory-mapping a file.
- the input stream 212 may include a header or other data before the first symbol.
- the Snappy compressed file format includes a preamble storing the uncompressed length of the file as a little-endian varint.
- the computing device 100 may perform any appropriate operations to process the header and increment the input stream pointer to the first symbol.
- the computing device 100 opens the output stream 214 and initializes an output stream pointer.
- the computing device 100 may use any technique for opening the output stream 214, such as creating an in-memory write buffer or memory-mapping a file. After being opened, the computing device 100 is capable of writing data to the output stream 214 starting at the output stream pointer. The computing device 100 is also capable of reading and/or copying data from the output stream 214, which is used to decompress reference symbols.
- the computing device 100 reads a tag value for the current input symbol from the input stream pointer.
- the computing device 100 reads a single tag byte from the input stream 212.
- the computing device 100 may read additional tag data.
- the input stream 212 includes a sequence of symbols, including literal symbols and reference symbols.
- the tag value may be used by the computing device 100 to determine the type of the current symbol, and may also be used to determine parameters of the symbol such as offset and data length.
- FIG. 4 a diagram 400 illustrates various symbols used in the
- Each symbol begins with a tag byte and includes a two-bit class value in the least- significant two bits of the tag byte that may be used to categorize the symbols.
- Symbols 402, 404 are literal symbols, with a class value equal to the binary value "00.”
- the symbol 402 includes a tag byte followed by sequence of literal data bytes. The most-significant six bits of the tag byte represent the length of the literal minus one.
- the symbol 402 may represent literals of lengths from 1 to 60 bytes, inclusive. Thus, the symbol 402 may be used for relatively short literals.
- the symbol 404 may be used for longer literals.
- the symbol 404 includes a tag byte followed by a length value, and then followed by a sequence of literal data bytes.
- the most-significant six bits of the tag byte are coded to indicate how many bytes are used to store the length value.
- Binary values corresponding to 60, 61, 62, or 63 correspond to lengths of 1-4 bytes, respectively.
- the length value is equal to the length of the literal minus one, stored in little-endian format.
- Symbols 406, 408, 410 are reference symbols.
- the symbol 406 is a one-byte offset reference symbol with a class value equal to the binary value "01."
- the symbol 406 includes an 11-bit offset value.
- the three most-significant bits of the offset (ow through ⁇ 3 ⁇ 4) are stored in the three most-significant bits of the tag byte, and the rest of the offset (bits ⁇ through oo) is stored in the next byte following the tag byte.
- the tag byte also includes a three-bit length value positioned between the offset bits and the class bits (bits numbered 4 to 2 of the tag byte, labeled Z 2 through lo).
- the length value represents the data length minus four; therefore, the symbol 406 may store lengths from four to 11, inclusive, and offsets from zero to 2047, inclusive.
- the symbol 408 is a two-byte offset reference symbol with a class value equal to the binary value "10.”
- the symbol 408 includes a two-byte offset value following the tag byte, stored as a little-endian 16-bit integer. In other words, the first byte of the offset stores the eight least- significant bits and the second byte of the offset stores the eight most-significant bits.
- the length value is stored in the most-significant six bits of the tag byte, and represents the length of data to be copied minus one.
- the symbol 408 may store lengths from one to 64, inclusive, and offsets from zero to 65,535, inclusive.
- the symbol 408 is a four-byte offset reference symbol with a class value equal to the binary value "11."
- the symbol 408 includes a four-byte offset value following the tag byte, stored as a little-endian 32-bit integer.
- the length value is stored in the most-significant six bits of the tag byte, and equals the length of data to be copied minus one.
- Four-byte offset reference symbols may be very rare in compressed data in use, because generation of such symbols would require compressors to maintain a large amount of history.
- the computing device 100 determines whether the tag value is greater than a maximum data length. If the tag value is greater than the maximum data length, then the computing device 100 may not be capable of a fast-path decompression of the symbol.
- the maximum data length may be 60 bytes, because as described above, if the upper six bits of the tag value are greater than or equal to 60 (because the upper six bits include the length minus one), then the symbol may be a large literal symbol, such as the symbol 404 of FIG. 4.
- the computing device 100 may determine whether the upper six bits of the tag byte are greater than or equal to 60, which may be equivalent to determining whether the tag value is greater than or equal to 60 times four. If the computing device 100 determines that the tag value is greater than the maximum data length, the method 300 branches to block 310. If not, the computing device 100 advances to block 312, described below.
- the computing device 100 decompresses the current input symbol using a slow-path routine.
- the slow-path routine may perform an ordinary, optimized or unoptimized decompression algorithm.
- the computing device 100 may perform unpredictable branch instructions or other potentially slow instructions to perform correct decompression of the input symbol. Because the slow-path is rarely taken, overall performance of the method 300 may not be adversely impacted by branch misprediction penalties or other performance issues in the slow-path.
- the computing device 100 may not make assumptions about the type of the current input symbol and thus may check for all potential formats.
- the tag byte may have its upper six bits greater than or equal to 60
- the current input symbol is not necessarily a long literal symbol.
- the current symbol may be a two- or four-byte reference symbol having a length greater than 60.
- the method 300 advances to block 312. Because the tag value will only rarely be greater than or equal to 60 times four, in most iterations the method 300 advances to block 312. Therefore, branch prediction hardware of the processor 120 may be capable of predicting whether the method 300 advances to block 312 with high accuracy.
- the computing device 100 sets a class value equal to the lower two bits of the tag byte. The computing device 100 may, for example, mask off the lower two bits using one or more bitwise operations. As shown in FIG. 4, the two-bit class value identifies four different types of symbols: literals, one-byte offset references, two-byte offset references, and four-byte offset references.
- the computing device 100 determines whether the class of the current symbol is a four-byte offset reference symbol. For example, the computing device 100 may determine whether the class value equals the binary value "11." The computing device 100 may not be capable of a fast-path decompression of four-byte offset reference symbols. If the symbol is a four-byte offset reference symbol, the method 300 branches to block 310 to perform the slow-path decompression routine, as described above. If the symbol is not a four- byte offset reference symbol, the method 300 advances to block 316. As described above, four- byte offset reference symbols are rare. Therefore, in most iterations the method 300 advances to block 316, and branch prediction hardware of the processor 120 may be capable of predicting whether the method 300 advances to block 316 with high accuracy.
- the computing device 100 looks up the increment value to the next symbol by indexing the next symbol increment table 216 using the tag byte.
- the next symbol increment table 216 is small (e.g., no more than 256 bytes), and may be capable of being stored in cache memory of the processor 120. Therefore, determination of the next symbol increment value may be completed very quickly (i.e., in the time required for an LI cache hit, for example four clock cycles).
- the next symbol increment value may be added to the input stream pointer to determine the position in the input stream 212 of the next symbol. Thus, the determination of the next symbol increment value may be on the critical path of the method 300.
- the computing device 100 may reduce the length and/or latency of the critical path.
- the computing device 100 may be capable of continuing out-of-order execution for decompression of additional input symbols.
- the computing device 100 may calculate the next symbol increment value programmatically.
- the computing device 100 looks up the increment value to the start of a literal symbol by indexing the literal increment table 218 using the tag byte.
- the increment from the address of tag byte to the start of the literal data may vary between 1-5 bytes, depending on the length of the literal data.
- the literal increment table 218 may include any value for tag bytes associated with reference symbols, because the literal increment value will not be used for those symbols. Similar to the next symbol increment table 216, the literal increment table 218 is small (e.g., no more than 256 bytes), and may be capable of being stored in cache memory of the processor 120.
- the computing device 100 may calculate the literal increment value programmatically. Additionally or alternatively, in some embodiments the fast-path decompression routine may only decompress relatively short literals having an offset of one byte. In those embodiments, the literal increment table 218 may include all "ones," or the increment to the start of the literal data may be a constant value of one and the literal increment table 218 may be omitted. [0040] In block 320, the computing device 100 looks up the length of data to be copied by indexing the length table 220 using the tag byte. All of the symbols that may be processed by the fast-path decompression process include a representation of the data length in the tag byte itself.
- the symbols 402, 406, 408 of FIG. 4 all include the length in the tag byte.
- the length table 220 may include any value— or no values— for tag bytes that will not be processed by the fast-path routine. Similar to the tables 216, 218, the length table 220 is small (e.g., no more than 256 bytes), and may be capable of being stored in cache memory of the processor 120. Further, although illustrated as looking the data length value up from the length table 220, it should be understood that in some embodiments the computing device 100 may calculate the data length value programmatically.
- the computing device 100 right-shifts the tag value by five bits, retaining the original upper three bits. Right- shifting the tag value allows the computing device 100 to extract the upper bits of the offset for one-byte reference symbols. As illustrated by symbol 406 of FIG. 4, right-shifting the tag byte by five bits moves the upper three bits of the offset (oio through o 8 ) to the three least- significant bits of the tag byte.
- the computing device 100 sets a literal pointer to point to the input stream pointer plus the literal increment value determined as described above in block 318.
- the computing device 100 may set the literal pointer without determining whether the current symbol is a literal symbol or a reference symbol. As described below, the computing device 100 will disregard the literal pointer for reference symbols.
- the method 300 continues with block 326, in which the computing device 100 conditionally moves the second byte of the offset value to the tag value if the symbol is a two-byte offset reference symbol, retaining the tag value if the symbol is not a two-byte offset reference symbol.
- the second byte of the offset value includes the eight most-significant bits of the offset value (bits 15 through 8).
- the computing device 100 may use any technique to conditionally set the tag value without executing a conditional branch instruction. For example the computing device 100 may perform the conditional move using a tertiary operator, predicated instruction, conditional move instruction, or other processor instruction.
- the computing device 100 tests whether the class value matches the binary value "10" and then executes a conditional move (CMOV) instruction based on the results of the test. Performing a conditional move instruction allows the computing device 100 to select the proper value without executing any unpredictable branch instructions and incurring associated branch misprediction penalties.
- CMOV conditional move
- the computing device 100 sets an offset value to the concatenation of the tag value and the first byte of the offset.
- the tag value includes either the three most-significant bits of the offset value, as described in connection with block 322 above, or the eight most-significant bits of the offset value, as described in connection with block 326 above.
- the offset value is correct for both one-byte and two-byte offset symbols. Additionally, as described above, the offset value may have been calculated without executing any unpredictable branch instructions.
- the computing device 100 conditionally sets a source pointer to the literal pointer if the symbol has a literal class and to the difference between the output stream pointer and the offset value if the symbol does not have a literal class value.
- the computing device 100 may use any technique to conditionally set the source pointer. For example the computing device 100 may perform the conditional move using a tertiary operator, predicated instruction, conditional move instruction, or other processor instruction. In the illustrative embodiment, the computing device 100 tests whether the class value is the binary value "00,” and then executes a conditional move (CMOV) instruction to move either the literal pointer or the difference between the output stream pointer and the offset value based on the results of the test.
- CMOV conditional move
- Performing a conditional move instruction allows the computing device 100 to set the proper value of the source pointer without executing any unpredictable branch instructions and incurring associated branch misprediction penalties.
- the computing device 100 may copy the data length amount of bytes from the source pointer to the output stream pointer, as further described below. The actual data is thus either copied from the literal data of the input stream 212 or from data previously output to the output stream 214.
- the computing device 100 determines whether the offset value is less than 16 and whether the class of the symbol is not literal. In some embodiments, the computing device 100 may perform short-circuit logical evaluation of that test. That is, if the offset value is greater than or equal to 16, the computing device 100 may not test the class of the symbol. In many embodiments, the offset value is usually greater than or equal to 16. Thus, the determination of block 332 may be highly predictable using branch prediction hardware of the computing device 100. If the offset value is less than 16 and the class is not literal, the method 332 branches to block 336, described below. If not, the method 300 branches to block 334.
- the computing device 100 performs a 16-byte block memory copy of the data length number of bytes starting at the source pointer, to the output stream pointer.
- the processor 120 of the computing device 100 may be capable of fast 16- byte unaligned memory copies, for example using specialized vector instructions or vector registers. Because the computing device 100 copies 16 bytes of data at a time, more data than the requested data length may be copied to the output stream 214. However, as described below, after completing the copy, that incorrectly copied data will be positioned past the output stream pointer and thus will be overwritten with correct data when additional symbols are decoded. After copying the data, the method 300 advances to block 338, described below.
- the method 332 branches to block 336.
- the computing device 100 performs a byte -by-byte memory copy of data length bytes from the source pointer to the output stream pointer. Performing a byte-by-byte copy may typically be slower than a block copy, but the byte-by-byte copy may be required for correctness and/or to avoid page faults or other errors.
- the method 300 advances to block 338.
- the computing device 100 increments the output stream pointer by the length of the data copied to the output stream 214. Thus, the output stream pointer is prepared to write decompressed data for the next symbol at the correct position in the output stream 214.
- the computing device 100 increments the input stream pointer by the next symbol increment value. Thus, the input stream pointer is prepared to read data for the next input symbol at the correct position in the input stream 212.
- the computing device 100 determines whether additional symbols remain to be decoded.
- the computing device 100 may use any technique to determine whether additional symbols remain, such as comparing the output stream pointer or the input stream pointer to maximum sizes previously determined based on a header of the compressed file, testing whether an end of file has been reached in the input stream 212, or any other test. If additional symbols remain, the method 300 loops back to block 306 to read the next tag byte, shown in FIG. 3A. If no additional symbols remain, the method 300 is completed.
- the computing device 100 may close the input stream 212 and/or the output stream 214, output the decompressed content, or perform any other required processing to produce the decompressed output.
- the method 300 may be restarted at block 302 to perform additional decompression.
- the pseudocode 500 illustrates one potential embodiment of the method 300.
- the pseudocode 500 illustrates operations 306' through 340', which each correspond to one illustrative embodiment of blocks 306 through 340 of FIGS. 3A and 3B, respectively.
- the pseudocode 500 determines whether to apply the slow-path routine in operations 308' through 314' by performing highly predictable "if statements that, if true, may jump to the slow-path routine, corresponding to one illustrative embodiment of the blocks 308 through 314.
- the pseudocode 500 conditionally assigns the value of the source pointer in the operation 330', which includes a tertiary operator and corresponds to one illustrative embodiment of block 330.
- tertiary operator may be compiled to executable code including a conditional move instruction such as CMOV.
- the pseudocode 500 also uses a similar operation 326' including a tertiary operator to conditionally move the second byte of the offset value, corresponding to one illustrative embodiment of the block 326.
- the pseudocode 600 illustrates operations 326", 328", which each correspond to another illustrative embodiment of the blocks 326, 328 of the method 300, respectively.
- the pseudocode 600 also uses a tertiary operator to calculate the offset value, which may compiled to executable code including a conditional move instruction such as CMOV.
- An embodiment of the technologies may include any one or more, and any combination of, the examples described below.
- Example 1 includes a computing device for data decompression, the computing device comprising an input module to read a symbol tag value from a memory location identified by an input pointer; a symbol tag decoding module to determine a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value; a data source module to conditionally set a source pointer to (i) the input pointer plus the literal increment value in response to a determination that the symbol tag value includes a literal class value and (ii) to an output pointer minus the offset value in response to a determination that the symbol tag value does not include the literal class value; and an output module to copy data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer; wherein the input module is further to increment the input pointer by the next symbol increment value in response to copying of the data.
- Example 2 includes the subject matter of Example 1, and wherein to conditionally set the source pointer comprises to conditionally set the source pointer without execution of a branch instruction.
- Example 3 includes the subject matter of any of Examples 1 and 2, and wherein to conditionally set the source pointer comprises to conditionally set the source pointer with a conditional move instruction.
- Example 4 includes the subject matter of any of Examples 1-3, and further including a slow-path module to execute a slow-path decompression routine in response to a determination that a current symbol cannot be fast-path decoded; wherein the symbol tag decoding module is further to determine, as a function of the symbol tag value and prior to a determination of the next symbol increment value, whether the current symbol can be fast-path decoded.
- Example 5 includes the subject matter of any of Examples 1-4, and wherein to determine whether the current symbol can be fast-path decoded comprises to determine whether the data length has a predefined relationship with a maximum data length as a function of the symbol tag.
- Example 6 includes the subject matter of any of Examples 1-5, and wherein to determine whether the data length has the predefined relationship with the maximum data length comprises to determine whether the data length is greater than sixty bytes.
- Example 7 includes the subject matter of any of Examples 1-6, and wherein to determine whether the current symbol can be fast-path decoded comprises to determine whether the symbol tag includes a four-byte offset class value.
- Example 8 includes the subject matter of any of Examples 1-7, and wherein to determine the next symbol increment value comprises to index a next symbol increment table with the symbol tag value.
- Example 9 includes the subject matter of any of Examples 1-8, and wherein to index the next symbol increment table comprises to look up the next symbol increment value in the next symbol increment table stored in a cache memory of a processor of the computing device.
- Example 10 includes the subject matter of any of Examples 1-9, and where to determine the literal increment value comprises to index a literal increment table with the symbol tag value.
- Example 11 includes the subject matter of any of Examples 1-10, and wherein to index the literal increment table comprises to look up the literal increment value in the literal increment table stored in a cache memory of a processor of the computing device.
- Example 12 includes the subject matter of any of Examples 1-11, and wherein to determine the data length comprises to index a length table with the symbol tag value.
- Example 13 includes the subject matter of any of Examples 1-12, and wherein to index the length table comprises to look up the data length in the length table stored in a cache memory of a processor of the computing device.
- Example 14 includes the subject matter of any of Examples 1-13, and wherein to read the symbol tag value comprises to read a tag byte from the memory location identified by the input pointer.
- Example 15 includes the subject matter of any of Examples 1-14, and wherein to determine the offset value as a function of the symbol tag value comprises to right-shift the tag byte by five bits; conditionally set the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and concatenate the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
- Example 16 includes the subject matter of any of Examples 1-15, and wherein to conditionally set the tag byte comprises to conditionally set the tag byte using a conditional move instruction.
- Example 17 includes the subject matter of any of Examples 1-16, and wherein to copy data of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer comprises to determine whether the offset value is less than a predefined block size; determine whether the symbol tag value does not include a literal class value in response to a determination that the offset value is less than the predefined block size; perform a byte-by-byte memory copy of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer in response to a determination that the symbol tag value does not include the literal class value; and perform a block memory copy of the data length using blocks of the predefined block size from the memory location identified by the source pointer to the memory location identified by the output pointer in response to a determination that the offset value is not less than the predefined block size or in response to a determination that the symbol tag value includes the literal class value.
- Example 18 includes the subject matter of any of Examples 1-17, and wherein the predefined block size comprises sixteen bytes, thirty- two bytes, or sixty-four bytes.
- Example 19 includes the subject matter of any of Examples 1-18, and wherein the output module is further to increment the output pointer by the data length in response to copying of the data.
- Example 20 includes the subject matter of any of Examples 1-19, and wherein the input module is further to determine whether additional symbols remain in response to incrementing of the input pointer; and read a next symbol tag value from a memory location identified by the input pointer in response to a determination that additional symbols remain.
- Example 21 includes a method for data decompression, the method comprising reading, by a computing device, a symbol tag value from a memory location identified by an input pointer; determining, by the computing device, a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value; conditionally setting, by the computing device, a source pointer to (i) the input pointer plus the literal increment value in response to determining that the symbol tag value includes a literal class value and (ii) to an output pointer minus the offset value in response to determining that the symbol tag value does not include the literal class value; copying, by the computing device, data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer; and incrementing, by the computing device, the input pointer by the next symbol increment value in response to copying the data.
- Example 22 includes the subject matter of Example 21, and wherein conditionally setting the source pointer comprises conditionally setting the source pointer without executing a branch instruction.
- Example 23 includes the subject matter of any of Examples 21 and 22, and wherein conditionally setting the source pointer comprises conditionally setting the source pointer using a conditional move instruction.
- Example 24 includes the subject matter of any of Examples 21-23, and further including determining, by the computing device as a function of the symbol tag value and prior to determining the next symbol increment value, whether a current symbol can be fast-path decoded; and executing, by the computing device, a slow-path decompression routine in response to determining the current symbol cannot be fast-path decoded.
- Example 25 includes the subject matter of any of Examples 21-24, and wherein determining whether the current symbol can be fast-path decoded comprises determining whether the data length has a predefined relationship with a maximum data length as a function of the symbol tag.
- Example 26 includes the subject matter of any of Examples 21-25, and wherein determining whether the data length has the predefined relationship with the maximum data length comprises determining whether the data length is greater than sixty bytes.
- Example 27 includes the subject matter of any of Examples 21-26, and wherein determining whether the current symbol can be fast-path decoded comprises determining whether the symbol tag includes a four-byte offset class value.
- Example 28 includes the subject matter of any of Examples 21-27, and wherein determining the next symbol increment value comprises indexing a next symbol increment table with the symbol tag value.
- Example 29 includes the subject matter of any of Examples 21-28, and wherein indexing the next symbol increment table comprises looking up the next symbol increment value in the next symbol increment table stored in a cache memory of a processor of the computing device.
- Example 30 includes the subject matter of any of Examples 21-29, and wherein determining the literal increment value comprises indexing a literal increment table with the symbol tag value.
- Example 31 includes the subject matter of any of Examples 21-30, and wherein indexing the literal increment table comprises looking up the literal increment value in the literal increment table stored in a cache memory of a processor of the computing device.
- Example 32 includes the subject matter of any of Examples 21-31, and wherein determining the data length comprises indexing a length table with the symbol tag value.
- Example 33 includes the subject matter of any of Examples 21-32, and wherein indexing the length table comprises looking up the data length in the length table stored in a cache memory of a processor of the computing device.
- Example 34 includes the subject matter of any of Examples 21-33, and wherein reading the symbol tag value comprises reading a tag byte from the memory location identified by the input pointer.
- Example 35 includes the subject matter of any of Examples 21-34, and wherein determining the offset value as a function of the symbol tag value comprises right- shifting the tag byte by five bits; conditionally setting the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and concatenating the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
- Example 36 includes the subject matter of any of Examples 21-35, and wherein conditionally setting the tag byte comprises conditionally setting the tag byte using a conditional move instruction.
- Example 37 includes the subject matter of any of Examples 21-36, and wherein copying data of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer comprises determining whether the offset value is less than a predefined block size; determining whether the symbol tag value does not include a literal class value in response to determining the offset value is less than the predefined block size; performing a byte-by-byte memory copy of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer in response to determining the symbol tag value does not include the literal class value; and performing a block memory copy of the data length using blocks of the predefined block size from the memory location identified by the source pointer to the memory location identified by the output pointer in response to determining the offset value is not less than the predefined block size or in response to determining the symbol tag value includes the literal class value.
- Example 38 includes the subject matter of any of Examples 21-37, and wherein the predefined block size comprises sixteen bytes, thirty- two bytes, or sixty-four bytes.
- Example 39 includes the subject matter of any of Examples 21-38, and further including incrementing, by the computing device, the output pointer by the data length in response to copying the data.
- Example 40 includes the subject matter of any of Examples 21-39, and further including determining, by the computing device, whether additional symbols remain in response to incrementing the input pointer; and reading, by the computing device, a next symbol tag value from a memory location identified by the input pointer in response to determining additional symbols remain.
- Example 41 includes a computing device comprising a processor; and a memory having stored therein a plurality of instructions that when executed by the processor cause the computing device to perform the method of any of Examples 21-40.
- Example 42 includes one or more machine readable storage media comprising a plurality of instructions stored thereon that in response to being executed result in a computing device performing the method of any of Examples 21-40.
- Example 43 includes a computing device comprising means for performing the method of any of Examples 21-40.
- Example 44 includes a computing device for data decompression, the computing device comprising means for reading a symbol tag value from a memory location identified by an input pointer; means for determining a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value; means for conditionally setting a source pointer to (i) the input pointer plus the literal increment value in response to determining that the symbol tag value includes a literal class value and (ii) to an output pointer minus the offset value in response to determining that the symbol tag value does not include the literal class value; means for copying data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer; and means for incrementing the input pointer by the next symbol increment value in response to copying the data.
- Example 45 includes the subject matter of Example 44, and wherein the means for conditionally setting the source pointer comprises means for conditionally setting the source pointer without executing a branch instruction.
- Example 46 includes the subject matter of any of Examples 44 and 45, and wherein the means for conditionally setting the source pointer comprises means for conditionally setting the source pointer using a conditional move instruction.
- Example 47 includes the subject matter of any of Examples 44-46, and further including means for determining, as a function of the symbol tag value and prior to determining the next symbol increment value, whether a current symbol can be fast-path decoded; and means for executing a slow-path decompression routine in response to determining the current symbol cannot be fast-path decoded.
- Example 48 includes the subject matter of any of Examples 44-47, and wherein the means for determining whether the current symbol can be fast-path decoded comprises means for determining whether the data length has a predefined relationship with a maximum data length as a function of the symbol tag.
- Example 49 includes the subject matter of any of Examples 44-48, and wherein the means for determining whether the data length has the predefined relationship with the maximum data length comprises means for determining whether the data length is greater than sixty bytes.
- Example 50 includes the subject matter of any of Examples 44-49, and, wherein the means for determining whether the current symbol can be fast-path decoded comprises means for determining whether the symbol tag includes a four-byte offset class value.
- Example 51 includes the subject matter of any of Examples 44-50, and wherein the means for determining the next symbol increment value comprises means for indexing a next symbol increment table with the symbol tag value.
- Example 52 includes the subject matter of any of Examples 44-51, and wherein the means for indexing the next symbol increment table comprises means for looking up the next symbol increment value in the next symbol increment table stored in a cache memory of a processor of the computing device.
- Example 53 includes the subject matter of any of Examples 44-52, and wherein the means for determining the literal increment value comprises means for indexing a literal increment table with the symbol tag value.
- Example 54 includes the subject matter of any of Examples 44-53, and wherein the means for indexing the literal increment table comprises means for looking up the literal increment value in the literal increment table stored in a cache memory of a processor of the computing device.
- Example 55 includes the subject matter of any of Examples 44-54, and wherein the means for determining the data length comprises means for indexing a length table with the symbol tag value.
- Example 56 includes the subject matter of any of Examples 44-55, and wherein the means for indexing the length table comprises means for looking up the data length in the length table stored in a cache memory of a processor of the computing device.
- Example 57 includes the subject matter of any of Examples 44-56, and wherein the means for reading the symbol tag value comprises means for reading a tag byte from the memory location identified by the input pointer.
- Example 58 includes the subject matter of any of Examples 44-57, and wherein the means for determining the offset value as a function of the symbol tag value comprises means for right-shifting the tag byte by five bits; means for conditionally setting the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and means for concatenating the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
- Example 59 includes the subject matter of any of Examples 44-58, and wherein the means for conditionally setting the tag byte comprises means for conditionally setting the tag byte using a conditional move instruction.
- Example 60 includes the subject matter of any of Examples 44-59, and wherein the means for copying data of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer comprises means for determining whether the offset value is less than a predefined block size; means for determining whether the symbol tag value does not include a literal class value in response to determining the offset value is less than the predefined block size; means for performing a byte-by-byte memory copy of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer in response to determining the symbol tag value does not include the literal class value; and means for performing a block memory copy of the data length using blocks of the predefined block size from the memory location identified by the source pointer to the memory location identified by the output pointer in response to determining the offset value is not less than the predefined block size or in response to determining the symbol tag value includes the literal class value.
- Example 61 includes the subject matter of any of Examples 44-60, and wherein the predefined block size comprises sixteen bytes, thirty- two bytes, or sixty-four bytes.
- Example 62 includes the subject matter of any of Examples 44-61, and further including means for incrementing the output pointer by the data length in response to copying the data.
- Example 63 includes the subject matter of any of Examples 44-62, and further including means for determining whether additional symbols remain in response to incrementing the input pointer; and means for reading a next symbol tag value from a memory location identified by the input pointer in response to determining additional symbols remain.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Technologies for data decompression include a computing device that reads a symbol tag byte from an input stream. The computing device determines whether the symbol can be decoded using a fast-path routine, and if not, executes a slow-path routine to decompress the symbol. The slow-path routine may include data-dependent branch instructions that may be unpredictable using branch prediction hardware. For the fast-path routine, the computing device determines a next symbol increment value, a literal increment value, a data length, and an offset based on the tag byte, without executing an unpredictable branch instruction. The computing device sets a source pointer to either literal data or reference data as a function of the tag byte, without executing an unpredictable branch instruction. The computing device may set the source pointer using a conditional move instruction. The computing device copies the data and processes remaining symbols. Other embodiments are described and claimed.
Description
TECHNOLOGIES FOR EFFICIENT LZ77-BASED DATA DECOMPRESSION CROSS-REFERENCE TO RELATED U.S. PATENT APPLICATION
[0001] The present application claims priority to U.S. Utility Patent Application Serial
No. 14/494,766, entitled "TECHNOLOGIES FOR EFFICIENT LZ77-BASED DATA COMPRESSION," which was filed on September 24, 2014.
BACKGROUND
[0002] Software data decompression is an important software operation used in many computing applications, including both server and client applications. Many common lossless compression formats are based on the LZ77 compression algorithm. Data compressed using LZ77-based algorithms typically include a stream of symbols. Each symbol may include literal data that is to be copied to the output or a reference to repeat data that has already been decompressed. Compared to other lossless compression algorithms such as DEFLATE, LZ77- based algorithms typically achieve lower compression levels but provider higher performance, particularly for decompression. One typical LZ77-based format is "Snappy," developed by Google Inc. and used by the Apache Hadoop™ project and others. Other LZ77-based formats include LZO and LZF.
[0003] Typical implementations of decompression algorithms include numerous conditional branches used to categorize input symbols. The outcome of those conditional branches is dependent on the input data. Branch prediction hardware for typical processors may have difficulty correctly predicting the outcome of those conditional branches. Branch misprediction penalties may reduce achievable decompression performance.
BRIEF DESCRIPTION OF THE DRAWINGS
[0004] The concepts described herein are illustrated by way of example and not by way of limitation in the accompanying figures. For simplicity and clarity of illustration, elements illustrated in the figures are not necessarily drawn to scale. Where considered appropriate, reference labels have been repeated among the figures to indicate corresponding or analogous elements.
[0005] FIG. 1 is a simplified block diagram of at least one embodiment of a computing device for efficient data decompression;
[0006] FIG. 2 is a simplified block diagram of at least one embodiment of an environment of the computing device of FIG. 1;
[0007] FIGS. 3 A and 3B are a simplified flow diagram of at least one embodiment of a method for efficient data decompression that may be executed by the computing device of FIGS. 1 and 2;
[0008] FIG. 4 is a schematic diagram of compressed data symbols that may be decompressed by the method of FIGS. 3 A and 3B;
[0009] FIG. 5 is a pseudocode listing of at least one embodiment of the method of
FIGS. 3 A and 3B; and
[0010] FIG. 6 is a pseudocode listing of another embodiment of part of the method of
FIGS. 3 A and 3B.
DETAILED DESCRIPTION OF THE DRAWINGS
[0011] While the concepts of the present disclosure are susceptible to various modifications and alternative forms, specific embodiments thereof have been shown by way of example in the drawings and will be described herein in detail. It should be understood, however, that there is no intent to limit the concepts of the present disclosure to the particular forms disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives consistent with the present disclosure and the appended claims.
[0012] References in the specification to "one embodiment," "an embodiment," "an illustrative embodiment," etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may or may not necessarily include that particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described. Additionally, it should be appreciated that items included in a list in the form of "at least one A, B, and C" can mean (A); (B); (C); (A and B); (A and C); (B and C); or (A, B, and C). Similarly, items listed in the form of "at least one of A, B, or C" can mean (A); (B); (C); (A and B); (A and C); (B and C); or (A, B, and C).
[0013] The disclosed embodiments may be implemented, in some cases, in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on a transitory or non-transitory machine- readable (e.g., computer-readable) storage medium, which may be read and executed by one or more processors. A machine-readable storage medium may be embodied as any storage device,
mechanism, or other physical structure for storing or transmitting information in a form readable by a machine (e.g., a volatile or non-volatile memory, a media disc, or other media device).
[0014] In the drawings, some structural or method features may be shown in specific arrangements and/or ordering s. However, it should be appreciated that such specific arrangements and/or orderings may not be required. Rather, in some embodiments, such features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of a structural or method feature in a particular figure is not meant to imply that such feature is required in all embodiments and, in some embodiments, may not be included or may be combined with other features.
[0015] Referring now to FIG. 1, an illustrative computing device 100 for efficient data decompression includes a processor 120, an I/O subsystem 122, a memory 124, and a data storage device 126. In use, as described below, the computing device 100 is configured to read symbols from compressed input data, decode the symbols, and output decompressed data. The computing device 100 determines whether each input symbol may be decompressed using a fast-path decompression routine or using a traditional slow-path decompression routine. Most symbols may be decompressed using the fast-path routine and thus the determination of whether to apply the fast-path routine may be predicted with high accuracy by branch prediction hardware of the processor 120. During execution of the fast-path routine, the computing device 100 determines the starting address and length of data to be copied without performing data-dependent branch instructions that may be unpredictable using branch prediction hardware. The computing device 100 may use small data tables or other fast techniques to determine the location of the next symbol in the input stream, again without performing data-dependent branch instructions. By avoiding unpredictable branch instructions, the computing device 100 may avoid branch misprediction penalties. By reducing the execution time of a critical instruction path to determine the next symbol location, the computing device 100 may improve throughput, especially when using a processor 120 capable of out-of-order execution. Illustratively, a computing device 100 as described herein may achieve decompression speeds of up to 50-100% faster than previously known, optimized software decompression techniques.
[0016] The computing device 100 may be embodied as any type of device capable of efficient data decompression and otherwise performing the functions described herein. For example, the computing device 100 may be embodied as, without limitation, a laptop computer, a notebook computer, a tablet computer, a smartphone, a mobile computing device, a wearable
computing device, a computer, a desktop computer, a workstation, a server computer, a distributed computing system, a multiprocessor system, a consumer electronic device, a smart appliance, and/or any other computing device capable of efficient data decompression. As shown in FIG. 1, the illustrative computing device 100 includes the processor 120, the I/O subsystem 122, the memory 124, and the data storage device 126. Of course, the computing device 100 may include other or additional components, such as those commonly found in a computer (e.g., various input/output devices), in other embodiments. Additionally, in some embodiments, one or more of the illustrative components may be incorporated in, or otherwise form a portion of, another component. For example, the memory 124, or portions thereof, may be incorporated in the processor 120 in some embodiments.
[0017] The processor 120 may be embodied as any type of processor capable of performing the functions described herein. For example, the processor 120 may be embodied as a single or multi-core processor(s), digital signal processor, microcontroller, or other processor or processing/controlling circuit. Similarly, the memory 124 may be embodied as any type of volatile or non- volatile memory or data storage capable of performing the functions described herein. In operation, the memory 124 may store various data and software used during operation of the computing device 100 such operating systems, applications, programs, libraries, and drivers. The memory 124 is communicatively coupled to the processor 120 via the I/O subsystem 122, which may be embodied as circuitry and/or components to facilitate input/output operations with the processor 120, the memory 124, and other components of the computing device 100. For example, the I O subsystem 122 may be embodied as, or otherwise include, memory controller hubs, input/output control hubs, firmware devices, communication links (i.e., point-to-point links, bus links, wires, cables, light guides, printed circuit board traces, etc.) and/or other components and subsystems to facilitate the input/output operations. In some embodiments, the I/O subsystem 122 may form a portion of a system- on- a-chip (SoC) and be incorporated, along with the processor 120, the memory 124, and other components of the computing device 100, on a single integrated circuit chip.
[0018] The data storage device 126 may be embodied as any type of device or devices configured for short-term or long-term storage of data such as, for example, memory devices and circuits, memory cards, hard disk drives, solid-state drives, or other data storage devices. The data storage device 126 may store compressed and/or decompressed data processed by the computing device 100.
[0019] The computing device 100 may also include a communication subsystem 128, which may be embodied as any communication circuit, device, or collection thereof, capable of
enabling communications between the computing device 100 and other remote devices over a computer network (not shown). The communication subsystem 128 may be configured to use any one or more communication technology (e.g., wired or wireless communications) and associated protocols (e.g., Ethernet, Bluetooth®, Wi-Fi®, WiMAX, etc.) to effect such communication.
[0020] Referring now to FIG. 2, in the illustrative embodiment, the computing device
100 establishes an environment 200 during operation. The illustrative embodiment 200 includes an input module 202, a symbol tag decoding module 204, a data source module 206, an output module 208, and a slow-path module 210. In use, the computing device 100 is configured to read compressed data from an input stream 212, decode the compressed data, and write decompressed data to an output stream 214. The various modules of the environment 200 may be embodied as hardware, firmware, software, or a combination thereof. For example the various modules, logic, and other components of the environment 200 may form a portion of, or otherwise be established by, the processor 120 or other hardware components of the computing device 100.
[0021] The input module 202 is configured to manage access to the input stream 212.
The input module 202 is configured to open the input stream 212 and read symbols and other data from the input stream 212. The input module 202 may maintain an input stream pointer that may be used to access compressed data from the input stream 212. The input stream 212 may be embodied as any in-memory data structure including compressed data. The input stream 212 may be backed by or otherwise associated with a file, network connection, memory buffer, or any other source of compressed data.
[0022] The symbol tag decoding module 204 is configured to determine a next symbol increment value, a literal increment value, a data length, and an offset value based on a symbol tag value read by the input module 202. As described above, the compressed data includes a series of symbols. Each symbol may be a literal symbol or a reference symbol, and each symbol may occupy a variable number of bytes in the input stream 212. Literal symbols include literal data that is to be copied to the output stream 214 during decompression. Reference symbols refer to previously decompressed data that is to be copied to the output stream 214 during decompression, for example by copying data that was previously copied to the output stream 214. The next symbol increment value may be used to identify the location in the input stream 212 of the beginning of the next symbol. The data length indicates how many bytes of data are to be copied, for both literal symbols and reference symbols. The literal increment value may be used to locate the start of literal data in the input stream 212, and the
offset value may be used to locate the start of reference data in the output stream 214. In some embodiments, the symbol tag decoding module 204 may be configured to determine the next symbol increment value, the literal increment, and the data length by indexing a next symbol increment table 216, a literal increment table 218, and a length table 220, respectively. Additionally or alternatively, in some embodiments the symbol tag decoding module 204 may be configured to determine those values programmatically.
[0023] The data source module 206 is configured to maintain a source pointer used to access data to be copied to the decompressed output. The data source module 206 is configured to set the source pointer to point to literal data from the input stream 212 or to reference previously decompressed data from the output stream 214 based on the type of the current symbol (i.e., a literal symbol or a reference symbol). The data source module 206 is configured to set the source pointer without executing any unpredictable branch instructions, for example by using conditional move instructions.
[0024] The output module 208 is configured to manage access to the output stream 214.
The output module 208 is configured to open the output stream 214 and write decompressed data to the output stream 214. The output module 208 is also configured to allow copying already-written data from the output stream 214, used to decompress reference symbols. The output module 208 may maintain an output stream pointer that may be used to read and/or write decompressed data from the output stream 214. The output stream 214 may be embodied as any in-memory data structure capable of storing and referencing decompressed data. The output stream 214 may be backed by or otherwise associated with a file, network connection, memory buffer, or any other destination for decompressed data.
[0025] The slow-path module 210 is configured to execute a slow-path decompression routine to decode symbols that cannot be decoded by the fast path (i.e., by the input module 202, the symbol tag decoding module 204, the data source module 206, and the output module 208). The slow-path decompression routine may be embodied as any optimized or unoptimized decompression algorithm capable of decoding the symbols that cannot be decoded by the fast path such as, for example, the Snappy decompression library developed by Google Inc. The slow-path decompression routine may include unpredictable branch instructions based on the class of the current symbol, for example.
[0026] Referring now to FIG. 3 A, in use, the computing device 100 may execute a method 300 for efficient data decompression. The method 300 begins in block 302, in which the computing device 100 opens the input stream 212 and sets an input stream pointer to the first symbol included in the stream. The computing device 100 may use any technique for
opening the input stream 212, such as copying the contents of the file to a memory buffer or memory-mapping a file. For many file formats, the input stream 212 may include a header or other data before the first symbol. For example, the Snappy compressed file format includes a preamble storing the uncompressed length of the file as a little-endian varint. The computing device 100 may perform any appropriate operations to process the header and increment the input stream pointer to the first symbol.
[0027] In block 304, the computing device 100 opens the output stream 214 and initializes an output stream pointer. The computing device 100 may use any technique for opening the output stream 214, such as creating an in-memory write buffer or memory-mapping a file. After being opened, the computing device 100 is capable of writing data to the output stream 214 starting at the output stream pointer. The computing device 100 is also capable of reading and/or copying data from the output stream 214, which is used to decompress reference symbols.
[0028] In block 306, the computing device 100 reads a tag value for the current input symbol from the input stream pointer. In the illustrative embodiment, which decompresses files stored in the Snappy format, the computing device 100 reads a single tag byte from the input stream 212. However, in other embodiments, the computing device 100 may read additional tag data. As described above, the input stream 212 includes a sequence of symbols, including literal symbols and reference symbols. The tag value may be used by the computing device 100 to determine the type of the current symbol, and may also be used to determine parameters of the symbol such as offset and data length.
[0029] Referring now to FIG. 4, a diagram 400 illustrates various symbols used in the
Snappy format. Each symbol begins with a tag byte and includes a two-bit class value in the least- significant two bits of the tag byte that may be used to categorize the symbols. Symbols 402, 404 are literal symbols, with a class value equal to the binary value "00." The symbol 402 includes a tag byte followed by sequence of literal data bytes. The most-significant six bits of the tag byte represent the length of the literal minus one. The symbol 402 may represent literals of lengths from 1 to 60 bytes, inclusive. Thus, the symbol 402 may be used for relatively short literals.
[0030] The symbol 404 may be used for longer literals. The symbol 404 includes a tag byte followed by a length value, and then followed by a sequence of literal data bytes. The most-significant six bits of the tag byte are coded to indicate how many bytes are used to store the length value. Binary values corresponding to 60, 61, 62, or 63 correspond to lengths of 1-4
bytes, respectively. The length value is equal to the length of the literal minus one, stored in little-endian format.
[0031] Symbols 406, 408, 410 are reference symbols. The symbol 406 is a one-byte offset reference symbol with a class value equal to the binary value "01." The symbol 406 includes an 11-bit offset value. The three most-significant bits of the offset (ow through <¾) are stored in the three most-significant bits of the tag byte, and the rest of the offset (bits οη through oo) is stored in the next byte following the tag byte. The tag byte also includes a three-bit length value positioned between the offset bits and the class bits (bits numbered 4 to 2 of the tag byte, labeled Z2 through lo). The length value represents the data length minus four; therefore, the symbol 406 may store lengths from four to 11, inclusive, and offsets from zero to 2047, inclusive.
[0032] The symbol 408 is a two-byte offset reference symbol with a class value equal to the binary value "10." The symbol 408 includes a two-byte offset value following the tag byte, stored as a little-endian 16-bit integer. In other words, the first byte of the offset stores the eight least- significant bits and the second byte of the offset stores the eight most-significant bits. The length value is stored in the most-significant six bits of the tag byte, and represents the length of data to be copied minus one. The symbol 408 may store lengths from one to 64, inclusive, and offsets from zero to 65,535, inclusive.
[0033] The symbol 408 is a four-byte offset reference symbol with a class value equal to the binary value "11." The symbol 408 includes a four-byte offset value following the tag byte, stored as a little-endian 32-bit integer. The length value is stored in the most-significant six bits of the tag byte, and equals the length of data to be copied minus one. Four-byte offset reference symbols may be very rare in compressed data in use, because generation of such symbols would require compressors to maintain a large amount of history.
[0034] Referring back to FIG. 3A, after reading the tag value, in block 308 the computing device 100 determines whether the tag value is greater than a maximum data length. If the tag value is greater than the maximum data length, then the computing device 100 may not be capable of a fast-path decompression of the symbol. In many embodiments, the maximum data length may be 60 bytes, because as described above, if the upper six bits of the tag value are greater than or equal to 60 (because the upper six bits include the length minus one), then the symbol may be a large literal symbol, such as the symbol 404 of FIG. 4. In those embodiments, the computing device 100 may determine whether the upper six bits of the tag byte are greater than or equal to 60, which may be equivalent to determining whether the tag value is greater than or equal to 60 times four. If the computing device 100 determines that the
tag value is greater than the maximum data length, the method 300 branches to block 310. If not, the computing device 100 advances to block 312, described below.
[0035] In block 310, the computing device 100 decompresses the current input symbol using a slow-path routine. The slow-path routine may perform an ordinary, optimized or unoptimized decompression algorithm. In particular, when executing the slow-path routine, the computing device 100 may perform unpredictable branch instructions or other potentially slow instructions to perform correct decompression of the input symbol. Because the slow-path is rarely taken, overall performance of the method 300 may not be adversely impacted by branch misprediction penalties or other performance issues in the slow-path. When executing the slow-path routine, the computing device 100 may not make assumptions about the type of the current input symbol and thus may check for all potential formats. For example, although the tag byte may have its upper six bits greater than or equal to 60, the current input symbol is not necessarily a long literal symbol. For example, the current symbol may be a two- or four-byte reference symbol having a length greater than 60. After decompressing the current symbol and updating the input stream pointer and the output stream pointer accordingly, the method 300 loops back to block 306 to continue decompressing the next symbol.
[0036] Referring back to block 308, if the tag value is not greater than or equal to 60 times four, the method 300 advances to block 312. Because the tag value will only rarely be greater than or equal to 60 times four, in most iterations the method 300 advances to block 312. Therefore, branch prediction hardware of the processor 120 may be capable of predicting whether the method 300 advances to block 312 with high accuracy. In block 312, the computing device 100 sets a class value equal to the lower two bits of the tag byte. The computing device 100 may, for example, mask off the lower two bits using one or more bitwise operations. As shown in FIG. 4, the two-bit class value identifies four different types of symbols: literals, one-byte offset references, two-byte offset references, and four-byte offset references.
[0037] In block 314, the computing device 100 determines whether the class of the current symbol is a four-byte offset reference symbol. For example, the computing device 100 may determine whether the class value equals the binary value "11." The computing device 100 may not be capable of a fast-path decompression of four-byte offset reference symbols. If the symbol is a four-byte offset reference symbol, the method 300 branches to block 310 to perform the slow-path decompression routine, as described above. If the symbol is not a four- byte offset reference symbol, the method 300 advances to block 316. As described above, four- byte offset reference symbols are rare. Therefore, in most iterations the method 300 advances
to block 316, and branch prediction hardware of the processor 120 may be capable of predicting whether the method 300 advances to block 316 with high accuracy.
[0038] In block 316, the computing device 100 looks up the increment value to the next symbol by indexing the next symbol increment table 216 using the tag byte. The next symbol increment table 216 is small (e.g., no more than 256 bytes), and may be capable of being stored in cache memory of the processor 120. Therefore, determination of the next symbol increment value may be completed very quickly (i.e., in the time required for an LI cache hit, for example four clock cycles). As described below, the next symbol increment value may be added to the input stream pointer to determine the position in the input stream 212 of the next symbol. Thus, the determination of the next symbol increment value may be on the critical path of the method 300. By calculating the next symbol increment value quickly and without depending on any unpredictable branches, the computing device 100 may reduce the length and/or latency of the critical path. In particular, in embodiments having a processor 120 capable of out-of-order instruction execution, the computing device 100 may be capable of continuing out-of-order execution for decompression of additional input symbols. Further, although illustrated as looking the next symbol increment value up from the next symbol increment table 216, it should be understood that in some embodiments the computing device 100 may calculate the next symbol increment value programmatically.
[0039] In block 318, the computing device 100 looks up the increment value to the start of a literal symbol by indexing the literal increment table 218 using the tag byte. As illustrated by symbols 402, 404 of FIG. 4, for literal symbols, the increment from the address of tag byte to the start of the literal data may vary between 1-5 bytes, depending on the length of the literal data. Additionally, the literal increment table 218 may include any value for tag bytes associated with reference symbols, because the literal increment value will not be used for those symbols. Similar to the next symbol increment table 216, the literal increment table 218 is small (e.g., no more than 256 bytes), and may be capable of being stored in cache memory of the processor 120. Further, although illustrated as looking the literal increment value up from the literal increment table 218, it should be understood that in some embodiments the computing device 100 may calculate the literal increment value programmatically. Additionally or alternatively, in some embodiments the fast-path decompression routine may only decompress relatively short literals having an offset of one byte. In those embodiments, the literal increment table 218 may include all "ones," or the increment to the start of the literal data may be a constant value of one and the literal increment table 218 may be omitted.
[0040] In block 320, the computing device 100 looks up the length of data to be copied by indexing the length table 220 using the tag byte. All of the symbols that may be processed by the fast-path decompression process include a representation of the data length in the tag byte itself. For example, the symbols 402, 406, 408 of FIG. 4 all include the length in the tag byte. The length table 220 may include any value— or no values— for tag bytes that will not be processed by the fast-path routine. Similar to the tables 216, 218, the length table 220 is small (e.g., no more than 256 bytes), and may be capable of being stored in cache memory of the processor 120. Further, although illustrated as looking the data length value up from the length table 220, it should be understood that in some embodiments the computing device 100 may calculate the data length value programmatically.
[0041] In block 322, the computing device 100 right-shifts the tag value by five bits, retaining the original upper three bits. Right- shifting the tag value allows the computing device 100 to extract the upper bits of the offset for one-byte reference symbols. As illustrated by symbol 406 of FIG. 4, right-shifting the tag byte by five bits moves the upper three bits of the offset (oio through o8) to the three least- significant bits of the tag byte.
[0042] In block 324, the computing device 100 sets a literal pointer to point to the input stream pointer plus the literal increment value determined as described above in block 318. The computing device 100 may set the literal pointer without determining whether the current symbol is a literal symbol or a reference symbol. As described below, the computing device 100 will disregard the literal pointer for reference symbols.
[0043] Referring now to FIG. 3B, the method 300 continues with block 326, in which the computing device 100 conditionally moves the second byte of the offset value to the tag value if the symbol is a two-byte offset reference symbol, retaining the tag value if the symbol is not a two-byte offset reference symbol. As illustrated by symbol 408 of FIG. 4, for two-byte offset symbols, the second byte of the offset value includes the eight most-significant bits of the offset value (bits 15 through 8). The computing device 100 may use any technique to conditionally set the tag value without executing a conditional branch instruction. For example the computing device 100 may perform the conditional move using a tertiary operator, predicated instruction, conditional move instruction, or other processor instruction. In the illustrative embodiment, the computing device 100 tests whether the class value matches the binary value "10" and then executes a conditional move (CMOV) instruction based on the results of the test. Performing a conditional move instruction allows the computing device 100 to select the proper value without executing any unpredictable branch instructions and incurring associated branch misprediction penalties.
[0044] In block 328, the computing device 100 sets an offset value to the concatenation of the tag value and the first byte of the offset. As described above, the tag value includes either the three most-significant bits of the offset value, as described in connection with block 322 above, or the eight most-significant bits of the offset value, as described in connection with block 326 above. Thus, after concatenation the offset value is correct for both one-byte and two-byte offset symbols. Additionally, as described above, the offset value may have been calculated without executing any unpredictable branch instructions.
[0045] In block 330, the computing device 100 conditionally sets a source pointer to the literal pointer if the symbol has a literal class and to the difference between the output stream pointer and the offset value if the symbol does not have a literal class value. The computing device 100 may use any technique to conditionally set the source pointer. For example the computing device 100 may perform the conditional move using a tertiary operator, predicated instruction, conditional move instruction, or other processor instruction. In the illustrative embodiment, the computing device 100 tests whether the class value is the binary value "00," and then executes a conditional move (CMOV) instruction to move either the literal pointer or the difference between the output stream pointer and the offset value based on the results of the test. Performing a conditional move instruction allows the computing device 100 to set the proper value of the source pointer without executing any unpredictable branch instructions and incurring associated branch misprediction penalties. After determining the source pointer, the computing device 100 may copy the data length amount of bytes from the source pointer to the output stream pointer, as further described below. The actual data is thus either copied from the literal data of the input stream 212 or from data previously output to the output stream 214.
[0046] In block 332, the computing device 100 determines whether the offset value is less than 16 and whether the class of the symbol is not literal. In some embodiments, the computing device 100 may perform short-circuit logical evaluation of that test. That is, if the offset value is greater than or equal to 16, the computing device 100 may not test the class of the symbol. In many embodiments, the offset value is usually greater than or equal to 16. Thus, the determination of block 332 may be highly predictable using branch prediction hardware of the computing device 100. If the offset value is less than 16 and the class is not literal, the method 332 branches to block 336, described below. If not, the method 300 branches to block 334.
[0047] In block 334, the computing device 100 performs a 16-byte block memory copy of the data length number of bytes starting at the source pointer, to the output stream pointer. In many embodiments, the processor 120 of the computing device 100 may be capable of fast 16-
byte unaligned memory copies, for example using specialized vector instructions or vector registers. Because the computing device 100 copies 16 bytes of data at a time, more data than the requested data length may be copied to the output stream 214. However, as described below, after completing the copy, that incorrectly copied data will be positioned past the output stream pointer and thus will be overwritten with correct data when additional symbols are decoded. After copying the data, the method 300 advances to block 338, described below.
[0048] Referring back to block 332, if the offset value is less than 16 and the class is not literal, the method 332 branches to block 336. In block 336, the computing device 100 performs a byte -by-byte memory copy of data length bytes from the source pointer to the output stream pointer. Performing a byte-by-byte copy may typically be slower than a block copy, but the byte-by-byte copy may be required for correctness and/or to avoid page faults or other errors. After copying the data, the method 300 advances to block 338.
[0049] In block 338, the computing device 100 increments the output stream pointer by the length of the data copied to the output stream 214. Thus, the output stream pointer is prepared to write decompressed data for the next symbol at the correct position in the output stream 214. In block 340, the computing device 100 increments the input stream pointer by the next symbol increment value. Thus, the input stream pointer is prepared to read data for the next input symbol at the correct position in the input stream 212.
[0050] In block 342, the computing device 100 determines whether additional symbols remain to be decoded. The computing device 100 may use any technique to determine whether additional symbols remain, such as comparing the output stream pointer or the input stream pointer to maximum sizes previously determined based on a header of the compressed file, testing whether an end of file has been reached in the input stream 212, or any other test. If additional symbols remain, the method 300 loops back to block 306 to read the next tag byte, shown in FIG. 3A. If no additional symbols remain, the method 300 is completed. The computing device 100 may close the input stream 212 and/or the output stream 214, output the decompressed content, or perform any other required processing to produce the decompressed output. The method 300 may be restarted at block 302 to perform additional decompression.
[0051] Referring now to FIG. 5, the pseudocode 500 illustrates one potential embodiment of the method 300. As shown, the pseudocode 500 illustrates operations 306' through 340', which each correspond to one illustrative embodiment of blocks 306 through 340 of FIGS. 3A and 3B, respectively. In particular, the pseudocode 500 determines whether to apply the slow-path routine in operations 308' through 314' by performing highly predictable "if statements that, if true, may jump to the slow-path routine, corresponding to one illustrative
embodiment of the blocks 308 through 314. Additionally, the pseudocode 500 conditionally assigns the value of the source pointer in the operation 330', which includes a tertiary operator and corresponds to one illustrative embodiment of block 330. As described above, in many embodiments that tertiary operator may be compiled to executable code including a conditional move instruction such as CMOV. The pseudocode 500 also uses a similar operation 326' including a tertiary operator to conditionally move the second byte of the offset value, corresponding to one illustrative embodiment of the block 326. Referring now to FIG. 6, the pseudocode 600 illustrates operations 326", 328", which each correspond to another illustrative embodiment of the blocks 326, 328 of the method 300, respectively. As shown, the pseudocode 600 also uses a tertiary operator to calculate the offset value, which may compiled to executable code including a conditional move instruction such as CMOV.
EXAMPLES
[0052] Illustrative examples of the technologies disclosed herein are provided below.
An embodiment of the technologies may include any one or more, and any combination of, the examples described below.
[0053] Example 1 includes a computing device for data decompression, the computing device comprising an input module to read a symbol tag value from a memory location identified by an input pointer; a symbol tag decoding module to determine a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value; a data source module to conditionally set a source pointer to (i) the input pointer plus the literal increment value in response to a determination that the symbol tag value includes a literal class value and (ii) to an output pointer minus the offset value in response to a determination that the symbol tag value does not include the literal class value; and an output module to copy data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer; wherein the input module is further to increment the input pointer by the next symbol increment value in response to copying of the data.
[0054] Example 2 includes the subject matter of Example 1, and wherein to conditionally set the source pointer comprises to conditionally set the source pointer without execution of a branch instruction.
[0055] Example 3 includes the subject matter of any of Examples 1 and 2, and wherein to conditionally set the source pointer comprises to conditionally set the source pointer with a conditional move instruction.
[0056] Example 4 includes the subject matter of any of Examples 1-3, and further including a slow-path module to execute a slow-path decompression routine in response to a determination that a current symbol cannot be fast-path decoded; wherein the symbol tag decoding module is further to determine, as a function of the symbol tag value and prior to a determination of the next symbol increment value, whether the current symbol can be fast-path decoded.
[0057] Example 5 includes the subject matter of any of Examples 1-4, and wherein to determine whether the current symbol can be fast-path decoded comprises to determine whether the data length has a predefined relationship with a maximum data length as a function of the symbol tag.
[0058] Example 6 includes the subject matter of any of Examples 1-5, and wherein to determine whether the data length has the predefined relationship with the maximum data length comprises to determine whether the data length is greater than sixty bytes.
[0059] Example 7 includes the subject matter of any of Examples 1-6, and wherein to determine whether the current symbol can be fast-path decoded comprises to determine whether the symbol tag includes a four-byte offset class value.
[0060] Example 8 includes the subject matter of any of Examples 1-7, and wherein to determine the next symbol increment value comprises to index a next symbol increment table with the symbol tag value.
[0061] Example 9 includes the subject matter of any of Examples 1-8, and wherein to index the next symbol increment table comprises to look up the next symbol increment value in the next symbol increment table stored in a cache memory of a processor of the computing device.
[0062] Example 10 includes the subject matter of any of Examples 1-9, and where to determine the literal increment value comprises to index a literal increment table with the symbol tag value.
[0063] Example 11 includes the subject matter of any of Examples 1-10, and wherein to index the literal increment table comprises to look up the literal increment value in the literal increment table stored in a cache memory of a processor of the computing device.
[0064] Example 12 includes the subject matter of any of Examples 1-11, and wherein to determine the data length comprises to index a length table with the symbol tag value.
[0065] Example 13 includes the subject matter of any of Examples 1-12, and wherein to index the length table comprises to look up the data length in the length table stored in a cache memory of a processor of the computing device.
[0066] Example 14 includes the subject matter of any of Examples 1-13, and wherein to read the symbol tag value comprises to read a tag byte from the memory location identified by the input pointer.
[0067] Example 15 includes the subject matter of any of Examples 1-14, and wherein to determine the offset value as a function of the symbol tag value comprises to right-shift the tag byte by five bits; conditionally set the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and concatenate the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
[0068] Example 16 includes the subject matter of any of Examples 1-15, and wherein to conditionally set the tag byte comprises to conditionally set the tag byte using a conditional move instruction.
[0069] Example 17 includes the subject matter of any of Examples 1-16, and wherein to copy data of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer comprises to determine whether the offset value is less than a predefined block size; determine whether the symbol tag value does not include a literal class value in response to a determination that the offset value is less than the predefined block size; perform a byte-by-byte memory copy of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer in response to a determination that the symbol tag value does not include the literal class value; and perform a block memory copy of the data length using blocks of the predefined block size from the memory location identified by the source pointer to the memory location identified by the output pointer in response to a determination that the offset value is not less than the predefined block size or in response to a determination that the symbol tag value includes the literal class value.
[0070] Example 18 includes the subject matter of any of Examples 1-17, and wherein the predefined block size comprises sixteen bytes, thirty- two bytes, or sixty-four bytes.
[0071] Example 19 includes the subject matter of any of Examples 1-18, and wherein the output module is further to increment the output pointer by the data length in response to copying of the data.
[0072] Example 20 includes the subject matter of any of Examples 1-19, and wherein the input module is further to determine whether additional symbols remain in response to
incrementing of the input pointer; and read a next symbol tag value from a memory location identified by the input pointer in response to a determination that additional symbols remain.
[0073] Example 21 includes a method for data decompression, the method comprising reading, by a computing device, a symbol tag value from a memory location identified by an input pointer; determining, by the computing device, a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value; conditionally setting, by the computing device, a source pointer to (i) the input pointer plus the literal increment value in response to determining that the symbol tag value includes a literal class value and (ii) to an output pointer minus the offset value in response to determining that the symbol tag value does not include the literal class value; copying, by the computing device, data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer; and incrementing, by the computing device, the input pointer by the next symbol increment value in response to copying the data.
[0074] Example 22 includes the subject matter of Example 21, and wherein conditionally setting the source pointer comprises conditionally setting the source pointer without executing a branch instruction.
[0075] Example 23 includes the subject matter of any of Examples 21 and 22, and wherein conditionally setting the source pointer comprises conditionally setting the source pointer using a conditional move instruction.
[0076] Example 24 includes the subject matter of any of Examples 21-23, and further including determining, by the computing device as a function of the symbol tag value and prior to determining the next symbol increment value, whether a current symbol can be fast-path decoded; and executing, by the computing device, a slow-path decompression routine in response to determining the current symbol cannot be fast-path decoded.
[0077] Example 25 includes the subject matter of any of Examples 21-24, and wherein determining whether the current symbol can be fast-path decoded comprises determining whether the data length has a predefined relationship with a maximum data length as a function of the symbol tag.
[0078] Example 26 includes the subject matter of any of Examples 21-25, and wherein determining whether the data length has the predefined relationship with the maximum data length comprises determining whether the data length is greater than sixty bytes.
[0079] Example 27 includes the subject matter of any of Examples 21-26, and wherein determining whether the current symbol can be fast-path decoded comprises determining whether the symbol tag includes a four-byte offset class value.
[0080] Example 28 includes the subject matter of any of Examples 21-27, and wherein determining the next symbol increment value comprises indexing a next symbol increment table with the symbol tag value.
[0081] Example 29 includes the subject matter of any of Examples 21-28, and wherein indexing the next symbol increment table comprises looking up the next symbol increment value in the next symbol increment table stored in a cache memory of a processor of the computing device.
[0082] Example 30 includes the subject matter of any of Examples 21-29, and wherein determining the literal increment value comprises indexing a literal increment table with the symbol tag value.
[0083] Example 31 includes the subject matter of any of Examples 21-30, and wherein indexing the literal increment table comprises looking up the literal increment value in the literal increment table stored in a cache memory of a processor of the computing device.
[0084] Example 32 includes the subject matter of any of Examples 21-31, and wherein determining the data length comprises indexing a length table with the symbol tag value.
[0085] Example 33 includes the subject matter of any of Examples 21-32, and wherein indexing the length table comprises looking up the data length in the length table stored in a cache memory of a processor of the computing device.
[0086] Example 34 includes the subject matter of any of Examples 21-33, and wherein reading the symbol tag value comprises reading a tag byte from the memory location identified by the input pointer.
[0087] Example 35 includes the subject matter of any of Examples 21-34, and wherein determining the offset value as a function of the symbol tag value comprises right- shifting the tag byte by five bits; conditionally setting the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and concatenating the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
[0088] Example 36 includes the subject matter of any of Examples 21-35, and wherein conditionally setting the tag byte comprises conditionally setting the tag byte using a conditional move instruction.
[0089] Example 37 includes the subject matter of any of Examples 21-36, and wherein copying data of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer comprises determining whether the offset
value is less than a predefined block size; determining whether the symbol tag value does not include a literal class value in response to determining the offset value is less than the predefined block size; performing a byte-by-byte memory copy of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer in response to determining the symbol tag value does not include the literal class value; and performing a block memory copy of the data length using blocks of the predefined block size from the memory location identified by the source pointer to the memory location identified by the output pointer in response to determining the offset value is not less than the predefined block size or in response to determining the symbol tag value includes the literal class value.
[0090] Example 38 includes the subject matter of any of Examples 21-37, and wherein the predefined block size comprises sixteen bytes, thirty- two bytes, or sixty-four bytes.
[0091] Example 39 includes the subject matter of any of Examples 21-38, and further including incrementing, by the computing device, the output pointer by the data length in response to copying the data.
[0092] Example 40 includes the subject matter of any of Examples 21-39, and further including determining, by the computing device, whether additional symbols remain in response to incrementing the input pointer; and reading, by the computing device, a next symbol tag value from a memory location identified by the input pointer in response to determining additional symbols remain.
[0093] Example 41 includes a computing device comprising a processor; and a memory having stored therein a plurality of instructions that when executed by the processor cause the computing device to perform the method of any of Examples 21-40.
[0094] Example 42 includes one or more machine readable storage media comprising a plurality of instructions stored thereon that in response to being executed result in a computing device performing the method of any of Examples 21-40.
[0095] Example 43 includes a computing device comprising means for performing the method of any of Examples 21-40.
[0096] Example 44 includes a computing device for data decompression, the computing device comprising means for reading a symbol tag value from a memory location identified by an input pointer; means for determining a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value; means for conditionally setting a source pointer to (i) the input pointer plus the literal increment value in response to determining that the symbol tag value includes a literal class value and (ii) to an
output pointer minus the offset value in response to determining that the symbol tag value does not include the literal class value; means for copying data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer; and means for incrementing the input pointer by the next symbol increment value in response to copying the data.
[0097] Example 45 includes the subject matter of Example 44, and wherein the means for conditionally setting the source pointer comprises means for conditionally setting the source pointer without executing a branch instruction.
[0098] Example 46 includes the subject matter of any of Examples 44 and 45, and wherein the means for conditionally setting the source pointer comprises means for conditionally setting the source pointer using a conditional move instruction.
[0099] Example 47 includes the subject matter of any of Examples 44-46, and further including means for determining, as a function of the symbol tag value and prior to determining the next symbol increment value, whether a current symbol can be fast-path decoded; and means for executing a slow-path decompression routine in response to determining the current symbol cannot be fast-path decoded.
[00100] Example 48 includes the subject matter of any of Examples 44-47, and wherein the means for determining whether the current symbol can be fast-path decoded comprises means for determining whether the data length has a predefined relationship with a maximum data length as a function of the symbol tag.
[0100] Example 49 includes the subject matter of any of Examples 44-48, and wherein the means for determining whether the data length has the predefined relationship with the maximum data length comprises means for determining whether the data length is greater than sixty bytes.
[0101] Example 50 includes the subject matter of any of Examples 44-49, and, wherein the means for determining whether the current symbol can be fast-path decoded comprises means for determining whether the symbol tag includes a four-byte offset class value.
[0102] Example 51 includes the subject matter of any of Examples 44-50, and wherein the means for determining the next symbol increment value comprises means for indexing a next symbol increment table with the symbol tag value.
[0103] Example 52 includes the subject matter of any of Examples 44-51, and wherein the means for indexing the next symbol increment table comprises means for looking up the next symbol increment value in the next symbol increment table stored in a cache memory of a processor of the computing device.
[0104] Example 53 includes the subject matter of any of Examples 44-52, and wherein the means for determining the literal increment value comprises means for indexing a literal increment table with the symbol tag value.
[0105] Example 54 includes the subject matter of any of Examples 44-53, and wherein the means for indexing the literal increment table comprises means for looking up the literal increment value in the literal increment table stored in a cache memory of a processor of the computing device.
[0106] Example 55 includes the subject matter of any of Examples 44-54, and wherein the means for determining the data length comprises means for indexing a length table with the symbol tag value.
[0107] Example 56 includes the subject matter of any of Examples 44-55, and wherein the means for indexing the length table comprises means for looking up the data length in the length table stored in a cache memory of a processor of the computing device.
[0108] Example 57 includes the subject matter of any of Examples 44-56, and wherein the means for reading the symbol tag value comprises means for reading a tag byte from the memory location identified by the input pointer.
[0109] Example 58 includes the subject matter of any of Examples 44-57, and wherein the means for determining the offset value as a function of the symbol tag value comprises means for right-shifting the tag byte by five bits; means for conditionally setting the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and means for concatenating the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
[0110] Example 59 includes the subject matter of any of Examples 44-58, and wherein the means for conditionally setting the tag byte comprises means for conditionally setting the tag byte using a conditional move instruction.
[0111] Example 60 includes the subject matter of any of Examples 44-59, and wherein the means for copying data of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer comprises means for determining whether the offset value is less than a predefined block size; means for determining whether the symbol tag value does not include a literal class value in response to determining the offset value is less than the predefined block size; means for performing a byte-by-byte memory copy of the data length from the memory location identified by the source pointer to
the memory location identified by the output pointer in response to determining the symbol tag value does not include the literal class value; and means for performing a block memory copy of the data length using blocks of the predefined block size from the memory location identified by the source pointer to the memory location identified by the output pointer in response to determining the offset value is not less than the predefined block size or in response to determining the symbol tag value includes the literal class value.
[0112] Example 61 includes the subject matter of any of Examples 44-60, and wherein the predefined block size comprises sixteen bytes, thirty- two bytes, or sixty-four bytes.
[0113] Example 62 includes the subject matter of any of Examples 44-61, and further including means for incrementing the output pointer by the data length in response to copying the data.
[0114] Example 63 includes the subject matter of any of Examples 44-62, and further including means for determining whether additional symbols remain in response to incrementing the input pointer; and means for reading a next symbol tag value from a memory location identified by the input pointer in response to determining additional symbols remain.
Claims
1. A computing device for data decompression, the computing device comprising: an input module to read a symbol tag value from a memory location identified by an input pointer;
a symbol tag decoding module to determine a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value;
a data source module to conditionally set a source pointer to (i) the input pointer plus the literal increment value in response to a determination that the symbol tag value includes a literal class value and (ii) to an output pointer minus the offset value in response to a determination that the symbol tag value does not include the literal class value; and
an output module to copy data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer;
wherein the input module is further to increment the input pointer by the next symbol increment value in response to copying of the data.
2. The computing device of claim 1, wherein to conditionally set the source pointer comprises to conditionally set the source pointer without execution of a branch instruction.
3. The computing device of claim 2, wherein to conditionally set the source pointer comprises to conditionally set the source pointer with a conditional move instruction.
4. The computing device of claim 1, further comprising:
a slow-path module to execute a slow-path decompression routine in response to a determination that a current symbol cannot be fast-path decoded;
wherein the symbol tag decoding module is further to determine, as a function of the symbol tag value and prior to a determination of the next symbol increment value, whether the current symbol can be fast-path decoded.
5. The computing device of claim 4, wherein to determine whether the current symbol can be fast-path decoded comprises to determine whether the data length has a predefined relationship with a maximum data length as a function of the symbol tag.
6. The computing device of claim 5, wherein:
to determine whether the data length has the predefined relationship with the maximum data length comprises to determine whether the data length is greater than sixty bytes; and
to determine whether the current symbol can be fast-path decoded comprises to determine whether the symbol tag includes a four-byte offset class value.
7. The computing device of claim 1, wherein to determine the next symbol increment value comprises to index a next symbol increment table with the symbol tag value, wherein to index the next symbol increment table comprises to look up the next symbol increment value in the next symbol increment table stored in a cache memory of a processor of the computing device.
8. The computing device of claim 1, where to determine the literal increment value comprises to index a literal increment table with the symbol tag value, wherein to index the literal increment table comprises to look up the literal increment value in the literal increment table stored in a cache memory of a processor of the computing device.
9. The computing device of claim 1, wherein to determine the data length comprises to index a length table with the symbol tag value, wherein to index the length table comprises to look up the data length in the length table stored in a cache memory of a processor of the computing device.
10. The computing device of any of claims 1-9, wherein to read the symbol tag value comprises to read a tag byte from the memory location identified by the input pointer.
11. The computing device of claim 10, wherein to determine the offset value as a function of the symbol tag value comprises to:
right-shift the tag byte by five bits;
conditionally set the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and
concatenate the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
12. The computing device of claim 11, wherein to conditionally set the tag byte comprises to conditionally set the tag byte using a conditional move instruction.
13. The computing device of any of claims 1-9, wherein to copy data of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer comprises to:
determine whether the offset value is less than a predefined block size;
determine whether the symbol tag value does not include a literal class value in response to a determination that the offset value is less than the predefined block size;
perform a byte-by-byte memory copy of the data length from the memory location identified by the source pointer to the memory location identified by the output pointer in response to a determination that the symbol tag value does not include the literal class value; and
perform a block memory copy of the data length using blocks of the predefined block size from the memory location identified by the source pointer to the memory location identified by the output pointer in response to a determination that the offset value is not less than the predefined block size or in response to a determination that the symbol tag value includes the literal class value.
14. The computing device of any of claims 1-9, wherein the output module is further to increment the output pointer by the data length in response to copying of the data.
15. The computing device of any of claims 1-9, wherein the input module is further to:
determine whether additional symbols remain in response to incrementing of the input pointer; and
read a next symbol tag value from a memory location identified by the input pointer in response to a determination that additional symbols remain.
16. A method for data decompression, the method comprising:
reading, by a computing device, a symbol tag value from a memory location identified by an input pointer;
determining, by the computing device, a next symbol increment value, a literal increment value, a data length, and an offset value as a function of the symbol tag value;
conditionally setting, by the computing device, a source pointer to (i) the input pointer plus the literal increment value in response to determining that the symbol tag value includes a literal class value and (ii) to an output pointer minus the offset value in response to determining that the symbol tag value does not include the literal class value;
copying, by the computing device, data of the data length from a memory location identified by the source pointer to a memory location identified by the output pointer; and
incrementing, by the computing device, the input pointer by the next symbol increment value in response to copying the data.
17. The method of claim 16, wherein conditionally setting the source pointer comprises conditionally setting the source pointer without executing a branch instruction.
18. The method of claim 17, wherein conditionally setting the source pointer comprises conditionally setting the source pointer using a conditional move instruction.
19. The method of claim 16, further comprising:
determining, by the computing device as a function of the symbol tag value and prior to determining the next symbol increment value, whether a current symbol can be fast- path decoded; and
executing, by the computing device, a slow-path decompression routine in response to determining the current symbol cannot be fast-path decoded.
20. The method of claim 16, wherein reading the symbol tag value comprises reading a tag byte from the memory location identified by the input pointer.
21. The method of claim 20, wherein determining the offset value as a function of the symbol tag value comprises:
right-shifting the tag byte by five bits;
conditionally setting the tag byte to a second offset byte read from the memory location identified by the input pointer if the symbol tag value includes a two-byte offset class value and to the tag byte if the symbol tag value does not include the two-byte offset class value; and
concatenating the tag byte and a first offset byte read from the memory location identified by the input pointer to generate the offset value.
22. The method of claim 16, further comprising:
determining, by the computing device, whether additional symbols remain in response to incrementing the input pointer; and
reading, by the computing device, a next symbol tag value from a memory location identified by the input pointer in response to determining additional symbols remain.
23. A computing device comprising:
a processor; and
a memory having stored therein a plurality of instructions that when executed by the processor cause the computing device to perform the method of any of claims 16-22.
24. One or more machine readable storage media comprising a plurality of instructions stored thereon that in response to being executed result in a computing device performing the method of any of claims 16-22.
25. A computing device comprising means for performing the method of any of claims 16-22.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201580045216.2A CN106664100B (en) | 2014-09-24 | 2015-08-24 | Techniques for efficient LZ77-based data decompression |
EP15843355.7A EP3198729A4 (en) | 2014-09-24 | 2015-08-24 | Technologies for efficient lz77-based data decompression |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US14/494,766 US9524169B2 (en) | 2014-09-24 | 2014-09-24 | Technologies for efficient LZ77-based data decompression |
US14/494,766 | 2014-09-24 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016048516A1 true WO2016048516A1 (en) | 2016-03-31 |
Family
ID=55525809
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/US2015/046540 WO2016048516A1 (en) | 2014-09-24 | 2015-08-24 | Technologies for efficient lz77-based data decompression |
Country Status (5)
Country | Link |
---|---|
US (2) | US9524169B2 (en) |
EP (1) | EP3198729A4 (en) |
CN (1) | CN106664100B (en) |
TW (1) | TWI559688B (en) |
WO (1) | WO2016048516A1 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9524169B2 (en) * | 2014-09-24 | 2016-12-20 | Intel Corporation | Technologies for efficient LZ77-based data decompression |
US10657053B2 (en) * | 2017-03-31 | 2020-05-19 | Kyocera Document Solutions Inc. | Memory allocation techniques for filtering software |
JP2019036810A (en) * | 2017-08-14 | 2019-03-07 | 富士通株式会社 | Data compression device, data recovery device, data compression program, data recovery program, data compression method, and data recovery method |
US11509328B2 (en) * | 2018-05-31 | 2022-11-22 | Microsoft Technology Licensing, Llc | Computer data compression utilizing multiple symbol alphabets and dynamic binding of symbol alphabets |
US11387844B2 (en) * | 2019-04-19 | 2022-07-12 | Preferred Networks, Inc. | Data compression method, data compression apparatus, data decompression method, data decompression apparatus and data storage system |
US11108406B2 (en) | 2019-06-19 | 2021-08-31 | Intel Corporation | System, apparatus and method for dynamic priority-aware compression for interconnect fabrics |
CN110545108B (en) * | 2019-09-09 | 2022-12-20 | 飞天诚信科技股份有限公司 | Data processing method and device, electronic equipment and computer readable storage medium |
CN117097442B (en) * | 2023-10-19 | 2024-01-16 | 深圳大普微电子股份有限公司 | Data decoding method, system, equipment and computer readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070002780A1 (en) * | 2005-06-30 | 2007-01-04 | Nokia Corporation | Signal message compression |
US20090058693A1 (en) * | 2007-08-31 | 2009-03-05 | Raza Microelectronics, Inc. | System and method for huffman decoding within a compression engine |
US20100141488A1 (en) * | 2008-12-10 | 2010-06-10 | Selcuk Baktir | Accelerated decompression |
US20110154169A1 (en) * | 2009-12-22 | 2011-06-23 | Vinodh Gopal | System, method, and apparatus for a scalable processor architecture for a variety of string processing applications |
WO2013082990A1 (en) * | 2011-12-07 | 2013-06-13 | International Business Machines Corporation | High bandwidth decompression of variable length encoded data streams |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6226680B1 (en) * | 1997-10-14 | 2001-05-01 | Alacritech, Inc. | Intelligent network interface system method for protocol processing |
GB2388944B (en) * | 1999-02-05 | 2004-03-17 | Advanced Risc Mach Ltd | Bitmap font data storage within data processing systems |
US6883037B2 (en) * | 2001-03-21 | 2005-04-19 | Microsoft Corporation | Fast data decoder that operates with reduced output buffer bounds checking |
GB0210604D0 (en) * | 2002-05-09 | 2002-06-19 | Ibm | Method and arrangement for data compression |
EP2213063B1 (en) * | 2007-11-16 | 2012-08-01 | Broadcom Corporation | Low density parity check (ldpc) encoded higher order modulation |
CN101616320B (en) * | 2008-06-26 | 2011-05-04 | 展讯通信(上海)有限公司 | Method and equipment for compressing and decompressing image |
CN102841907A (en) * | 2011-06-24 | 2012-12-26 | 环达电脑(上海)有限公司 | Methods for processing data compression and decompression |
US8766827B1 (en) * | 2013-03-15 | 2014-07-01 | Intel Corporation | Parallel apparatus for high-speed, highly compressed LZ77 tokenization and Huffman encoding for deflate compression |
US9252807B2 (en) * | 2013-10-21 | 2016-02-02 | Globalfoundries Inc. | Efficient one-pass cache-aware compression |
US9524169B2 (en) * | 2014-09-24 | 2016-12-20 | Intel Corporation | Technologies for efficient LZ77-based data decompression |
US9515678B1 (en) * | 2015-05-11 | 2016-12-06 | Via Alliance Semiconductor Co., Ltd. | Hardware data compressor that directly huffman encodes output tokens from LZ77 engine |
-
2014
- 2014-09-24 US US14/494,766 patent/US9524169B2/en active Active
-
2015
- 2015-08-10 TW TW104125964A patent/TWI559688B/en not_active IP Right Cessation
- 2015-08-24 WO PCT/US2015/046540 patent/WO2016048516A1/en active Application Filing
- 2015-08-24 CN CN201580045216.2A patent/CN106664100B/en active Active
- 2015-08-24 EP EP15843355.7A patent/EP3198729A4/en not_active Withdrawn
-
2016
- 2016-12-09 US US15/374,462 patent/US9917596B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070002780A1 (en) * | 2005-06-30 | 2007-01-04 | Nokia Corporation | Signal message compression |
US20090058693A1 (en) * | 2007-08-31 | 2009-03-05 | Raza Microelectronics, Inc. | System and method for huffman decoding within a compression engine |
US20100141488A1 (en) * | 2008-12-10 | 2010-06-10 | Selcuk Baktir | Accelerated decompression |
US20110154169A1 (en) * | 2009-12-22 | 2011-06-23 | Vinodh Gopal | System, method, and apparatus for a scalable processor architecture for a variety of string processing applications |
WO2013082990A1 (en) * | 2011-12-07 | 2013-06-13 | International Business Machines Corporation | High bandwidth decompression of variable length encoded data streams |
Non-Patent Citations (1)
Title |
---|
See also references of EP3198729A4 * |
Also Published As
Publication number | Publication date |
---|---|
US9917596B2 (en) | 2018-03-13 |
EP3198729A1 (en) | 2017-08-02 |
CN106664100B (en) | 2020-10-09 |
US9524169B2 (en) | 2016-12-20 |
US20160085555A1 (en) | 2016-03-24 |
TWI559688B (en) | 2016-11-21 |
EP3198729A4 (en) | 2018-06-13 |
TW201626730A (en) | 2016-07-16 |
CN106664100A (en) | 2017-05-10 |
US20170250706A1 (en) | 2017-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9917596B2 (en) | Technologies for efficient LZ77-based data decompression | |
RU2629440C2 (en) | Device and method for acceleration of compression and decompression operations | |
JP5764257B2 (en) | System, apparatus, and method for register alignment | |
JP6498226B2 (en) | Processor and method | |
US9306596B2 (en) | Hybrid CAM assisted deflate decompression accelerator | |
US9886242B2 (en) | Methods to optimize a program loop via vector instructions using a shuffle table | |
US9753666B2 (en) | Efficient data compression for solid-state memory | |
KR20170097008A (en) | Method and apparatus for performing reduction operations on a set of vector elements | |
US9436469B2 (en) | Methods to optimize a program loop via vector instructions using a shuffle table and a mask store table | |
US10666288B2 (en) | Systems, methods, and apparatuses for decompression using hardware and software | |
CN108885551B (en) | Memory copy instruction, processor, method and system | |
JP6419205B2 (en) | Processor, method, system, computer system, and computer-readable storage medium | |
US20140375482A1 (en) | High throughput decoding of variable length data symbols | |
JP6374975B2 (en) | A processor, method, system, and instructions for storing successive source elements in a plurality of unmasked result elements and propagating to a plurality of masked result elements | |
US20170272096A1 (en) | Systems, methods, and apparatuses for decompression using hardware and software | |
US20220197642A1 (en) | Processor instructions for data compression and decompression |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15843355 Country of ref document: EP Kind code of ref document: A1 |
|
REEP | Request for entry into the european phase |
Ref document number: 2015843355 Country of ref document: EP |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2015843355 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |