sourcelibs/Datapath/demos/saxpy.xtl
1⍝!/usr/bin/env xetal
2⍝ y := a x + y on eight 16-bit numbers: a multiplier and an adder per
3⍝ element, every unit 16 bits. Run with "just demo-lib Datapath saxpy".
4ᵈᵖ⁼u̲se< "Datapath"
5x ← 1 2 3 4 5 6 7 8
6y ← 100 200 300 400 500 600 700 800
7ᵘs̲axpy ← 16 ᵈᵖs̲axpy 3
8x ᵘs̲axpy y
9ᵘb̲ig ← 16 ᵈᵖs̲axpy 10000
10x ᵘb̲ig y ⍝ the products wrap past 32767