Compress Data (CPRDATA)
|Op Code (Hex)||Operand 1|
|1041||Compress data template|
|Bound Program Access|
The instruction compresses user data of a specified length. Operand 1 identifies a template which identifies the data to be compressed. The template also identifies the result space to receive the compressed data.
The compress data template must be aligned on a 16-byte boundary. The format is as follows:
The data at the location specified by the source space pointer for the length specified by the source length is compressed and stored at the location specified by the result space pointer. The actual result length is set to the number of bytes in the compressed result. The source data is not modified.
The value of both the source length field and result area length field must be greater than or equal to zero. If either of these conditions is not met, a template value invalid (hex 3801) exception is signalled. If the length of the compressed result is greater than the value in the result area length field, a materialization length invalid (hex 3803) exception is signalled.
The compression algorithm field specifies the algorithm used to compress the data. Generally, the zlib deflate algorithm tends to compress better than the IBM LZ1 algorithm or the simple TERSE algorithm. The zlib deflate algorithm also allows a bias to be specified as a hint to the system to choose between speed of compression versus compression size. If the zlib hardware acceleration feature is available on the machine, it might be used when the zlib deflate algorithm is specified. No hardware acceleration feature is available for the IBM LZ1 algorithm or the simple TERSE algorithm. The algorithm choice is stored in the compressed output data so the Decompress Data (DCPDATA) instruction will automatically select the correct decompression algorithm.
- 0 =
- The compression level will be balanced between speed and compression size.
- 1 =
- The compression will bias toward speed, at the expense of compression size.
- 2 =
- The compression will bias toward compression size, at the expense of speed.
- 3 =
- The data will not be compressed; however, the output will be packaged as though the zlib deflate algorithm was used. This way the Decompress Data (DCPDATA) instruction can still be used on the CPRDATA output.
The zlib deflate algorithm is implemented in software and it can be accelerated if the zlib hardware acceleration feature is available on the machine. The zlib hardware acceleration feature can substantially speed up compression times when compared to using software; however, it might do so at the expense of increased compression size. Therefore, even for the same bias setting, the size of the compressed output could differ depending on whether the zlib hardware acceleration is used or not (which can vary between calls). If hardware acceleration is available, it may be used for zlib deflate bias values of 0 and 1, and only the software implementation is used for zlib deflate bias values of 2 and 3. This is to ensure a smaller compression size for the zlib deflate bias value of 2, which prioritizes a smaller size over faster compression.
Only scalar (non-pointer) data is compressed, so any pointers in the data to be compressed are destroyed in the output of the Compress Data instruction.
- 06 Addressing
- 0601 Space Addressing Violation
- 0602 Boundary Alignment
- 0603 Range
- 08 Argument/Parameter
- 0801 Parameter Reference Violation
- 10 Damage Encountered
- 1044 Partial System Object Damage
- 1C Machine-Dependent
- 1C03 Machine Storage Limit Exceeded
- 20 Machine Support
- 2002 Machine Check
- 2003 Function Check
- 22 Object Access
- 2202 Object Destroyed
- 2203 Object Suspended
- 2208 Object Compressed
- 220B Object Not Available
- 24 Pointer Specification
- 2401 Pointer Does Not Exist
- 2402 Pointer Type Invalid
- 2E Resource Control Limit
- 2E01 User Profile Storage Limit Exceeded
- 36 Space Management
- 3601 Space Extension/Truncation
- 38 Template Specification
- 3801 Template Value Invalid
- 3803 Materialization Length Invalid
- 44 Protection Violation
- 4401 Object Domain or Hardware Storage Protection Violation
- 4402 Literal Values Cannot Be Changed
- 45 Heap Space
- 4503 Heap Space Full