Patent ID: 7408484

Claim:
A method for packing data from a Unicode field to a field which is approximately half as wide, said method comprising the steps of: retrieving input data to be packed from a memory and storing it in an offset position in memory locations which represent a local array having a plurality of bytes; setting a source pointer to point to address “local array+2” in said memory; setting a target pointer to point to a position in said memory said pointer representing a local array which holds operation results in a plurality of 4-byte output blocks; computing a first byte of a present block of the output as: (((BLOCK & 0x000F000F000F000F)<<12)|((BLOCK & 0x000F000F000F000F)<<24)) & 0xFF0000000000000), where “BLOCK” represents a block of said input data; generating the three remaining bytes of the present block by shifting and then ORing the byte to the 4-byte output block; incrementing said pointers and repeating the previous two steps three more times, once for each said block of said input data; setting the last nibble to 0xC; and storing said pack array in said memory.