# US 2017/0293467 A1 · Apparatus and method for supporting a conversion instruction

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

- Number: US 2017/0293467 A1
- Document ID: US20170293467A1
- Status: Published application
- Kind: A1
- Application number: 15/093,947
- Filed: 2016-04-08
- Published: 2017-10-12
- Earliest claimed: 2016-04-08
- Assignees: Arm Limited
- Applicants: Arm Limited
- Inventors: David Raymond LUTZ; Neil BURGESS; Kelvin Domnic GOVEAS
- Web page: https://patentgrep.com/patent/US20170293467A1

## CPC

- G06F 5/015: {having at least two separately controlled shifting levels, e.g. using shifting matrices (G06F5/012 takes precedence)}
- G06F 7/483: Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers {(G06F7/4806, G06F7/4824, G06F7/49, G06F7/491, G06F7/544 take precedence)}
- G06F 9/30014: {with variable precision}
- G06F 9/30025: {Format conversion instructions, e.g. Floating-Point to Integer, decimal conversion}
- H03M 7/24: Conversion to or from floating-point codes
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

A data processing system 2 includes instruction decoder circuitry 12 responsive to a conversion instruction FCVTJS to convert a double precision floating point number into a 32-bit integer number. Right shifting circuitry 28 performs a right shift upon at least part of the input number and left shifting circuitry 32 performs a left shift of at least part of the input number. Selection circuitry 38 serves to select one of the right shifted number and the left shifted number as a selected shifted number which forms at least part of the output number which is generated.

## Claims

### Claim 1

Apparatus for processing data comprising:
processing circuitry to perform one or more processing operations specified by program instruction; and
an instruction decoder to decode said program instructions to generate one or more control signals to control said processing circuitry to perform processing operations specified by said program instruction; wherein
said program instruction include a conversion instruction to convert an input number to an output number;
said processing circuitry comprises:
right shifting circuitry to perform a right shift upon at least part of said input number to generate a right shifted number in response to said instruction decoder decoding said conversion instruction;
left shifting circuitry to perform a left shift upon at least part of said input number to generate a left shifted number in response to said instruction decoder decoding said conversion instruction; and
selection circuitry to select one of said right shifted number and said left shifted number as a selected shifted number to form at least part of said output number.

### Claim 2 (depends on 1)

Apparatus as claimed in claim 1, wherein said input number is a floating-point number having an exponent value E and a significand value S and said output number is an N-bit integer number.

### Claim 3 (depends on 2)

Apparatus as claimed in claim 2, wherein
said right shifting circuitry is responsive to said exponent value to right shift at least part of said significand value by a right shift amount dependent upon said exponent value; and
said right shift amount shifts any bits within said significand having a same bit significance as a bit position within said integer value to a bit position within said right shifted number matching said bit position within said integer number.

### Claim 4 (depends on 3)

Apparatus as claimed in claim 3, wherein said right shifting circuitry sets to zero any bit positions within said right shifted number without bits shifted thereto from said significand value by said right shift amount.

### Claim 5 (depends on 3)

Apparatus as claimed in claim 3, wherein said right shift amount is (N−1)−E.

### Claim 6 (depends on 2)

Apparatus as claimed in claim 2, wherein
said left shifting circuitry is responsive to said exponent value to left shift at least part of said significand value by a left shift amount dependent upon said exponent value; and
said left shift amount shifts any bits within said significand having a same bit significance as a bit position within said integer value to a bit position within said left shifted number matching said bit position within said integer number.

### Claim 7 (depends on 6)

Apparatus as claimed in claim 6, wherein said left shifting circuitry sets to zero any bit positions within said left shifted number without bits shifted thereto from said significand value by said left shift amount.

### Claim 8 (depends on 6)

Apparatus as claimed in claim 6, wherein said left shift amount is E−(N−1).

### Claim 9 (depends on 2)

Apparatus as claimed in claim 2, wherein said selection circuitry selects said right shifted number as said selected shifted number when said floating point number is equal to or less than a maximum number representable as said integer number.

### Claim 10 (depends on 2)

Apparatus as claimed in claim 2, wherein said selection circuitry selects said left shifted number as said selected shifted number when said floating point number is greater than a maximum number representable as said integer number.

### Claim 11 (depends on 1)

Apparatus as claimed in claim 1, wherein said processing circuitry comprises two's-complement circuitry to perform a two's complement operation upon said selected shifted number when said input number is negative.

### Claim 12 (depends on 1)

Apparatus as claimed in claim 1, wherein said processing circuitry comprises truncation circuitry to form as said output number a least significant bit portion of said selected shifted number.

### Claim 13 (depends on 2)

Apparatus as claimed in claim 2, said processing circuitry comprises truncation circuitry to form as said output number a least significant N bits of said selected shifted number.

### Claim 14

Apparatus for processing data comprising:
processing means for performing one or more processing operations specified by program instruction; and
instruction decoding means for decoding said program instructions to generate one or more control signals to control said processing means to perform processing operations specified by said program instruction; wherein
said program instruction include a conversion instruction to convert an input number to an output number;
said processing means comprises:
right shifting means for performing a right shift upon at least part of said input number to generate a right shifted number in response to said instruction decoding means decoding said conversion instruction;
left shifting circuitry to perform a left shift upon at least part of said input number to generate a left shifted number in response to said instruction decoding means decoding said conversion instruction; and
selection circuitry to select one of said right shifted number and said left shifted number as a selected shifted number to form at least part of said output number.

### Claim 15

A method of processing data comprising:
performing one or more processing operations specified by program instruction; and
decoding said program instructions to generate one or more control signals to control performance of processing operations specified by said program instruction; wherein
said program instruction include a conversion instruction to convert an input number to an output number;
method comprises:
performing a right shift upon at least part of said input number to generate a right shifted number in response to decoding of said conversion instruction;
performing a left shift upon at least part of said input number to generate a left shifted number in response to decoding of said conversion instruction; and
selecting one of said right shifted number and said left shifted number as a selected shifted number to form at least part of said output number.
