SIMD Array Rotation via Row Interleaving

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional methods for rotating a 2N by 2N array by 90° are costly in terms of processor and memory resources, requiring 2N^2 load and store operations, which is inefficient compared to the proposed method.

Innovation Solution

The method involves loading elements into a processor's SIMD unit, interleaving rows from the top and bottom halves of the array, and then converting the resulting single row into a 2N by 2N array, reducing the number of operations to N + N(log2(N)) + 2, making it more efficient.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional brute force copying method is used to rotate array, then rotation function is achieved, but processor and memory resources are excessively consumed

Engineering Contradiction:
Improverotation functionVSAvoidprocessor and memory resources
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The array is divided into quadrants (top-left, top-right, bottom-left, bottom-right) that are rotated and repositioned as units. This segmentation allows the rotation to be performed by moving blocks of data rather than individual elements, significantly reducing the number of memory operations required.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Multiple data transfer operations are merged into fewer operations by using the SIMD unit to process multiple array elements simultaneously. The interleaving operation combines elements from different quadrants in a single computational pass, reducing the total number of load and store operations.

Inventive Principle:
Principle #5Merging (Combining)

2Productivity

If traditional element-by-element copying is used, then array rotation is completed, but the number of operations is excessively high (2N^2 operations)

Engineering Contradiction:
Improvearray rotation completionVSAvoidnumber of operations
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The traditional mechanical approach of individually copying each array element is replaced by using SIMD (Single Instruction Multiple Data) parallel processing. This allows multiple elements to be loaded, interleaved, and stored simultaneously, reducing the operation count from O(N^2) to O(N^2/word_size) where word_size is the number of elements processed in parallel.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The problem is solved by introducing the dimension of parallel processing through SIMD registers. Instead of sequentially processing elements in one dimension, the solution processes multiple elements simultaneously across multiple data lanes, effectively adding a parallelism dimension to the operation.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS7511722B1Method and system for fast 90 degree rotation of arrays
Publication Date: 2009.03.31 APPLE INC
  • US7511722B1 patent drawing
  • US7511722B1 patent drawing
  • US7511722B1 patent drawing

AI summary

A method and system to rotate a 2N by 2N array are described. Consistent with one embodiment of the present invention, the 2N elements of the 2N rows of a 2N by 2N array are loaded from memory into the vector registers of a processor's single instruction multiple data (SIMD) unit. Next, the elements of the rows in the top half of the array are interleaved with corresponding elements from a corresponding row in the bottom half of the array. The loading and interleaving operations are repeated N times before the results, stored in the vector registers, are written back to memory.