# arjavsharma91/v4q128 architecture

> Architecture diagram of the GitHub repository arjavsharma91/v4q128, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arjavsharma91/v4q128
- Repository: https://github.com/arjavsharma91/v4q128

## Overview

v4q128 is a header-only C++ library for four-lane, 128-bit fixed-point SIMD arithmetic using AVX2. Users construct vectors or load AoS data into the library's SoA representation, apply arithmetic and comparisons, then store or inspect results. The graph covers the sampled storage, conversion, and arithmetic modules; the README describes the product but does not document extra capabilities or their wiring.

Main entry points: [`include/v4q128/core/storage.hpp`](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/core/storage.hpp) (Vector storage), [`include/v4q128/io/transpose.hpp`](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/io/transpose.hpp) (Load and transpose), [`include/v4q128/ops/add_sub.hpp`](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/add_sub.hpp) (Add and subtract), [`include/v4q128/ops/cmp.hpp`](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/cmp.hpp) (Comparisons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_representation["Vector representation"]
  node_storage["Vector storage<br/>[storage.hpp]"]
end

subgraph group_memory["Memory conversion"]
  node_conversion["Load and transpose<br/>[transpose.hpp]"]
end

subgraph group_arithmetic["SIMD operations"]
  node_addsub["Add and subtract<br/>[add_sub.hpp]"]
  node_compare["Comparisons<br/>[cmp.hpp]"]
  node_multiply["Multiplication<br/>[mul.hpp]"]
  node_shifts["Shift helpers<br/>[shifts.hpp]"]
end

node_user(("Library user"))

node_user -->|"constructs vectors"| node_storage
node_user -->|"loads and stores"| node_conversion
node_user -->|"adds or subtracts"| node_addsub
node_user -->|"multiplies"| node_multiply
node_user -->|"compares"| node_compare
node_user -.->|"uses shifts"| node_shifts
node_conversion -->|"creates vectors"| node_storage
node_addsub -->|"returns vectors"| node_storage
node_multiply -->|"returns vectors"| node_storage
node_compare -->|"reads vectors"| node_storage
node_shifts -->|"operates on vectors"| node_storage

click node_storage "https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/core/storage.hpp"
click node_conversion "https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/io/transpose.hpp"
click node_addsub "https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/add_sub.hpp"
click node_compare "https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/cmp.hpp"
click node_multiply "https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/mul.hpp"
click node_shifts "https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/shifts.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_storage,node_user toneBlue
class node_conversion toneAmber
class node_addsub,node_compare,node_multiply,node_shifts toneMint
```

## Components

### Vector representation

- [Vector storage](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/core/storage.hpp): `include/v4q128/core/storage.hpp`

### Memory conversion

- [Load and transpose](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/io/transpose.hpp): `include/v4q128/io/transpose.hpp`

### SIMD operations

- [Add and subtract](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/add_sub.hpp): `include/v4q128/ops/add_sub.hpp`
- [Comparisons](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/cmp.hpp): `include/v4q128/ops/cmp.hpp`
- [Multiplication](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/mul.hpp): `include/v4q128/ops/mul.hpp`
- [Shift helpers](https://github.com/arjavsharma91/v4q128/blob/main/include/v4q128/ops/shifts.hpp): `include/v4q128/ops/shifts.hpp`

### Other components

- **Library user**

## Connections

- Library user → Vector storage: constructs vectors (evidence: `include/v4q128/core/storage.hpp`)
- Library user → Load and transpose: loads and stores (evidence: `include/v4q128/io/transpose.hpp`)
- Library user → Add and subtract: adds or subtracts
- Library user → Multiplication: multiplies
- Library user → Comparisons: compares (evidence: `include/v4q128/ops/cmp.hpp`)
- Library user → Shift helpers: uses shifts
- Load and transpose → Vector storage: creates vectors (evidence: `include/v4q128/io/transpose.hpp`)
- Add and subtract → Vector storage: returns vectors (evidence: `include/v4q128/ops/add_sub.hpp`)
- Multiplication → Vector storage: returns vectors (evidence: `include/v4q128/ops/mul.hpp`)
- Comparisons → Vector storage: reads vectors (evidence: `include/v4q128/ops/cmp.hpp`)
- Shift helpers → Vector storage: operates on vectors (evidence: `include/v4q128/ops/shifts.hpp`)
