st
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Test Cases:
load/hold accumulators
accumulate through zero, one cycle mode, left/right major
accumulate through max, one cycle mode, left/right major
accumulate through zero, two cycle mode, left/right major
accumulate through max, two cycle mode, left/right major
dAdx adders
x_offset multiply
y_offset multiply
clamp, underflow/overflow
Misc Info:
There are 9 accumulators in the st module for R,G,B,A,Z,S,T,W,L
for the RGBA accumulators, the number formats are:
dadx: s,10.11 (s,10.2 for offsets)
dady: s,10.2
start point: 10.11
offsets: 0.2
result: 8.0 (clamped)
for the Z accumulator, the number formats are:
dadx: s,15.16 (s,15.6 for offsets)
dady: s,15.6
start point: s,15.16
offsets: 0.2
result: 15.3 (clamped)
for the STWL accumulators, the number formats are:
dadx: s,15.16
start point: s,15.16
result: s,15.0 (not clamped)
The clamps are the Akeley variety, which means:
Carry one extra bit of precision through all computations
and never clamp until the last computation is done (e.g. never clamp
intermediate values, especially those that continue to be interpolated).
When done, clamp the result if the MSB (extra bit) is one. In this case,
clamp to all zeros if the next most significant bit is 1, and to all ones
if the next most significant bit is zero. (To undo the wrap.)