Compiler Address Calculation Optimization via Bit-Length Segmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current architectures face inefficiencies in address calculations due to the resource-intensive nature of 64-bit operations, particularly in 64-bit architectures that lack native support for 64-bit integer operations, leading to slower execution and increased resource usage compared to 32-bit operations.

Innovation Solution

A compiler-based optimizer splits address calculations into a 32-bit offset calculation and a 64-bit base pointer combination, allowing for the use of 32-bit operations to reduce resource usage and enhance optimization opportunities, including arithmetic and instruction-level optimizations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Length of moving object

If 64-bit operations are used for address calculations in 64-bit architectures, then the address space coverage is sufficient, but the hardware resource usage and execution time increase significantly

Engineering Contradiction:
Improveaddress space coverageVSAvoidexecution speed
Core Design Contradiction:
Length of moving objectVSProductivity

Solution Approach 1:

The patent segments the 64-bit address calculation into two separate operations: a 32-bit offset calculation and a 64-bit base pointer addition. This segmentation allows the computationally intensive offset calculation to be performed using efficient 32-bit operations, while the base pointer handles the upper address space, thus resolving the contradiction between address space coverage and execution speed.

Inventive Principle:
Principle #1Segmentation

2Length of moving object

If 64-bit operations are used for address calculations, then the full address range can be accessed, but the register usage and hardware resources are doubled compared to 32-bit operations

Engineering Contradiction:
Improveaddress rangeVSAvoidregister usage
Core Design Contradiction:
Length of moving objectVSDevice complexity

Solution Approach 1:

The address calculation is segmented into a 32-bit offset portion and a 64-bit base pointer portion. The 32-bit offset can be calculated using fewer registers and less complex hardware, while the base pointer is simply added to this offset. This reduces the overall register usage and hardware complexity compared to performing the entire calculation in 64-bit operations.

Inventive Principle:
Principle #1Segmentation

3Length of moving object

If 64-bit multiplication is implemented on architectures without native 64-bit support, then 64-bit address calculations can be performed, but the execution time increases by several times compared to 32-bit operations

Engineering Contradiction:
Improveoffset calculation precisionVSAvoidoperation execution time
Core Design Contradiction:
Length of moving objectVSLoss of time

Solution Approach 1:

The patent avoids implementing 64-bit multiplication entirely by segmenting the address calculation. The offset calculation, which would otherwise require 64-bit multiplication, is performed using 32-bit operations that are natively supported by the architecture. This eliminates the time penalty associated with software-emulated 64-bit multiplication while still achieving the required address calculation precision.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the bit-length parameter of the offset calculation from 64-bit to 32-bit. This parameter change allows the use of native 32-bit multiplication instructions instead of emulated 64-bit multiplication, dramatically reducing execution time while maintaining sufficient precision for the offset portion of the address calculation.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS12118359B2Method and system for optimizing address calculations
Publication Date: 2024.10.15 HUAWEI TECH CO LTD
  • US12118359B2 patent drawing
  • US12118359B2 patent drawing
  • US12118359B2 patent drawing

AI summary

The disclosed systems, structures, and methods are directed to optimizing address calculations in a computer. This is achieved in a compiler that identifies an address calculation in code that is being compiled and transforms the code by splitting the address calculation into a first portion in which an offset is determined and a second portion, in which the offset is combined with a base pointer to generate an address. The address and the base pointer have a first bit-length, and the offset has a second bit-length shorter than the first bit-length. The offset is determined using an operation performed at the second bit-length. In some implementations the first bit-length is 64 bits and the second bit-length is 32 bits.