US7868791B2ActiveUtilityA1

Pack unicode zSeries instructions

61
Assignee: IBMPriority: Feb 20, 2007Filed: Mar 1, 2010Granted: Jan 11, 2011
Est. expiryFeb 20, 2027(~0.6 yrs left)· nominal 20-yr term from priority
H03M 7/30
61
PatentIndex Score
2
Cited by
20
References
20
Claims

Abstract

Emulation methods are provided for two PACK instructions, one for Unicode data and the other for ASCII coded data in which processing is carried out in a block-by-block fashion as opposed to a byte-by-byte fashion as a way to provide superior performance in the face of the usual challenges facing the execution of emulated data processing machine instructions as opposed to native instructions.

Claims

exact text as granted — not AI-modified
1. A computer program product for packing data, said computer program product comprising:
 a storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
 obtaining Unicode input data to be packed into memory, said Unicode input data comprising a plurality of blocks of Unicode data, wherein each block of Unicode data comprises a plurality of Unicode characters; 
 selecting a first portion of a chosen block of Unicode data to be packed, said chosen block selected from the plurality of blocks of Unicode data and said first portion comprising a plurality of bytes of data; 
 performing one or more operations on the selected first portion of the chosen block of Unicode data to obtain a first plurality of bytes of packed data; 
 selecting a second portion of the chosen block of Unicode data, said second portion comprising a plurality of bytes of data; 
 performing one or more operations on the selected second portion of the chosen block to obtain a second plurality of bytes of packed data; 
 performing an operation on the first plurality of bytes of packed data and the second plurality of bytes of packed data to obtain a packed output of a plurality of bytes; and 
 repeating the selecting the first portion, performing one or more operations on the selected first portion, selecting the second portion, performing one or more operations on the selected second portion, and the performing the operation for a next chosen block, one or more times, to obtain a packed array for the input data. 
 
 
     
     
       2. The computer program product of  claim 1 , wherein the chosen block comprises 16 bytes of data, the first portion comprises 8 bytes of data and the second portion comprises 8 bytes of data. 
     
     
       3. The computer program product of  claim 1 , wherein the selecting, the performing one or more operations on the selected first portion and the performing one or more operations on the selected second portion are performed four times to provide a total output of 16 bytes of packed data. 
     
     
       4. The computer program product of  claim 1 , wherein the performing one or more operations on the selected first portion comprises performing one or more shift operations and one or more OR operations to obtain the first plurality of bytes of packed data. 
     
     
       5. The computer program product of  claim 1 , wherein the performing one or more operations on the selected second portion comprises performing one or more shift operations and one or more OR operations to obtain the second plurality of bytes of packed data. 
     
     
       6. The computer program product of  claim 1 , wherein the performing an operation on the first plurality of bytes of packed data and the second plurality of bytes of packed data comprises performing an OR operation on the first plurality of bytes of packed data and the second plurality of bytes of packed data to obtain the packed output. 
     
     
       7. The computer program product of  claim 6 , wherein the packed output comprises 4 bytes of packed data. 
     
     
       8. The computer program product of  claim 1 , wherein the performing one or more operations on the selected first portion comprises performing:
 ((BLOCK & 0x000F000F000F000F)<<12)|((BLOCK & 0x000F000F000F000F)<<24)) & 0xFF00000000000000 to obtain a FIRST OUTPUT, where “BLOCK” represents said first portion of the chosen block, and the FIRST OUTPUT represents one byte of packed data of the first plurality of bytes of packed data. 
 
     
     
       9. The computer program product of  claim 8 , wherein the performing one or more operations on the selected first portion comprises performing:
 (((FIRST OUTPUT|BLOCK & 0x000F000F000F000F)<<12)|(BLOCK & 0x000F000F000F000F)<<24))) & 0x00000000FF000000)<<24) to obtain a SECOND OUTPUT, said SECOND OUTPUT representing another byte of packed data of the first plurality of bytes of packed data. 
 
     
     
       10. The computer program product of  claim 1 , wherein the performing one or more operations on the selected second portion comprises performing:
 ((BLOCK2 & 0x000F000F000F000F)<<12)|((BLOCK2 & 0x000F000F000F000F)<<24)) & 0xFF00000000000000>>16 to obtain a THIRD OUTPUT, where “BLOCK2” represents said second portion of the chosen block, and the THIRD OUTPUT represents one byte of packed data of the second plurality of bytes of packed data. 
 
     
     
       11. The computer program product of  claim 10 , wherein the performing one or more operations on the selected second portion comprises performing:
 (((THIRD OUTPUT|BLOCK2 & 0x000F000F000F000F)<<12)|(BLOCK2 & 0x000F000F000F000F)<<24))) & 0x00000000FF000000)<<24) >>32 to obtain a FOURTH OUTPUT, said FOURTH OUTPUT representing another byte of packed data of the second plurality of bytes of packed data. 
 
     
     
       12. A computer system for packing data, the computer system comprising:
 a memory; and 
 a processor in communications with the memory, wherein the computer system is configured to perform a method, said method comprising:
 obtaining Unicode input data to be packed into memory, said Unicode input data comprising a plurality of blocks of Unicode data, wherein each block of Unicode data comprises a plurality of Unicode characters; 
 selecting a first portion of a chosen block of Unicode data to be packed, said chosen block selected from the plurality of blocks of Unicode data and said first portion comprising a plurality of bytes of data; 
 performing one or more operations on the selected first portion of the chosen block of Unicode data to obtain a first plurality of bytes of packed data; 
 selecting a second portion of the chosen block of Unicode data, said second portion comprising a plurality of bytes of data; 
 performing one or more operations on the selected second portion of the chosen block to obtain a second plurality of bytes of packed data; 
 performing an operation on the first plurality of bytes of packed data and the second plurality of bytes of packed data to obtain a packed output of a plurality of bytes; and 
 repeating the selecting the first portion, performing one or more operations on the selected first portion, selecting the second portion, performing one or more operations on the selected second portion, and the performing the operation for a next chosen block, one or more times, to obtain a packed array for the input data. 
 
 
     
     
       13. The computer system of  claim 12 , wherein the selecting, the performing one or more operations on the selected first portion and the performing one or more operations on the selected second portion are performed four times to provide a total output of 16 bytes of packed data. 
     
     
       14. The computer system of  claim 12 , wherein the performing one or more operations on the selected first portion comprises performing one or more shift operations and one or more OR operations to obtain the first plurality of bytes of packed data. 
     
     
       15. The computer system of  claim 12 , wherein the performing one or more operations on the selected second portion comprises performing one or more shift operations and one or more OR operations to obtain the second plurality of bytes of packed data. 
     
     
       16. The computer system of  claim 12 , wherein the performing an operation on the first plurality of bytes of packed data and the second plurality of bytes of packed data comprises performing an OR operation on the first plurality of bytes of packed data and the second plurality of bytes of packed data to obtain the packed output. 
     
     
       17. The computer system of  claim 12 , wherein the performing one or more operations on the selected first portion comprises performing:
 ((BLOCK & 0x000F000F000F000F)<<12)|((BLOCK & 0x000F000F000F000F)<<24)) & 0xFF00000000000000 to obtain a FIRST OUTPUT, where “BLOCK” represents said first portion of the chosen block, and the FIRST OUTPUT represents one byte of packed data of the first plurality of bytes of packed data; and 
 (((FIRST OUTPUT|BLOCK & 0x000F000F000F000F)<<12)|(BLOCK & 0x000F000F000F000F)<<24))) & 0x00000000FF000000)<<24) to obtain a SECOND OUTPUT, said SECOND OUTPUT representing another byte of packed data of the first plurality of bytes of packed data; and
 wherein the performing one or more operations on the selected second portion comprises performing:
 ((BLOCK2 & 0x000F000F000F000F)<<12)|((BLOCK2 & 0x000F000F000F000F)<<24)) & 0xFF00000000000000>>16 to obtain a THIRD OUTPUT, where “BLOCK2” represents said second portion of the chosen block, and the THIRD OUTPUT represents one byte of packed data of the second plurality of bytes of packed data; and 
 (((THIRD OUTPUT|BLOCK2 & 0x000F000F000F000F) <<12)|(BLOCK2 & 0x000F000F000F000F)<<24))) & 0x00000000FF000000)<<24)>>32 to obtain a FOURTH OUTPUT, said FOURTH OUTPUT representing another byte of packed data of the second plurality of bytes of packed data. 
 
 
 
     
     
       18. A method for packing data, said method comprising:
 obtaining Unicode input data to be packed into memory, said Unicode input data comprising a plurality of blocks of Unicode data, wherein each block of Unicode data comprises a plurality of Unicode characters; 
 selecting a first portion of a chosen block of Unicode data to be packed, said chosen block selected from the plurality of blocks of Unicode data and said first portion comprising a plurality of bytes of data; 
 performing one or more operations on the selected first portion of the chosen block of Unicode data to obtain a first plurality of bytes of packed data; 
 selecting a second portion of the chosen block of Unicode data, said second portion comprising a plurality of bytes of data; 
 performing one or more operations on the selected second portion of the chosen block to obtain a second plurality of bytes of packed data; 
 performing an operation on the first plurality of bytes of packed data and the second plurality of bytes of packed data to obtain a packed output of a plurality of bytes; and 
 repeating the selecting the first portion, performing one or more operations on the selected first portion, selecting the second portion, performing one or more operations on the selected second portion, and the performing the operation for a next chosen block, one or more times, to obtain a packed array for the input data. 
 
     
     
       19. The method of  claim 18 , wherein the selecting, the performing one or more operations on the selected first portion and the performing one or more operations on the selected second portion are performed four times to provide a total output of 16bytes of packed data. 
     
     
       20. The method of  claim 18 , wherein the performing one or more operations on the selected first portion comprises performing:
 ((BLOCK & 0x000F000F000F000F)<<12)|((BLOCK & 0x000F000F000F000F)<<24)) & 0xFF00000000000000 to obtain a FIRST OUTPUT, where “BLOCK” represents said first portion of the chosen block, and the FIRST OUTPUT represents one byte of packed data of the first plurality of bytes of packed data; and 
 (((FIRST OUTPUT|BLOCK & 0x000F000F000F000F)<<12)|(BLOCK & 0x000F000F000F000F)<<24))) & 0x00000000FF000000)<<24) to obtain a SECOND OUTPUT, said SECOND OUTPUT representing another byte of packed data of the first plurality of bytes of packed data; and
 wherein the performing one or more operations on the selected second portion comprises performing:
 ((BLOCK2 & 0x000F000F000F000F)<<12)|((BLOCK2 & 0x000F000F000F000F)<<24)) & 0xFF00000000000000>>to obtain a THIRD OUTPUT, where “BLOCK2” represents said second portion of the chosen block, and the THIRD OUTPUT represents one byte of packed data of the second plurality of bytes of packed data; and 
 (((THIRD OUTPUT|BLOCK2 & 0x000F000F000F000F) <<12)|(BLOCK2 & 0x000F000F000F000F)<<24))) & 0x00000000FF000000)<<24)>>32 to obtain a FOURTH OUTPUT, said FOURTH OUTPUT representing another byte of packed data of the second plurality of bytes of packed data.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.