mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
cdce4d9612
* compiler: Support the majority of the remaining VU VF instructions - VWAIT - VMADD variants - VMSUB variants - VSQRT - VDIV - outer product (VOPMULA + VOPMSUB) * compiler: Fix some bugs / optimize some instructions * tests/compiler: Add test coverage for new instructions * docs: Add documentation for new inline assembly functions * lint: Formatting / fix failing test * Remove my comment about ftf/fsf encoding, it's been fixed * address review feedback * correct VSQRTPS implementation
26 lines
785 B
Common Lisp
26 lines
785 B
Common Lisp
(defun test-vector-division ()
|
|
(let ((vector-in-1 (new 'stack 'vector))
|
|
(vector-in-2 (new 'stack 'vector))
|
|
(vector-out (new 'stack 'vector)))
|
|
|
|
(set-vector! vector-in-1 {{ v1x }} {{ v1y }} {{ v1z }} {{ v1w }})
|
|
(set-vector! vector-in-2 {{ v2x }} {{ v2y }} {{ v2z }} {{ v2w }})
|
|
(set-vector! vector-out {{ destx }} {{ desty }} {{ destz }} {{ destw }})
|
|
|
|
(rlet ((vf1 :class vf :reset-here #t)
|
|
(vf2 :class vf :reset-here #t)
|
|
(vf3 :class vf :reset-here #t))
|
|
|
|
(.lvf vf1 vector-in-1)
|
|
(.lvf vf2 vector-in-2)
|
|
(.lvf vf3 vector-out)
|
|
|
|
({{ operation }} vf3 vf1 vf2 :fsf #b{{ fsf }} :ftf #b{{ ftf }})
|
|
(.wait.vf)
|
|
|
|
(.svf vector-out vf3))
|
|
|
|
(format #t "~f~%" (-> vector-out x))))
|
|
|
|
(test-vector-division)
|