[decompiler] clean up vector detection and add vector float product detection (#638)

* change

* recognize vector float product and update tests
This commit is contained in:
water111
2021-06-27 17:24:35 -04:00
committed by GitHub
parent bfb1fbe1fc
commit a6d5c4eda3
146 changed files with 1085 additions and 1653 deletions
@@ -231,5 +231,4 @@
)
;; failed to figure out what this is:
(let ((v0-16 0))
)
0
@@ -555,80 +555,30 @@
;; definition for method 10 of type oscillating-vector
(defmethod dummy-10 oscillating-vector ((obj oscillating-vector) (arg0 vector))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(cond
(arg0
(vector+! s5-0 (-> obj target) arg0)
(vector-! s5-0 s5-0 (-> obj value))
)
(else
(vector-! s5-0 (-> obj target) (-> obj value))
)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(cond
(arg0
(vector+! s5-0 (-> obj target) arg0)
(vector-! s5-0 s5-0 (-> obj value))
)
(let ((v1-3 s5-0))
(let ((a0-4 s5-0)
(f0-1 (* (-> obj accel) (-> *display* time-adjust-ratio)))
)
(.lvf vf1 (&-> a0-4 quad))
(let ((a0-5 f0-1))
(.mov vf2 a0-5)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-3 quad) vf1)
(else
(vector-! s5-0 (-> obj target) (-> obj value))
)
(vector+! (-> obj vel) (-> obj vel) s5-0)
(let ((f0-2 (vector-length (-> obj vel))))
(when (< (-> obj max-vel) f0-2)
(let ((v1-6 (-> obj vel)))
(let ((a0-8 (-> obj vel))
(f0-3 (/ (-> obj max-vel) f0-2))
)
(.lvf vf1 (&-> a0-8 quad))
(let ((a0-9 f0-3))
(.mov vf2 a0-9)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-6 quad) vf1)
)
)
)
(let ((v1-7 (-> obj vel)))
(let ((a0-10 (-> obj vel))
(f0-4 (-> obj damping))
)
(.lvf vf1 (&-> a0-10 quad))
(let ((a0-11 f0-4))
(.mov vf2 a0-11)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-7 quad) vf1)
)
(let ((v1-8 s5-0))
(let ((a0-12 (-> obj vel))
(f0-5 (-> *display* time-adjust-ratio))
)
(.lvf vf1 (&-> a0-12 quad))
(let ((a0-13 f0-5))
(.mov vf2 a0-13)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-8 quad) vf1)
)
(vector+! (-> obj value) (-> obj value) s5-0)
)
(-> obj value)
(vector-float*!
s5-0
s5-0
(* (-> obj accel) (-> *display* time-adjust-ratio))
)
(vector+! (-> obj vel) (-> obj vel) s5-0)
(let ((f0-2 (vector-length (-> obj vel))))
(if (< (-> obj max-vel) f0-2)
(vector-float*! (-> obj vel) (-> obj vel) (/ (-> obj max-vel) f0-2))
)
)
(vector-float*! (-> obj vel) (-> obj vel) (-> obj damping))
(vector-float*! s5-0 (-> obj vel) (-> *display* time-adjust-ratio))
(vector+! (-> obj value) (-> obj value) s5-0)
)
(-> obj value)
)
@@ -18,5 +18,4 @@
)
;; failed to figure out what this is:
(let ((v0-2 0))
)
0