Method and system for performing permutations with bit permutation instructions
First Claim
1. A method of performing an arbitrary permutation in a programmable processor comprising the steps of:
- a. defining bit positions in a source sequence of bits to be permuted in a source register for a group of bits in a destination register;
b. determining a permutation instruction with said bit positions to assemble bits from said source sequence of bits;
c. performing said permutation instruction for inserting said assembled bits into a destination register as determined by said bit positions; and
d. repeating steps a. through c. for groups of bits in said destination register, wherein after a final permutation instruction a desired permutation of said source register is determined and said determined permutation instructions form a permutation instruction sequence.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention provides permutation instructions which can be used in software executed in a programmable processor for solving permutation problems in cryptography, multimedia and other applications. PPERM and PPERM3R instructions are defined to perform permutations by a sequence of instructions with each sequence specifying the position in the source for each bit in the destination. In the PPERM instruction bits in the destination register that change are updated and bits in the destination register that do not change are set to zero. In the PPERM3R instruction bits in the destination register that change are updated and bits in the destination register that do not change are copied from intermediate result of previous PPERM3R instructions. Both PPERM and PPERM3R instruction can individually do permutation with bit repetition. Both PPERM and PPERM3R instruction can individually do permutation of bits stored in more than one register. In an alternate embodiment, a GRP instruction is defined to perform permutations. The GRP instruction divides the initial sequence in the source register into two groups depending on control bits. The first group is combined with the second group to form an intermediate sequence toward the desired final permutation. The total number of GRP instructions for a bit level permutation of n bits is not greater than lgn. The GRP instruction can be used to permute k-bit subwords packed into an n bits word, where k can be 1, 2, . . . , or n bits, and k*r=n. At most lgr permutation instructions are used in the permutation instruction sequence, where r is the number of k-bit subwords to be permuted. The GRP instruction can also be used to permute 2n bits stored in two n-bit registers. The total number of instructions for bit permutation of 2n bits is 2lgn+4, and two of those instructions are SHIFT PAIR instruction.
50 Citations
77 Claims
-
1. A method of performing an arbitrary permutation in a programmable processor comprising the steps of:
-
a. defining bit positions in a source sequence of bits to be permuted in a source register for a group of bits in a destination register;
b. determining a permutation instruction with said bit positions to assemble bits from said source sequence of bits;
c. performing said permutation instruction for inserting said assembled bits into a destination register as determined by said bit positions; and
d. repeating steps a. through c. for groups of bits in said destination register, wherein after a final permutation instruction a desired permutation of said source register is determined and said determined permutation instructions form a permutation instruction sequence. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method of performing an arbitrary permutation of a source sequence of bits into a final arrangement of bits in a programmable processor comprising the steps of:
-
a. determining the final arrangement of bits of an arbitrary permutation;
b. defining an intermediate sequence of bits that said final arrangement of bits is transformed from;
c. determining a permutation instruction for transforming said intermediate sequence of bits into said final arrangement of bits by dividing said -intermediate sequence into a first group and a second group and combining said first group and said second group; and
d. repeating steps b. and c. using said determined intermediate sequence of bits from step b. as said final arrangement of bits in step c. until an intermediate sequence of bits is obtained that is the same as the source sequence of bits, wherein the determined permutation instructions, in reversed order, form a permutation instruction sequence. - View Dependent Claims (9, 10, 11, 12, 13, 15, 16, 18, 19)
-
-
14. A method of performing an arbitrary permutation at a source sequence of bits, called the initial arrangement, in a programmable processor comprising the steps of:
-
a. determining the final arrangement of a sequence of bits to be permuted;
b. determining a number of monotonically increasing sequences (MIS) in said arrangement;
c. determining a first group of MISes and a second group of MISes;
d. combining each element of said first group sequentially with each element of said second group to form a merged group;
e. sorting said merged group in increasing numerical order for determining an intermediate arrangement from said sorted merged group;
f. determining control bits for said intermediate permutation instruction;
if said intermediate arrangement is a single monotonically increasing sequence said intermediate arrangement is the initial arrangement, wherein said determined intermediate permutation instructions form a permutation instruction sequence; and
if said intermediate arrangement is not a single monotonically increasing sequence repeating steps b through f.
-
-
17. A method of performing an arbitrary permutation of a source sequence of bits in a programmable processor said source sequence of bits is packed into a plurality of source registers comprising the steps of:
-
a. dividing bits of a first of said source registers to be placed in a first destination register into a first group and bits of said first of said source registers to be placed in a second destination register into a second group with a first GRP permutation instruction;
b. dividing bits of a second of said source registers to be placed in said first destination register into a first group and bits of said second of said source registers to be placed in a second destination register into a second group with a second GRP permutation instruction;
c. placing bits of said first group of said first of said source registers and said bits of said first group of said second of said source registers into said first destination register;
d. placing bits of said second group of said first of said source registers and said second group of said second of said registers into said second destination register;
e. defining a sequence of bits of said first destination register as a first source sequence of bits and a sequence of bits of said second destination register as a second source sequence of bits;
f. defining an intermediate sequence of bits that each of said first source sequence of bits and said second source sequence of bits is transformed;
g. determining a GRP permutation instruction for transforming said first source sequence of bits and said second source sequence of bits into respective said intermediate sequence of bits; and
h. repeating steps f. and g. using said determined intermediate sequence of bits from step g. as said source sequence of bits in step f. until a respective desired sequence of bits is obtained for said first source sequence of bits and said second source sequence of bits, wherein the determined permutation instructions form a permutation instruction sequence.
-
-
20. A system of performing an arbitrary permutation in a programmable processor comprising:
-
means for defining bit positions in a source sequence of bits to be permuted in a source register for a group of bits in a destination register;
means for determining permutation instructions with said bit positions to assemble bits from said source sequence of bits into one or more intermediate sequencesof bits until a desired sequence is obtained;
means for performing said determined permutation instructions for inserting said assembled bits into a destination register as determined by said bit positions for each of said one or more intermediate sequences of bits or said desired sequence;
wherein after a final permutation instruction a desired permutation of said source register is determined and said determined permutation instructions form a permutation instruction sequence. - View Dependent Claims (21, 22, 23, 24, 25, 27, 28, 29, 30, 31)
-
-
26. A system of performing an arbitrary permutation at a source sequence of bits in a programmable processor comprising the steps of:
-
means for determining an initial and final arrangement of a source sequence of bits;
means for defining one or more intermediate sequence of bits that said initial arrangement of said source sequence of bits is transformed into until a desired sequence is obtained;
means for determining permutation instructions for transforming said source sequence of bits into for each of said one or more intermediate sequence of bits or said desired sequence by dividing said arrangement into a first group and a second group and combining said first group and said second group;
wherein the determined permutation instructions form a permutation instruction sequence.
-
-
32. A system of performing an arbitrary permutation at a source sequence of bits in a programmable processor comprising:
-
means for determining an initial and final arrangement of a sequence of bits to be permuted;
means for determining a number of monotonically increasing sequences (MIS) in said arrangement;
means for determining a first group of MISes and a second group of MISes;
means for combining each element of said first group sequentially with each element of said second group to form a merged group;
means for sorting said merged group in increasing numerical order for determining an intermediate arrangement from said sorted merged group;
means for determining control bits for said intermediate permutation instruction;
if said intermediate arrangement is a single monotonically increasing sequence said intermediate arrangement is an initial arrangement, wherein said determined intermediate permutation instructions form a permutation instruction sequence; and
if said intermediate arrangement is not a single monotonically increasing sequence determining a second arrangement for said intermediate arrangement and using said second arrangement as said means for determining a permutation instruction. - View Dependent Claims (33, 34, 36, 37, 39, 40, 41)
-
-
35. A system of performing an arbitrary permutation of a source sequence of bits in a programmable processor said source sequence of bits is packed into a plurality of source registers comprising the steps of:
-
means for dividing bits of a first of said source registers to be placed in a first destination register into a first group and bits of said first of said source registers to be placed in a second destination register into a second group with a first GRP permutation instruction;
means for dividing bits of a second of said source registers to be placed in said first destination register into a second group and bits of said second of said source registers to be placed in a second destination register into a first group with a second GRP permutation instruction;
means for placing bits of said first group of said first of said source registers and said bits of said second group of said second of said source registers into said first destination register;
means for placing bits of said second group of said first of said source registers and said first group of said second of said registers into said second destination register;
means for defining a sequence of bits of said first destination register as a first source sequence of bits and a sequence of bits of said second destination register as a second source sequence of bits;
means for defining an intermediate sequence of bits that each of said first source sequence of bits and said second source sequence of bits is transformed into;
means for determining a GRP permutation instruction for transforming said first source sequence of bits and said second source sequence of bits into one or more respective said intermediate sequence of bits until a respective desired sequence of bits is obtained for said first source sequence of bits and said second source sequence of bits, wherein the determined permutation instructions form a permutation instruction sequence.
-
-
38. A computer implemented method for performing an arbitrary permutation of a sequence of bits comprising the steps of:
-
inputting a source sequence of bits into a source register;
defining bit positions in said source sequence of bits to be permuted in said source register for a group of bits in a destination register;
in response to a PPERM instruction inserting bits from said source sequence into said destination register as determined by said bit positions.
-
-
42. A computer implemented method for performing an arbitrary permutation of a sequence of bits comprising the steps of:
-
inputting a source sequence of bits into a source register;
defining bit positions in said source sequence of bits to be permuted in said source register for a group of bits in a destination register;
in response to a PPERM3R instruction inserting bits from said source sequence destination register as determined by said bit positions. - View Dependent Claims (43, 44, 45, 47, 49)
-
-
46. A computer system for performing an arbitrary permutation comprising:
-
a source register;
a configuration register;
a destination register;
in response to a PPERM instruction placing bits assembled from a sequence of bits from said source register to a position in a sequence of bits in said destination register based on a configuration of bits of said configuration register.
-
-
48. A computer readable medium having stored thereon data representing a sequence of permutation instructions, the sequence of permutation instructions which when executed by a processor, cause the processor to permute a source sequence of subwords into one or more intermediate sequences of subwords using a PPERM instruction by placing bits assembled from a sequence of bits from said source register to a position in a sequence of bits in said destination register based on a configuration of bits of said configuration register.
- 50. A cryptographic system, having stored thereon data representing a sequence of permutation instructions, the sequence of permutation instructions which when executed by a processor, cause the processor to permute a source sequence of subwords into one or more intermediate sequences of subwords using a PPERM instruction by placing bits assembled from a sequence of bits from said source register to a position in a sequence of bits in said destination register based on a configuration of bits of said configuration register.
-
52. A computer system for performing an arbitrary permutation comprising:
-
a source register;
a configuration register;
a destination register;
in response to a PPERM3R instruction placing bits assembled from a sequence of bits from said source register to a position in a sequence of bits in said destination register based on a configuration of bits of said configuration register. - View Dependent Claims (53)
-
- 54. A computer readable medium having stored thereon data representing a sequence of permutation instructions, the sequence of permutation instructions which when executed by a processor, cause the processor to permute a source sequence of subwords into one or more intermediate sequences of subwords using a PPERM3R instruction by placing bits assembled from a sequence of bits from said source register to a position in a sequence of bits in said destination register based on a configuration of bits of said configuration register.
-
56. A cryptographic system, having stored thereon data representing a sequence of permutation instructions, the sequence of permutation instructions which when executed by a processor, cause the processor to permute a source sequence of subwords into one or more intermediate sequences of subwords using a PPERM3R instruction by placing bits assembled from a sequence of bits from said source register to a position in a sequence of bits in said destination register based on a configuration of bits of said configuration register.
-
58. A computer system for performing an arbitrary permutation comprising:
-
a source register;
a configuration register;
a destination register;
in response to a GRP instruction dividing an arrangement of a source sequence of bits into a first group and a second group and combining said first group and said second group based on control bits of a configuration register.
-
- 60. A computer readable medium having stored thereon data representing a sequence of permutation instructions, the sequence of permutation instructions which when executed by a processor, cause the processor to permute a source sequence of subwords into one or more intermediate sequences of subwords using a GRP instruction by dividing an arrangement of a source sequence of bits into a first group and a second group and combining said first group and said second group based on control bits of a configuration register.
- 62. A cryptographic system, having stored thereon data representing a sequence of permutation instructions, the sequence of permutation instructions which when executed by a processor, cause the processor to permute a source sequence of subwords into one or more intermediate sequences of subwords using a GRP instruction by dividing an arrangement of a source sequence of bits into a first group and a second group and combining said first group and said second group based on control bits of a configuration register.
-
64. A circuit for implementing a permutation instruction comprising:
-
a first matrix of a plurality of operation units, each of said operation units comprising a first input connected to a second input, a first output and a second output and a control input, said control input controls a connection between said first input and said second input to said first output or said second output for each of said basic units; and
a second matrix comprising an inversion of said first matrix;
said first matrix being selectively connected to said second matrix. - View Dependent Claims (65)
-
-
66. A method of performing an arbitrary permutation in a programmable processor comprising the steps of:
-
a. defining bit positions in a source sequence of bits to be permuted in a source register for a group of bits in a destination register, said source sequence being stored in a plurality of source registers;
b. determining a permutation instruction with said bit positions to assemble bits from said source sequence of bits;
c. performing said permutation instruction for inserting said assembled bits into a destination register as determined by said bit positions; and
d. repeating steps a. through c. for groups of bits in said destination register, wherein after a final permutation instruction a desired permutation of said source register is determined and said determined permutation instructions form a permutation instruction sequence. - View Dependent Claims (67, 68, 69, 70, 71, 72, 73, 74, 75)
-
-
76. A method of performing an arbitrary permutation in a programmable processor comprising the steps of:
-
a. defining bit positions in a source sequence of bits to be permuted in a source register for a group of bits in a destination register;
b. determining a permutation instruction with said bit positions to assemble bits from said source sequence of bits;
c. performing said permutation instruction for inserting said assembled bits into a destination register as determined by said bit positions; and
d. repeating steps a. through c. for groups of bits in said destination register, wherein after a final permutation instruction a desired permutation of said source register is determined and said determined permutation instructions form a permutation instruction sequence and said permutation has bit repetitions.
-
-
77. A method of performing an arbitrary permutation in a programmable processor comprising the steps of:
-
a. defining bit positions in a source sequence of bits to be permuted in a source register for a group of bits in a destination register;
b. determining a permutation instruction with said bit positions to assemble bits from said source sequence of bits;
c. performing said permutation instruction for inserting said assembled bits into a destination register as determined by said bit positions;
d. repeating steps a. through c. for groups of bits in said destination register, after a final permutation instruction a desired permutation of said source register is determined and said determined permutation instructions form a permutation instruction sequence; and
e. executing at least one other instruction interspersed with said determined permutation instructions during execution of said permutation instruction sequence.
-
Specification