# US 2008/0270508 A1 · Detection of potential need to use a larger data format in performing floating point operations

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

- Number: US 2008/0270508 A1
- Document ID: US20080270508A1
- Status: Published application
- Kind: A1
- Application number: 11/740,165
- Filed: 2007-04-25
- Published: 2008-10-30
- Earliest claimed: 2007-04-25
- Assignees: International Business Machines Corporation
- Inventors: Shawn D. Lundvall; Ronald M. Smith; Phil C. Yeh
- Web page: https://patentgrep.com/patent/US20080270508A1

## CPC

- G06F 9/45504: {Abstract machines for program code execution, e.g. Java virtual machine [JVM], interpreters or emulators}
- G06F 7/491: Computations with decimal numbers {radix 12 or 20. (G06F7/4824 takes precedence)}
- G06F 9/30003: {Arrangements for executing specific machine instructions}
- G06F 9/30014: {with variable precision}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30038: {using a mask}
- G06F 9/30105: {Register structure}
- G06F 9/3861: {Recovery, e.g. branch miss-prediction, exception handling (error detection or correction G06F11/00)}
- G06F 2207/4911: Decimal floating-point representation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Detection of whether a result of a floating point operation is safe. Characteristics of the result are examined to determine whether the result is safe or potentially unsafe, as defined by the user. An instruction is provided to facilitate detection of safe or potentially unsafe results.

## Claims

### Claim 1

An article of manufacture comprising:
at least one computer usable medium having computer readable program code logic to execute a machine instruction in a central processing unit, said computer readable program code logic when executing performing the following:
obtaining a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising an opcode, a register field, an index field, a base field and a displacement value; and
performing a function defined by the opcode of the machine instruction of determining whether a first operand included in a register specified by the register field is a safe decimal floating point number or is a potentially unsafe decimal floating point number, said function comprising:
determining a data group and a sign for the first operand;
determining a plurality of second operand bits using the index field, base field and displacement value of the machine instruction, each bit of the plurality of second operand bits corresponding to a data group and sign combination;
selecting a bit of the plurality of second operand bits based on the data group and sign determined for the first operand;
determining a value of the selected bit; and
setting a condition code based on the value of the selected bit, the condition code indicating whether a result of a floating point operation is safe or potentially unsafe.

### Claim 2 (depends on 1)

The article of manufacture of claim 1, wherein the register specified by the register field comprises a floating point register.

### Claim 3 (depends on 1)

The article of manufacture of claim 1, wherein the determining the plurality of second operand bits comprises adding the contents of a register specified by the index field, the contents of a register specified by the base field, and the displacement value to obtain the plurality of second operand bits.

### Claim 4 (depends on 1)

The article of manufacture of claim 1, wherein the result of adding the contents of a register specified by the index field, the contents of a register specified by the base field, and the displacement value comprises 64 bits, and wherein bits 0-51 are ignored, the plurality of second operand bits comprise bits 52-63, and wherein each bit of bits 52-63 corresponds to a particular data group and sign combination.

### Claim 5 (depends on 4)

The article of manufacture of claim 4, wherein:
bit 52 corresponds to a data group having the characteristics of finite number, zero significand, and nonextreme exponent, and to a sign of positive;
bit 53 corresponds to a data group having the characteristics of finite number, zero significand, and nonextreme exponent, and to a sign of negative;
bit 54 corresponds to a data group having the characteristics of finite number, zero significand, and extreme exponent, and to a sign of positive;
bit 55 corresponds to a data group having the characteristics of finite number, zero significand, and extreme exponent, and to a sign of negative;
bit 56 corresponds to a data group having the characteristics of finite number, nonzero significand, and extreme exponent, and to a sign of positive;
bit 57 corresponds to a data group having the characteristics of finite number, nonzero significand, and extreme exponent, and to a sign of negative;
bit 58 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent, and zero leftmost digit in the significand, and to a sign of positive;
bit 59 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent, and zero leftmost digit in the significand, and to a sign of negative;
bit 60 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent and nonzero leftmost digit in the significand, and to a sign of positive;
bit 61 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent and nonzero leftmost digit in the significand, and to a sign of negative;
bit 62 corresponds to a data group having the characteristics of infinity or not a number, and to a sign of positive; and
bit 63 corresponds to a data group having the characteristics of infinity or not a number, and to a sign of negative.

### Claim 6 (depends on 1)

The article of manufacture of claim 1, wherein the condition code indicates whether characteristics of a value specified in the first operand match one or more selected conditions.

### Claim 7 (depends on 6)

The article of manufacture of claim 6, wherein a match indicates the value is safe or potentially unsafe depending on the selected conditions.

### Claim 8 (depends on 1)

The article of manufacture of claim 1, wherein the machine instruction comprises 48 bits, and wherein the opcode comprises bit 0-7 and 40-47, the register field comprises bits 8-11, the index field comprises bits 12-15, the base field comprises bits 16-19, and the displacement field comprises bits 20-31.

### Claim 9 (depends on 1)

The article of manufacture of claim 1, wherein the computer architecture is the IBM® z/Architecture, and wherein the machine instruction has an RXE format according to the IBM® z/Architecture.

### Claim 10 (depends on 1)

The article of manufacture of claim 1, wherein safe indicates that use of a larger data format would not produce a different value or quantum.

### Claim 11 (depends on 1)

The article of manufacture of claim 1, wherein the computer readable program code logic is emulator code.

### Claim 12

A method for executing a machine instruction in a central processing unit, said method comprising:
obtaining a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising an opcode, a register field, an index field, a base field and a displacement value; and
performing a function defined by the opcode of the machine instruction of determining whether a first operand included in a register specified by the register field is a safe decimal floating point number or is a potentially unsafe decimal floating point number, said function comprising:
determining a data group and a sign for the first operand;
determining a plurality of second operand bits using the index field, base field and displacement value of the machine instruction, each bit of the plurality of second operand bits corresponding to a data group and sign combination;
selecting a bit of the plurality of second operand bits based on the data group and sign determined for the first operand;
determining a value of the selected bit; and
setting a condition code based on the value of the selected bit, the condition code indicating whether a result of a floating point operation is safe or potentially unsafe.

### Claim 13 (depends on 12)

The method of claim 12, wherein the register specified by the register field comprises a floating point register.

### Claim 14 (depends on 12)

The method of claim 12, wherein the result of adding the contents of a register specified by the index field, the contents of a register specified by the base field, and the displacement value comprises 64 bits, and wherein bits 0-51 are ignored, the plurality of second operand bits comprise bits 52-63, and wherein each bit of bits 52-63 corresponds to a particular data group and sign combination.

### Claim 15 (depends on 14)

The method of claim 14, wherein:
bit 52 corresponds to a data group having the characteristics of finite number, zero significand, and nonextreme exponent, and to a sign of positive;
bit 53 corresponds to a data group having the characteristics of finite number, zero significand, and nonextreme exponent, and to a sign of negative;
bit 54 corresponds to a data group having the characteristics of finite number, zero significand, and extreme exponent, and to a sign of positive;
bit 55 corresponds to a data group having the characteristics of finite number, zero significand, and extreme exponent, and to a sign of negative;
bit 56 corresponds to a data group having the characteristics of finite number, nonzero significand, and extreme exponent, and to a sign of positive;
bit 57 corresponds to a data group having the characteristics of finite number, nonzero significand, and extreme exponent, and to a sign of negative;
bit 58 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent, and zero leftmost digit in the significand, and to a sign of positive;
bit 59 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent, and zero leftmost digit in the significand, and to a sign of negative;
bit 60 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent and nonzero leftmost digit in the significand, and to a sign of positive;
bit 61 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent and nonzero leftmost digit in the significand, and to a sign of negative;
bit 62 corresponds to a data group having the characteristics of infinity or not a number, and to a sign of positive; and
bit 63 corresponds to a data group having the characteristics of infinity or not a number, and to a sign of negative.

### Claim 16 (depends on 12)

The method of claim 12, wherein the condition code indicates whether characteristics of a value specified in the first operand match one or more selected conditions, and wherein a match indicates the value is safe or potentially unsafe depending on the selected conditions.

### Claim 17 (depends on 12)

The method of claim 12, wherein the machine instruction comprises 48 bits, and wherein the opcode comprises bit 0-7 and 40-47, the register field comprises bits 8-11, the index field comprises bits 12-15, the base field comprises bits 16-19, and the displacement field comprises bits 20-31.

### Claim 18 (depends on 12)

The method of claim 12, wherein the computer architecture is the IBM® z/Architecture, and wherein the machine instruction has an RXE format according to the IBM® z/Architecture.

### Claim 19 (depends on 12)

The method of claim 12, wherein safe indicates that use of a larger data format would not produce a different value or quantum.

### Claim 20 (depends on 12)

The method of claim 12, wherein the machine instruction is in a format of one architecture and is emulated to execute on a processor having another architecture, said another architecture being different from said one architecture.

### Claim 21

A system for executing a machine instruction in a central processing unit, said system comprising:
a memory;
a processor to obtain a machine instruction for execution from the memory, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising an opcode, a register field, an index field, a base field and a displacement value; and
the processor to perform a function defined by the opcode of the machine instruction of determining whether a first operand included in a register specified by the register field is a safe decimal floating point number or is a potentially unsafe decimal floating point number, said function comprising:
determining a data group and a sign for the first operand;
determining a plurality of second operand bits using the index field, base field and displacement value of the machine instruction, each bit of the plurality of second operand bits corresponding to a data group and sign combination;
selecting a bit of the plurality of second operand bits based on the data group and sign determined for the first operand;
determining a value of the selected bit; and
setting a condition code based on the value of the selected bit, the condition code indicating whether a result of a floating point operation is safe or potentially unsafe.

### Claim 22 (depends on 21)

The system of claim 21, wherein the result of adding the contents of a register specified by the index field, the contents of a register specified by the base field, and the displacement value comprises 64 bits, and wherein bits 0-51 are ignored, the plurality of second operand bits comprise bits 52-63, and wherein each bit of bits 52-63 corresponds to a particular data group and sign combination.

### Claim 23 (depends on 22)

The system of claim 22, wherein:
bit 52 corresponds to a data group having the characteristics of finite number, zero significand, and nonextreme exponent, and to a sign of positive;
bit 53 corresponds to a data group having the characteristics of finite number, zero significand, and nonextreme exponent, and to a sign of negative;
bit 54 corresponds to a data group having the characteristics of finite number, zero significand, and extreme exponent, and to a sign of positive;
bit 55 corresponds to a data group having the characteristics of finite number, zero significand, and extreme exponent, and to a sign of negative;
bit 56 corresponds to a data group having the characteristics of finite number, nonzero significand, and extreme exponent, and to a sign of positive;
bit 57 corresponds to a data group having the characteristics of finite number, nonzero significand, and extreme exponent, and to a sign of negative;
bit 58 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent, and zero leftmost digit in the significand, and to a sign of positive;
bit 59 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent, and zero leftmost digit in the significand, and to a sign of negative;
bit 60 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent and nonzero leftmost digit in the significand, and to a sign of positive;
bit 61 corresponds to a data group having the characteristics of finite number, nonzero significand, nonextreme exponent and nonzero leftmost digit in the significand, and to a sign of negative;
bit 62 corresponds to a data group having the characteristics of infinity or not a number, and to a sign of positive; and
bit 63 corresponds to a data group having the characteristics of infinity or not a number, and to a sign of negative.

### Claim 24 (depends on 21)

The system of claim 21, wherein safe indicates that use of a larger data format would not produce a different value or quantum.

### Claim 25 (depends on 24)

The system of claim 24, wherein the machine instruction is in a format of one architecture and is emulated to execute on a processor having another architecture, said another architecture being different from said one architecture.
