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
22 lines
572 B
Common Lisp
22 lines
572 B
Common Lisp
(defun test-vector-sqrt ()
|
|
(let ((vector-in-1 (new 'stack 'vector))
|
|
(vector-out (new 'stack 'vector)))
|
|
|
|
(set-vector! vector-in-1 {{ v1x }} {{ v1y }} {{ v1z }} {{ v1w }})
|
|
(set-vector! vector-out {{ destx }} {{ desty }} {{ destz }} {{ destw }})
|
|
|
|
(rlet ((vf1 :class vf :reset-here #t)
|
|
(vf2 :class vf :reset-here #t))
|
|
|
|
(.lvf vf1 vector-in-1)
|
|
(.lvf vf2 vector-out)
|
|
|
|
({{ operation }} vf2 vf1 :ftf #b{{ ftf }})
|
|
(.wait.vf)
|
|
|
|
(.svf vector-out vf2))
|
|
|
|
(format #t "~f~%" (-> vector-out x))))
|
|
|
|
(test-vector-sqrt)
|