# US 2025/0085925 A1 · System emulation of a floating-point dot product operation

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

- Number: US 2025/0085925 A1
- Document ID: US20250085925A1
- Status: Published application
- Kind: A1
- Application number: 18/243,778
- Filed: 2023-09-08
- Published: 2025-03-13
- Earliest claimed: 2023-09-08
- Applicants: Arm Limited
- Inventors: Christopher Gareth Mead
- Web page: https://patentgrep.com/patent/US20250085925A1

## CPC

- G06F 7/5443: {Sum of products (for applications thereof, see the relevant places, e.g. G06F17/10, H03H17/00)}
- G06F 5/012: {in floating-point computations}
- G06F 7/02: Comparing digital values (G06F7/06, {G06F7/22,} G06F7/38 take precedence)
- G06F 7/485: Adding; Subtracting {(G06F7/4833, G06F7/4836 take precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

System emulation of a floating-point dot product operation can be performed without directly performing the arithmetic by decomposing the Addend into a constituent sign, an exponent, and a fractional part; performing inverse scaling of the Addend by subtracting a scaling exponent (LSCALE) of a scaling of a negative power of two from the exponent to calculate an inverse-scaled addend; comparing a corresponding fractional part of the inverse-scaled addend with notional exponents of the most significant bit (MSB) and the least significant bit (LSB) of a fixed point accumulator to determine which of three cases have been encountered; and adding particular values representing the Addend to the calculation result according to which of the three cases have been encountered. The three cases include the inverse-scaled addend being able to be exactly accumulated into the fixed-point accumulator and the scenarios where the inverse-scaled addend is either too large or too small to be exactly accumulated into the fixed-point accumulator.

## Claims

### Claim 1

A computer-readable storage medium having instructions stored thereon for a system emulator that when executed by a computing system directs the computing system to:
simulate execution of an algorithm on a particular processor comprising an accumulator having a first bit width, the algorithm performing a floating-point (FP) dot product instruction comprising a calculation of a sum of products with scaling of a negative power of two combined with an addition of a FP Addend to a result of the calculation, wherein the scaling of the negative power of two is given as 2−LSCALE, wherein instructions to simulate the FP dot product instruction direct the computing system to:
compute the sum of products (SoP) in a fixed point format, where the SoP is stored in a simulated fixed-point accumulator having the first bit width;
decompose the FP Addend into a constituent sign, an exponent, and a fractional part;
perform inverse scaling of the FP addend by subtracting LSCALE from the exponent to calculate an inverse-scaled addend;
compare a corresponding fractional part of the inverse-scaled addend with notional exponents of the most significant bit (MSB) and the least significant bit (LSB) of the fixed-point accumulator to determine whether the inverse-scaled addend is able to be exactly accumulated into the fixed point accumulator; and
in response to determining that the inverse-scaled addend is able to be exactly accumulated into the fixed-point accumulator, add the inverse-scaled addend to the fixed point accumulator;
in response to determining that the inverse-scaled addend is not able to be exactly accumulated into the fixed-point accumulator, perform operations to add appropriate value to the fixed-point accumulator.

### Claim 2 (depends on 1)

The computer-readable storage medium of claim 1, wherein the instructions to compare the corresponding fractional part of the inverse-scaled addend with notional exponents of the MSB and the LSB of the fixed-point accumulator determine that the inverse-scaled addend is too large to be exactly accumulated into the fixed-point accumulator.

### Claim 3 (depends on 2)

The computer-readable storage medium of claim 2, wherein the constituent sign is a same sign as the SoP, wherein the instructions to perform operations to add appropriate value to the fixed-point accumulator direct the computing system to:
apply round=0 and sticky=1, and
use the constituent sign, the fractional part, and the exponent of the FP Addend.

### Claim 4 (depends on 2)

The computer-readable storage medium of claim 2, wherein the constituent sign is an opposite sign as the SoP, wherein the instructions to perform operations to add appropriate value to the fixed-point accumulator direct the computing system to:
subtract 1 from the fractional part of the FP Addend, and
apply round=1 and sticky=1.

### Claim 5 (depends on 1)

The computer-readable storage medium of claim 1, wherein the instructions to compare the corresponding fractional part of the inverse-scaled addend with notional exponents of the MSB and the LSB of the fixed point accumulator determine that the inverse-scaled addend is too small to be exactly accumulated into the fixed-point accumulator.

### Claim 6 (depends on 5)

The computer-readable storage medium of claim 5, wherein the constituent sign is a same sign as the SoP, wherein the instructions to perform operations to add appropriate value to the fixed-point accumulator direct the computing system to:
extract a corresponding sign, exponent, fractional part, round and sticky bits from the fixed-point accumulator;
set sticky=1; and
add LSCALE to the corresponding exponent extracted from the fixed-point accumulator.

### Claim 7 (depends on 5)

The computer-readable storage medium of claim 5, wherein the constituent sign is an opposite sign as the SoP, wherein the instructions to perform operations to add appropriate value to the fixed-point accumulator direct the computing system to:
decrement the fixed-point accumulator by 1;
extract the corresponding sign, exponent, fractional part, round and sticky bits from the fixed-point accumulator; and
add LSCALE to the corresponding exponent extracted from the fixed-point accumulator.

### Claim 8 (depends on 1)

The computer-readable storage medium of claim 1, wherein in response to determining that the inverse-scaled addend is able to be exactly accumulated into the fixed-point accumulator, the instructions further direct the system to:
after accumulating the inverse-scaled addend exactly into the accumulator, extract a corresponding sign, exponent, fractional part, round and sticky bits from the fixed-point accumulator; and
scale the result by adding LSCALE to the exponent.

### Claim 9 (depends on 1)

The computer-readable storage medium of claim 1, wherein the instructions to: compute the SoP in the fixed point format direct the computing system to compute the SoP in the fixed point format using a look-up table and accumulating each value obtained from the look-up table into the fixed-point accumulator using integer arithmetic.

### Claim 10 (depends on 1)

The computer-readable storage medium of claim 1, wherein the sum of products is a sum of four FP8 products, the FP8 being an 8-bit floating-point binary interchange format.

### Claim 11 (depends on 10)

The computer-readable storage medium of claim 10, wherein the instructions to: compute the SoP in the fixed point format direct the computing system to:
concatenate the two FP8 numbers of each product of the sum of four FP8 products and look up a corresponding 128-bit fixed point format of the product in a look-up table; and
accumulate each value obtained from the look-up table into the fixed-point accumulator using integer arithmetic.

### Claim 12 (depends on 1)

The computer-readable storage medium of claim 1, wherein a final value in the fixed-point accumulator is converted to a 32 bit floating-point number and rounded.

### Claim 13 (depends on 1)

The computer-readable storage medium of claim 1, wherein the emulator comprises instructions of a function which extracts a sign, exponent, top 24-bits of a fractional part, a round bit, and a sticky bit from a storage location.

### Claim 14 (depends on 1)

The computer-readable storage medium of claim 1, wherein the emulator comprises instructions to perform a count-leading-zeros (CLZ) operation to extract a sign, exponent, top 24-bits of a fractional part, a round bit, and a sticky bit from the fixed-point accumulator.

### Claim 15 (depends on 1)

The computer-readable storage medium of claim 1, wherein instructions to simulate the FP dot product instruction further direct the computing system to:
detect whether an input to the FP dot product instruction includes “not a number” (NaNs), Infinites, or always Zero results; and
if the input includes NaNs, Infinites, or always zero results, return an appropriate result without continuing to the compute of the sum of products.

### Claim 16

A method of performing a floating-point (FP) dot product operation comprising a calculation of a sum of products with scaling of a negative power of two combined with an addition of a FP Addend to a result of the calculation in software, the method comprising:
computing the sum of products (SoP) into an accumulator;
decomposing the FP Addend into a constituent sign, an exponent, and a fractional part;
performing inverse scaling of the FP addend by subtracting a scaling exponent (LSCALE) of a scaling of a negative power of two from the exponent to calculate an inverse-scaled addend;
comparing a corresponding fractional part of the inverse-scaled addend with notional exponents of the most significant bit (MSB) and the least significant bit (LSB) of the accumulator to determine whether the inverse-scaled addend is able to be exactly accumulated into the accumulator;
in response to determining that the inverse-scaled addend is able to be exactly accumulated into the accumulator, adding the inverse-scaled addend to the accumulator;
in response to determining that the inverse-scaled addend is not able to be exactly accumulated into the accumulator, performing operations to add appropriate value to the accumulator;
extracting a final sign, a final exponent, a final fractional part, a round bit, and a sticky bit from the accumulator; and
performing a floating-point rounding operation using the extracted final sign, final exponent, final fractional part, round bit, and sticky bit from the accumulator to generate a final rounded result.

### Claim 17 (depends on 16)

The method of claim 16, wherein the method is performed during execution of a deep learning algorithm.

### Claim 18 (depends on 16)

The method of claim 16, wherein the method is performed during dynamic binary translation.

### Claim 19 (depends on 16)

The method of claim 16, wherein comparing the corresponding fractional part of the inverse-scaled addend with notional exponents of the MSB and the LSB from the accumulator comprises:
determining that the inverse-scaled addend is too large to be exactly accumulated into the accumulator; and
if the constituent sign is a same sign as the SoP, performing operations to add appropriate value to the accumulator comprises:
applying round=0 and sticky=1, and
using the constituent sign, the fractional part, and the exponent of the FP Addend; and
if the constituent sign is an opposite sign as the SoP, performing operations to add appropriate value to the accumulator comprises:
subtracting 1 from the fractional part of the FP Addend, and
applying round=1 and sticky=1.

### Claim 20 (depends on 1)

The computer-readable storage medium of claim 1, wherein comparing the corresponding fractional part of the inverse-scaled addend with notional exponents of the MSB and the LSB from the accumulator comprises:
determining that the inverse-scaled addend is too small to be exactly accumulated into the accumulator; and
if the constituent sign is a same sign as the SoP, performing operations to add appropriate value to the accumulator comprises:
extracting a corresponding sign, exponent, fractional part, round and sticky bits from the accumulator;
setting sticky=1; and
adding LSCALE to the corresponding exponent extracted from the accumulator; and
if the constituent sign is an opposite sign as the SoP, performing operations to add appropriate value to the accumulator comprises:
decrementing the fixed-point accumulator by 1;
extracting the corresponding sign, exponent, fractional part, round and sticky bits from the accumulator; and
adding LSCALE to the corresponding exponent extracted from the accumulator.
