# US 2013/0297919 A1 · Efficient implementation of rsa using gpu/cpu architecture

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2013/0297919 A1
- Document ID: US20130297919A1
- Status: Published application
- Kind: A1
- Application number: 13/997,239
- Filed: 2011-11-30
- Published: 2013-11-07
- Earliest claimed: 2011-11-30
- Assignees: Intel Corporation
- Inventors: Xiaozhu Kang; Biju George; Ken Lueh
- Web page: https://patentgrep.com/patent/US20130297919A1

## CPC

- G06F 9/30: Arrangements for executing machine instructions, e.g. instruction decode (for executing microinstructions G06F9/22)
- G06F 8/452: {Loops}
- G06F 9/38: Concurrent instruction execution, e.g. pipeline or look ahead
- G06F 21/00: Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Various embodiments are directed to a heterogeneous processor architecture comprised of a CPU and a GPU on the same processor die. The heterogeneous processor architecture may optimize source code in a GPU compiler using vector strip mining to reduce instructions of arbitrary vector lengths into GPU supported vector lengths and loop peeling. It may be first determined that the source code is eligible for optimization if more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations. The initial vector strip mining results may be discarded and the first iteration of the inner loop body may be peeled out of the loop. The type of operands in the source code may be lowered and the peeled out inner loop body of source code may be vector strip mined again to obtain optimized source code.

## Claims

### Claim 1

A method, comprising:
compiling source code having an inner loop body using a graphics processing unit (GPU) compiler;
when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations;
peeling the first iteration of the inner loop body out of the loop;
lowering the type of operands in the source code; and
reducing instructions of arbitrary vector lengths into graphics processing unit (GPU) supported vector lengths in the peeled out inner loop body of a source code using vector strip mining to obtain optimized source code.

### Claim 2 (depends on 1)

The method of claim 1 comprising:
determining when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations results from source code having at least one operand that has two definitions, one definition comprising an initialization definition outside the inner loop body and the other definition comprising a loop carried definition;
determining when the initialization definition has an operation type of dword while the loop carried definition has an operation type of word; and
determining when the destination of the initialization definition and the loop carried definition is identical and of the type dword.

### Claim 3 (depends on 2)

The method of claim 2, comprising:
splitting 16-wide variables of the optimized source code into two 9-wide variables; and
reducing instructions of arbitrary vector lengths into GPU supported vector lengths in the optimized source code using vector strip mining to obtain further optimized source code.

### Claim 4 (depends on 1)

The method of claim 1 wherein the source code is configured to process a Rivest, Shamir, and Adleman (RSA) decryption algorithm.

### Claim 5

An apparatus, comprising:
a graphics processing unit (GPU); and
a GPU compiler operative to:
compile an inner loop body of source code;
determine when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations:
peel the first iteration of the inner loop body out of the loop; and
lower the type of operands in the source code.

### Claim 6 (depends on 5)

The apparatus of claim 5, the GPU compiler operative to reduce instructions of arbitrary vector lengths into GPU supported vector lengths in the peeled out inner loop body of a source code using vector strip mining to obtain optimized source code.

### Claim 7 (depends on 6)

The apparatus of claim 6, the GPU compiler operative to:
determine when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations results from source code having at least one operand that has two definitions, one definition comprising an initialization definition outside the inner loop body and the other definition comprising a loop carried definition;
determine when the initialization definition has an operation type of dword while the loop carried definition has an operation type of word; and
determine when the destination of the initialization definition and the loop carried definition is identical and of the type dword.

### Claim 8 (depends on 9)

The apparatus of claim 9, the GPU compiler operative to:
split 16-wide variables into two 9-wide variables; and
reduce instructions of arbitrary vector lengths into GPU supported vector lengths in the optimized source code using vector strip mining to obtain further optimized source code.

### Claim 9 (depends on 7)

The apparatus of claim 7 wherein the GPU is part of a heterogeneous processor architecture comprising a CPU and the GPU on the same processor die.

### Claim 10 (depends on 7)

The apparatus of claim 7 wherein the source code is for processing a Rivest, Shamir, and Adleman (RSA) decryption algorithm.

### Claim 11

A system, comprising:
a central processing unit (CPU) operative to execute a main Rivest, Shamir, and Adleman (RSA) decryption function set to a value of M;
a graphics processing unit (GPU) coupled to the CPU, the GPU operative to:
execute GPU functions comprised of source code configured to perform RSA calculations to compute the value for M; and
return the value for M to the main RSA decryption function executing on the CPU, and
a GPU compiler operative on the GPU to:
reduce instructions of arbitrary vector lengths into GPU supported vector lengths in an inner loop body of the source code using vector strip mining; and
determine when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations.

### Claim 12 (depends on 11)

The system of claim 11, the GPU compiler operative to:
discard the initial vector strip mining results;
peel the first iteration of the inner loop body out of the loop;
lower the type of operands in the source code; and
reduce instructions of arbitrary vector lengths into GPU supported vector lengths in the peeled out inner loop body of the source code using vector strip mining to obtain optimized source code.

### Claim 13 (depends on 12)

The system of claim 12, the GPU compiler operative to:
determine when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations results from source code having at least one operand that has two definitions, one definition comprising an initialization definition outside the inner loop body and the other definition comprising a loop carried definition;
determine when the initialization definition has an operation type of dword while the loop carried definition has an operation type of word; and
determine when the destination of the initialization definition and the loop carried definition is identical and of the type dword.

### Claim 14 (depends on 12)

The system of claim 12, the GPU compiler operative to:
split 16-wide variables into two 9-wide variables; and
reduce instructions of arbitrary vector lengths into GPU supported vector lengths in the optimized source code using vector strip mining to obtain further optimized source code.

### Claim 15 (depends on 11)

The system of claim 11 in which the CPU and the GPU are on the same processor die.

### Claim 16 (depends on 15)

The system of claim 15 in which the processor die is integrated into a mobile computing device.

### Claim 17

A method, comprising:
passing parameters of a Rivest, Shamir, and Adleman (RSA) decryption algorithm set to a value M from a central processing unit (CPU) main function operative to be executed on a CPU to a graphics processing unit (GPU) function operative to be executed on a GPU, the GPU function comprised of source code that includes an inner loop body for calculating M;
reducing instructions of arbitrary vector lengths into GPU supported vector lengths in an inner loop body of the source code using vector strip mining;
re-writing the GPU function source code when more than one machine code instruction of compiled GPU function source code under-utilizes GPU instruction bandwidth limitations;
computing a value for M on the GPU; and
returning the value for M to the CPU main function.

### Claim 18 (depends on 17)

The method of claim 17, comprising:
determining when an under-utilized machine code instruction results from source code having at least one operand that has two definitions, one definition comprising an initialization definition outside the inner loop body and the other definition comprising a loop carried definition;
determining when the initialization definition has an operation type of dword while the loop carried definition has an operation type of word; and
determining when the destination of the initialization definition and the loop carried definition is identical and of the type dword.

### Claim 19 (depends on 18)

The method of claim 18, comprising:
discarding the initial vector strip mining results;
peeling the first iteration of the inner loop body out of the loop; and
lowering the type of operands in the source code.

### Claim 20 (depends on 19)

The method of claim 19, comprising:
reducing instructions of arbitrary vector lengths into GPU supported vector lengths in the peeled out inner loop body of the source code using vector strip mining to obtain optimized source code.

### Claim 21 (depends on 20)

The method of claim 20, comprising:
splitting 16-wide variables of the source code into two 9-wide variables; and
reducing instructions of arbitrary vector lengths into GPU supported vector lengths in the optimized source code using vector strip mining to obtain further optimized source code.

### Claim 23

An article of manufacture comprising a computer-readable storage medium containing instructions that when executed cause a system to:
compile source code having an inner loop body using a graphics processing unit (GPU) compiler; and
when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations:
peel the first iteration of the inner loop body out of the loop;
lower the type of operands in the source code; and
reduce instructions of arbitrary vector lengths into graphics processing unit (GPU) supported vector lengths in the peeled out inner loop body of a source code using vector strip mining to obtain optimized source code.

### Claim 24 (depends on 23)

The article of claim 23 containing instructions that when executed cause a system to:
determine when more than one machine code instruction of compiled source code under-utilizes GPU instruction bandwidth limitations results from source code having at least one operand that has two definitions, one definition comprising an initialization definition outside the inner loop body and the other definition comprising a loop carried definition;
determine when the initialization definition has an operation type of dword while the loop carried definition has an operation type of word; and
determine when the destination of the initialization definition and the loop carried definition is identical and of the type dword.

### Claim 25 (depends on 24)

The article of claim 24 containing instructions that when executed cause a system to:
split 16-wide variables of the optimized source code into two 9-wide variables; and
reduce instructions of arbitrary vector lengths into GPU supported vector lengths in the optimized source code using vector strip mining to obtain further optimized source code.

### Claim 26 (depends on 24)

The article of claim 24 containing instructions that when executed cause a system to process a Rivest, Shamir, and Adleman (RSA) decryption algorithm.
