openaccel-lab
aien-dev/openaccel-lab
Brought by drakestapleton
openaccel-lab / workloads / rope / omega.om
| 1 | note rope: half-split rotary rotation over x[T][H][Dh] with cos/sin tables [T][Dh/2] |
| 2 | global kt ulong 1 |
| 3 | global kh ulong 1 |
| 4 | global khf ulong 1 |
| 5 | fn pair o ulong cb ulong to void |
| 6 | note rotate the h pairs of one (t, head) row at x offset o with table offset cb |
| 7 | hf = get khf 0 |
| 8 | for i ulong hf |
| 9 | x1 = get fa add o i |
| 10 | x2 = get fa add add o hf i |
| 11 | c = get fb add cb i |
| 12 | s = get fc add cb i |
| 13 | put fo add o i sub mul x1 c mul x2 s |
| 14 | put fo add add o hf i add mul x1 s mul x2 c |
| 15 | end |
| 16 | end |
| 17 | fn kern to void |
| 18 | nh = get kh 0 |
| 19 | hf = get khf 0 |
| 20 | for t ulong get kt 0 |
| 21 | cb = mul t hf |
| 22 | for j ulong nh |
| 23 | o = mul add mul t nh j mul 2 hf |
| 24 | pair o cb |
| 25 | end |
| 26 | end |
| 27 | end |
| 28 | fn main to int |
| 29 | oal_begin |
| 30 | put kt 0 ulong oal_p 0 |
| 31 | put kh 0 ulong oal_p 1 |
| 32 | put khf 0 ulong oal_p 3 |
| 33 | a = oal_fa 0 |
| 34 | b = oal_fb 1 |
| 35 | c = oal_fc 2 |
| 36 | w = oal_warm |
| 37 | for i ulong add w oal_reps |
| 38 | t0 = monons |
| 39 | kern |
| 40 | t1 = monons |
| 41 | if ge i w |
| 42 | oal_tick sub t1 t0 |
| 43 | end |
| 44 | end |
| 45 | oal_so 0 a |
| 46 | oal_end |
| 47 | ret 0 |
| 48 | end |