update REMAP, remove applydim, it can be done by setting dimensions=1
[libreriscv.git] / openpower / sv / shape_table_format.mdwn
1 Shape is 32-bits. When SHAPE is set entirely to zeros, remapping is
2 disabled: the register's elements are a linear (1D) vector.
3
4 | 31..30 | 29..24 | 23..21 | 20..18 | 17..12 | 11..6 | 5..0 |
5 | -------- | ------ | ------- | ------- | ------- | ------- | ------- |
6 | mode | offset | invxyz | permute | zdimsz | ydimsz | xdimsz |
7
8 mode sets different behaviours (straight matrix multiply, FFT, DCT).
9 matrix multiply sets mode=0b00
10
11 invxyz will invert the start index of each of x, y or z. If invxyz[0] is
12 zero then x-dimensional counting begins from 0 and increments, otherwise
13 it begins from xdimsz-1 and iterates down to zero. Likewise for y and z.
14
15 offset will have the effect equivalent to the sequential element loop
16 to appear to run for offset (additional) iterations prior to actually
17 generating output. in pseudo-code the loop would be:
18
19 for index in offset to (offset+VL-1)
20
21 xdimsz, ydimsz and zdimsz are offset by 1, such that a value of 0 indicates
22 that the array dimensionality for that dimension is 1. any dimension
23 not intended to be used must have its value set to 0 (dimensionality
24 of 1). A value of xdimsz=2 would indicate that in the first dimension
25 there are 3 elements in the array. For example, to create a 2D array
26 X,Y of dimensionality X=3 and Y=2, set xdimsz=2, ydimsz=1 and zdimsz=0
27
28 The format of the array is therefore as follows:
29
30 array[xdimsz+1][ydimsz+1][zdimsz+1]
31
32 However whilst illustrative of the dimensionality, that does not take the
33 "permute" setting into account. "permute" may be any one of six values
34 (0-5, with values of 6 and 7 being reserved, and not legal). The table
35 below shows how the permutation dimensionality order works:
36
37 | permute | order | array format |
38 | ------- | ----- | ------------------------ |
39 | 000 | 0,1,2 | (xdim+1)(ydim+1)(zdim+1) |
40 | 001 | 0,2,1 | (xdim+1)(zdim+1)(ydim+1) |
41 | 010 | 1,0,2 | (ydim+1)(xdim+1)(zdim+1) |
42 | 011 | 1,2,0 | (ydim+1)(zdim+1)(xdim+1) |
43 | 100 | 2,0,1 | (zdim+1)(xdim+1)(ydim+1) |
44 | 101 | 2,1,0 | (zdim+1)(ydim+1)(xdim+1) |
45
46 In other words, the "permute" option changes the order in which
47 nested for-loops over the array would be done. See executable
48 python reference code for further details.
49