# US 2018/0018172 A1 · Hardware apparatus and methods for converting encoding formats

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

- Number: US 2018/0018172 A1
- Document ID: US20180018172A1
- Status: Published application
- Kind: A1
- Application number: 15/301,351
- Filed: 2015-12-29
- Published: 2018-01-18
- Earliest claimed: 2015-12-29
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: YEVGENY Y. ROUBAN; DANIIL Y. SOKOLOV
- Web page: https://patentgrep.com/patent/US20180018172A1

## CPC

- G06F 9/3016: {Decoding the operand specifier, e.g. specifier format}
- G06F 9/30025: {Format conversion instructions, e.g. Floating-Point to Integer, decimal conversion}
- G06F 9/30109: {having multiple operands in a single register}
- G06F 9/3895: {for complex operations, e.g. multidimensional or interleaved address generators, macros}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and apparatuses relating to converting encoding formats are described. In one embodiment, a hardware processor includes a decode circuit to decode an instruction comprising a state operand, a source vector operand, a destination vector operand, and a control operand, and an execution circuit to execute the instruction to convert elements from the source vector operand in a first encoding format to a second encoding format, store the elements in the second encoding format in the destination vector operand, store a total length of the elements in the second encoding format in the state operand, and set a stream completion indication in the control operand when the elements from the source vector operand are a last elements in a data stream.

## Claims

### Claim at position 1

-25. (canceled)

### Claim 26

A hardware processor comprising:
a decode circuit to decode an instruction comprising a state operand, a source vector operand, a destination vector operand, and a control operand; and
an execution circuit to execute the instruction to:
convert elements from the source vector operand in a first encoding format to a second encoding format,
store the elements in the second encoding format in the destination vector operand,
store a total length of the elements in the second encoding format in the state operand, and
set a stream completion indication in the control operand when the elements from the source vector operand are a last elements in a data stream.

### Claim 27 (depends on 26)

The hardware processor of claim 26, wherein the first encoding format is one of UTF-8 character encoding and UTF-16 character encoding and the second encoding format is the other of UTF-8 character encoding and UTF-16 character encoding.

### Claim 28 (depends on 26)

The hardware processor of claim 26, wherein the execution circuit is to execute the instruction to:
detect one or more elements of a multiple element sequence from the source vector operand, wherein the multiple element sequence does not end within the source vector operand, and
not convert the one or more elements of the multiple element sequence from the source vector operand in the first encoding format to the second encoding format.

### Claim 29 (depends on 28)

The hardware processor of claim 28, wherein the execution circuit is to execute the instruction to store the one or more elements of the multiple element sequence from the source vector operand in the state operand.

### Claim 30 (depends on 26)

The hardware processor of claim 26, wherein the execution circuit is to execute the instruction to read an endian format indicator of the control operand to determine when the elements in the second encoding format are to be stored in the destination vector operand in one of a big-endian format and a little-endian format.

### Claim 31 (depends on 26)

The hardware processor of claim 26, wherein the execution circuit is to execute the instruction to read a validation indicator of the control operand to determine when to cause a validation operation to be performed on the elements in the first encoding format and the second encoding format.

### Claim 32 (depends on 26)

The hardware processor of claim 26, wherein the execution circuit is to execute the instruction to read a stateful indicator of the control operand to determine when to convert an incomplete sequence of the elements from the source vector operand in the first encoding format to the second encoding format.

### Claim 33 (depends on 26)

The hardware processor of claim 26, wherein the control operand comprises an address of a register to store the state operand.

### Claim 34

A method comprising:
decoding an instruction comprising a state operand, a source vector operand, a destination vector operand, and a control operand; and
executing the instruction to:
convert elements from the source vector operand in a first encoding format to a second encoding format,
store the elements in the second encoding format in the destination vector operand,
store a total length of the elements in the second encoding format in the state operand, and
set a stream completion indication in the control operand when the elements from the source vector operand are a last elements in a data stream.

### Claim 35 (depends on 34)

The method of claim 34, wherein the first encoding format is one of UTF-8 character encoding and UTF-16 character encoding and the second encoding format is the other of UTF-8 character encoding and UTF-16 character encoding.

### Claim 36 (depends on 34)

The method of claim 34, further comprising:
detecting one or more elements of a multiple element sequence from the source vector operand, wherein the multiple element sequence does not end within the source vector operand, and
not converting the one or more elements of the multiple element sequence from the source vector operand in the first encoding format to the second encoding format.

### Claim 37 (depends on 36)

The method of claim 36, further comprising storing the one or more elements of the multiple element sequence from the source vector operand in the state operand.

### Claim 38 (depends on 34)

The method of claim 34, further comprising reading an endian format indicator of the control operand to determine when the elements in the second encoding format are to be stored in the destination vector operand in one of a big-endian format and a little-endian format.

### Claim 39 (depends on 34)

The method of claim 34, further comprising reading a validation indicator of the control operand to determine when to cause a validation operation to be performed on the elements in the first encoding format and the second encoding format.

### Claim 40 (depends on 34)

The method of claim 34, further comprising reading a stateful indicator of the control operand to determine when to convert an incomplete sequence of the elements from the source vector operand in the first encoding format to the second encoding format.

### Claim 41 (depends on 34)

The method of claim 34, wherein the control operand comprises an address of a register to store the state operand.

### Claim 42

A non-transitory machine readable medium that stores code that when executed by a machine causes the machine to perform a method comprising:
decoding an instruction comprising a state operand, a source vector operand, a destination vector operand, and a control operand; and
executing the instruction to:
convert elements from the source vector operand in a first encoding format to a second encoding format,
store the elements in the second encoding format in the destination vector operand,
store a total length of the elements in the second encoding format in the state operand, and
set a stream completion indication in the control operand when the elements from the source vector operand are a last elements in a data stream.

### Claim 43 (depends on 42)

The non-transitory machine readable medium of claim 42, wherein the first encoding format is one of UTF-8 character encoding and UTF-16 character encoding and the second encoding format is the other of UTF-8 character encoding and UTF-16 character encoding.

### Claim 44 (depends on 42)

The non-transitory machine readable medium of claim 42, wherein the method comprises:
detecting one or more elements of a multiple element sequence from the source vector operand, wherein the multiple element sequence does not end within the source vector operand, and
not converting the one or more elements of the multiple element sequence from the source vector operand in the first encoding format to the second encoding format.

### Claim 45 (depends on 44)

The non-transitory machine readable medium of claim 44, wherein the method comprises:
storing the one or more elements of the multiple element sequence from the source vector operand in the state operand.

### Claim 46 (depends on 42)

The non-transitory machine readable medium of claim 42, wherein the method comprises:
reading an endian format indicator of the control operand to determine when the elements in the second encoding format are to be stored in the destination vector operand in one of a big-endian format and a little-endian format.

### Claim 47 (depends on 42)

The non-transitory machine readable medium of claim 42, wherein the method comprises:
reading a validation indicator of the control operand to determine when to cause a validation operation to be performed on the elements in the first encoding format and the second encoding format.

### Claim 48 (depends on 42)

The non-transitory machine readable medium of claim 42, wherein the method comprises:
reading a stateful indicator of the control operand to determine when to convert an incomplete sequence of the elements from the source vector operand in the first encoding format to the second encoding format.

### Claim 49 (depends on 42)

The non-transitory machine readable medium of claim 42, wherein the control operand comprises an address of a register to store the state operand.
