(no commit message)
[libreriscv.git] / openpower / sv / overview.mdwn
1 # SV Overview
2
3 This document provides a crash-course overview as to why SV exists, and how it works.
4
5 [SIMD is known to be harmful](https://www.sigarch.org/simd-instructions-considered-harmful/):
6 a seductive simplicity that is easy to implement in hardware. Without predication, which is common only in 3D GPUs, realistically, at the time of writing (AVX512 came from Larrabee), SIMD widths only become more and more problematic.
7
8 Cray-style variable-length Vectors on the other hand result in stunningly elegant and small loops, with no alarmingly high setup and cleanup code, where at the hardware level the microarchitecture may execute from one element right the way through to tens of thousands at a time, yet the executable remains exactly the same. Unlike in SIMD, powers of two limitations are not involved in either the hardware nor in the assembly code.
9
10 SimpleV takes the Cray style Vector principle and applies it to a scaalar architecture, in the process allowing register file size increases using "tagging" (similar to how x86 originally extended registers from 32 to 64 bit).
11
12 The fundamentals are:
13
14 * The Program Counter gains a "Sub Counter" context.
15 * Vectorisation pauses the PC and runs a loop from 0 to VL-1
16 (where VL is Vector Length)
17 * During the loop the instruction at the PC is executed *multiple*
18 times.
19 * Some registers may be "tagged" as Vectors
20 * During the loop, "Vector"-tagged register are incrememted by
21 one with each iteration.
22
23 In OpenPOWER ISA v3.0B pseudo-code form, an ADD operation, assuming both source and destination have been "tagged" as Vectors, is simply:
24
25 for i = 0 to VL-1:
26 GPR(RT+i) = GPR(RA+i) + GPR(RB+i)
27
28 At its heart, SimpleV really is this simple. On top of this fundamental basis further subtle refinements can be added which build up towards an extremely powerful Vector augmentation system, with very little in the way of additional opcodes required.
29
30 RISC-V RVV as of version 0.9 is over 180 instructions (more than the rest of RV64G combined). Over 95% of that functionality is added to OpenPOWER v3 0B, by SimpleV augmentation, with around 5 to 8 instructions.
31
32 Even in OpenPOWER v3.0B, the Scalar Integer ISA is around 150 instructions, with IEEE754 FP adding approximately 80 more. VSX, being based on SIMD design principles, adds somewhere in the region of 600 more.
33
34
35
36
37