Claims
- 1. A method comprising:
shuffling first set of packed data from a first source based on a first set of masks to produce a first set of shuffled data, said first set of masks to include a first plurality of control entries, wherein at least one of said first plurality of control entries is to set a first data element position in said first set of shuffled data to zero; shuffling second packed data from a second source based on a second set of masks to produce a second set of shuffled data, said second set of masks include a second plurality of control entries, wherein at least one of said second plurality of control entries is to set a second data element position in said second set of shuffled data to zero, wherein said second data element position is different than said first data element position; and merging said first set of shuffled data and said second set of shuffled data together to form a packed data resultant.
- 2. The method of claim 1 further comprising:
loading said first set of packed data; and loading said second set of packed data.
- 3. The method of claim 1 further comprising:
loading said first set of masks for shuffling said first set of packed data; and loading said second set of masks for shuffling said second set of packed data.
- 4. The method of claim 3 wherein said first set of masks and said second set of masks are complementary, wherein said first set of masks is to flush to zero at least one data element position not flushed to zero by said second set of masks and said second set of masks is to flush to zero at least one data element position not flushed to zero by said first set of masks.
- 5. The method of claim 1 wherein said first set of masks and said second set of masks are each comprised of a plurality of shuffle control masks to control associated data element positions in shuffle operations.
- 6. The method of claim 5 wherein each shuffle control mask is comprised of:
a flush to zero field, said flush to zero field to indicate whether a data element position associated with this shuffle control mask is to be filled with a zero value; a selection field, said selection field to indicate which table data element to shuffle data from; and a source select field, said source select field to indicate which of said plurality of table sections to shuffle data from for this shuffle control mask.
- 7. The method of claim 1 wherein said merging comprises performing a logical OR operation on said first set of shuffled data and said second set of shuffled data.
- 8. The method of claim 5 wherein said shuffling comprises:
for each shuffle control mask, shuffling data from a data element designated by said shuffle control mask to an associated resultant data element position if its flush to zero field is not set and placing a zero into said associated resultant data element position if its flush to zero field is not set.
- 9. The method of claim 2 wherein a capacity of each single instruction multiple data register is 128 bits.
- 10. The method of claim 2 wherein:
said first packed data is comprised of a first plurality byte wide data elements; said second packed data is comprised of a second plurality of byte wide data elements; said first set of masks is comprised of a first plurality of byte wide shuffle masks; and said second set of masks is comprised of a second plurality of byte wide shuffle masks.
- 11. A method for rearranging data comprising:
loading first data for a first plane and second data for a second plane; loading a first control mask having a first shuffle pattern and a second control mask having a second shuffle pattern; selecting one of said control masks to operate on said first plane data and another of said control masks to operate on said second plane data, wherein said one control mask is different from said another control mask; shuffling a first portion of said first plane data in accordance with said one control mask to generate a first set of shuffle data and a second portion of said second plane data in accordance with said another control mask to generate a second set of shuffled data; and merging said first set of shuffled data together with said second set of shuffled data to form a packed data resultant having data from both said first plane and said second plane.
- 12. The method of claim 11 further comprising determining whether more data in said first plane and said second plane is available for shuffling and merging.
- 13. The method of claim 12 further comprising:
if said determination indicates more data is available for shuffling and merging, shifting out said first portion of said first plane data and shifting out said second portion of said plane data, and performing said operations of shuffling and merging on a third portion of said first plane with a different control mask than said one control mask and on a fourth portion of said second plane with a different control mask than said another control mask.
- 14. The method of claim 13 wherein said first plane is comprised of a first plurality of packed data elements and said second plane is comprised of a second plurality of packed data elements.
- 15. The method of claim 14 wherein said first control mask is comprised of a first set of masks to include a first plurality of control elements, wherein at least one of said first plurality of control elements is to set a first data element position in said first set of shuffled data to zero.
- 16. The method of claim 15 wherein said second control mask is comprised of a second set of masks to include a second plurality of control elements, wherein at least one of said second plurality of control elements is to set a second data element position in said second set of shuffled data to zero.
- 17. The method of claim 16 wherein each control element is comprised of:
a flush to zero field, said flush to zero field to indicate whether a data element position associated with this control element is to be filled with a zero value; a selection field, said selection field to indicate which table data element to shuffle data from; and a source select field, said source select field to indicate which of said plurality of table sections to shuffle data from for this control element.
- 18. The method of claim 17 wherein said first control mask and said second control mask are complementary, wherein said first plurality of control elements of said first control mask is to flush to zero at least one data element position not flushed to zero by said second set of masks and said second set of mask is to flush to zero at least one data element position not flushed to zero by said first set of masks.
- 19. The method of claim 17 wherein said first control mask and said second control mask are each comprised of a plurality of control elements to control the filling of associated data element positions during shuffle operations.
- 20. The method of claim 19 wherein for each control element, data from a data element designated by said control element is to be shuffled to an associated resultant data element position if its flush to zero field is not set and placing a zero into said associated resultant data element position if its flush to zero field is not set.
- 21. The method of claim 20 wherein:
each element of said first plurality of packed data elements is byte wide; each element of said second plurality of packed data elements is byte wide; each shuffle mask of said first plurality of shuffle masks is byte wide; and each shuffle mask of said second plurality of shuffle masks is byte wide.
- 22. The method of claim 18 further comprising loading third data for a third plane and loading a third control mask having a third shuffle pattern.
- 23. The method of claim 22 wherein said selecting further comprises selecting yet another mask from said control masks to operate on said third plane, said control masks to include said first, second, and third control masks.
- 24. The method of claim 23 wherein shuffling further comprises shuffling a fifth portion of said third plane data in accordance with said yet another mask to generate a third set of shuffle data.
- 25. The method of claim 24 wherein said third control mask is comprised of a third set of masks to include a third plurality of control elements, wherein at least one of said third plurality of control elements is to set a third data element position in said third set of shuffled data to zero, said third control mask complementary to said first and second control masks wherein said third plurality of control elements is to flush to zero at least one data element position not flushed to zero by either of said first and second set of masks and said first and second set of masks are each to further flush to zero at least one data element position not flushed to zero by said third set of masks.
- 26. The method of claim 25 wherein said merging further comprises merging said third set of shuffled data together with said first and second set of shuffled data to form said packed data resultant, said packed data resultant to include data from said first, second, and third planes.
- 27. The method of claim 26 further comprising determining whether more data in said third plane is available for shuffling and merging.
- 28. An article comprising a machine readable medium that stores a program, said program being executable by a machine to perform a method comprising:
shuffling first set of packed data from a first source based on a first set of masks to produce a first set of shuffled data, said first set of masks to include a first plurality of control entries, wherein at least one of said first plurality of control entries is to set a first data element position in said first set of shuffled data to zero; shuffling second packed data from a second source based on a second set of masks to produce a second set of shuffled data, said second set of masks include a second plurality of control entries, wherein at least one of said second plurality of control entries is to set a second data element position in said second set of shuffled data to zero, said second data element position different from said first data element position; and merging said first set of shuffled data and said second set of shuffled data together to form a packed data resultant.
- 29. The article of claim 28 wherein said program further comprises:
loading said first set of packed data; loading said second set of packed data; loading a first set of masks for shuffling said first set of packed data; and loading a second set of masks for shuffling said second set of packed data.
- 30. The article of claim 29 wherein said first set of masks and said second set of masks are complementary, wherein said first set of masks is to flush to zero at least one data element position not flushed to zero by said second set of masks and said second set of masks is to flush to zero at least one data element position not flushed to zero by said first set of masks.
- 31. The article of claim 28 wherein each mask is comprised of:
a flush to zero field, said flush to zero field to indicate whether a data element position associated with this mask is to be filled with a zero value; a selection field, said selection field to indicate which table data element to shuffle data from; and a source select field, said source select field to indicate which of said plurality of table sections to shuffle data from for this mask.
- 32. The article of claim 31 wherein said merging comprises performing a logical OR operation on said first set of shuffled data and said second set of shuffled data.
- 33. The article of claim 32 wherein said shuffling comprises:
for each mask, shuffling data from a data element designated by said mask to an associated resultant data element position if its flush to zero field is not set and placing a zero into said associated resultant data element position if its flush to zero field is not set.
- 34. An apparatus comprising:
an execution unit to execute a sequence of instructions, said instructions to perform a data rearrangement operation, said instructions to cause said execution to:
shuffle a first set of packed data from a first source based on a first set of masks to produce a first set of shuffled data, said first set of masks to include a first plurality of control entries, wherein at least one of said first plurality of control entries is to set at a first data element position in said first set of shuffled data to zero; shuffle a second packed data from a second source based on a second set of masks to produce a second set of shuffled data, said second set of masks include a second plurality of control entries, wherein at least one of said second plurality of control entries is to set to zero a second data element position in said second set of shuffled data, wherein said second data element position is different than said first data element position; and merge said first set of shuffled data and said second set of shuffled data together to form a packed data resultant.
- 35. The apparatus of claim 34 wherein said instructions are to further cause said execution unit to:
load said first set of packed data; load said second set of packed data; load a first set of masks for shuffling said first set of packed data; and load a second set of masks for shuffling said second set of packed data.
- 36. The apparatus of claim 35 wherein said first set of masks and said second set of masks are complementary, wherein said first set of masks is to flush to zero at least one data element position not flushed to zero by said second set of masks and said second set of masks is to flush to zero at least one data element position not flushed to zero by said first set of masks.
- 37. The apparatus of claim 34 wherein each mask is comprised of:
a flush to zero field, said flush to zero field to indicate whether a data element position associated with this mask is to be filled with a zero value; a selection field, said selection field to indicate which table data element to shuffle data from; and a source select field, said source select field to indicate which of said plurality of table sections to shuffle data from for this mask.
- 38. The apparatus of claim 37 wherein each of said shuffle comprises:
for each mask, shuffling data from a data element designated by said mask to an associated resultant data element position if its flush to zero field is not set and placing a zero into said associated resultant data element position if its flush to zero field is not set.
- 39. A system comprising:
a memory to store data and instructions; a processor coupled to said memory on a bus, said processor operable to perform instructions for a data rearrangement algorithm, said processor comprising:
a bus unit to receive a sequence of instructions from said memory; an execution unit coupled to said bus unit, said execution unit to execute said sequence, said sequence to cause said execution unit to:
shuffle a first set of packed data from a first source based on a first set of masks to produce a first set of shuffled data, said first set of masks to include a first plurality of control entries, wherein at least one of said first plurality of control entries is to set a first data element position in said first set of shuffled data to zero; shuffle a second packed data from a second source based on a second set of masks to produce a second set of shuffled data, said second set of masks include a second plurality of control entries, wherein at least one of said second plurality of control entries is to set to zero at least one data element position in said second set of shuffled data, wherein said second data element position is different than said first data element position; and merge said first set of shuffled data and said second set of shuffled data together to form a packed data resultant.
- 40. The system of claim 39 wherein said instructions are to further cause said execution unit to:
load said first set of packed data; load said second set of packed data; load a first set of masks for shuffling said first set of packed data; and load a second set of masks for shuffling said second set of packed data.
- 41. The system of claim 40 wherein said first set of masks are to flush to zero at least one data element position not flushed to zero by said second set of masks and said second set of masks is to flush to zero at least one data element position not flushed to zero by said first set of masks.
- 42. The system of claim 39 wherein each mask is comprised of:
a flush to zero field, said flush to zero field to indicate whether a data element position associated with this mask is to be filled with a zero value; a selection field, said selection field to indicate which table data element to shuffle data from; and a source select field, said source select field to indicate which of said plurality of table sections to shuffle data from for this mask.
- 43. The system of claim 42 wherein each of said shuffle comprises:
for each mask, shuffling data from a data element designated by said mask to an associated resultant data element position if its flush to zero field is not set and placing a zero into said associated resultant data element position if its flush to zero field is not set.
- 44. An article comprising a machine readable medium that stores a program, said program being executable by a machine to perform a method comprising:
loading first data for a first plane and second data for a second plane; loading a first control mask having a first shuffle pattern and a second control mask having a second shuffle pattern; selecting one of said control masks to operate on said first plane data and another of said control masks to operate on said second plane data, wherein said one control mask is different from said another control mask; shuffling a first portion of said first plane data in accordance with said one control mask to generate a first set of shuffle data and a second portion of said second plane data in accordance with said another control mask to generate a second set of shuffled data; and merging said first set of shuffled data together with said second set of shuffled data to form a packed data resultant having data from both said first plane and said second plane.
- 45. The article of claim 44 wherein said program further comprises:
determining whether more data in said first plane and said second plane is available for shuffling and merging; and if said determination indicates more data is available for shuffling and merging, shifting out said first portion of said first plane data and shifting out said second portion of said plane data, and performing said operations of shuffling and merging on a third portion of said first plane with a different control mask than said one control mask and on a fourth portion of said second plane with a different control mask than said another control mask.
- 46. The article of claim 45 wherein said first plane is comprised of a first plurality of packed data elements and said second plane is comprised of a second plurality of packed data elements.
- 47. The article of claim 46 wherein:
said first control mask is comprised of a first set of masks to include a first plurality of control elements, wherein at least one of said first plurality of control elements is to set a first data element position in said first set of shuffled data to zero; and said second control mask is comprised of a second set of masks to include a second plurality of control elements, wherein at least one of said second plurality of control elements is to set a second data element position in said second set of shuffled data to zero.
- 48. The article of claim 47 wherein each control element is comprised of:
a flush to zero field, said flush to zero field to indicate whether a data element position associated with this control element is to be filled with a zero value; a selection field, said selection field to indicate which table data element to shuffle data from; and a source select field, said source select field to indicate which of said plurality of table sections to shuffle data from for this control element.
- 49. The article of claim 48 wherein said at least one of said first plurality of control elements of said first control mask is to flush to zero a data element position not flushed to zero by said second set of masks and said at least one of said second plurality of control elements of said second control mask is to flush to zero a data element position not flushed to zero by said first set of masks.
- 50. The article of claim 46 wherein said first control mask and said second control mask are each comprised of a plurality of control elements to control the filling of associated data element positions during shuffle operations.
- 51. The article of claim 50 wherein for each control element, data from a data element designated by said control element is to be shuffled to an associated resultant data element position if its flush to zero field is not set and placing a zero into said associated resultant data element position if its flush to zero field is not set.
Parent Case Info
[0001] This patent application is a Continuation In Part of U.S. patent application Ser. No. 09/952,891, entitled “An Apparatus And Method For Efficient Filtering And Convolution Of Content Data”, filed Oct. 29, 2001.
[0002] The patent application is related to the following: co-pending U.S. patent application Ser. No. ______, entitled “Method And Apparatus For Parallel Table Lookup Using SIMD Instructions” filed on Jun. 30, 2003; and co-pending U.S. patent application Ser. No. ______, entitled “Method And Apparatus For Shuffling Data” filed on Jun. 30, 2003.
Continuation in Parts (1)
|
Number |
Date |
Country |
Parent |
09952891 |
Oct 2001 |
US |
Child |
10612061 |
Jun 2003 |
US |