[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
@@ -458,26 +458,8 @@
;; definition for function vector-v!
(defun vector-v! ((arg0 vector))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((v1-0 arg0))
(let ((a1-0 arg0)
(f0-0 (-> *display* seconds-per-frame))
)
(.lvf vf1 (&-> a1-0 quad))
(let ((a1-1 f0-0))
(.mov vf2 a1-1)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-0 quad) vf1)
)
arg0
)
(vector-float*! arg0 arg0 (-> *display* seconds-per-frame))
arg0
)
;; definition for function vector-v+!
@@ -507,26 +489,7 @@
;; definition for function vector-v*float!
(defun vector-v*float! ((delta-p vector) (velocity vector) (scale float))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((v0-0 delta-p))
(let ((v1-0 velocity)
(f0-1 (* scale (-> *display* seconds-per-frame)))
)
(.lvf vf1 (&-> v1-0 quad))
(let ((v1-1 f0-1))
(.mov vf2 v1-1)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v0-0 quad) vf1)
v0-0
)
)
(vector-float*! delta-p velocity (* scale (-> *display* seconds-per-frame)))
)
;; definition for function vector-v*float++!
@@ -1143,8 +1106,7 @@
;; definition for function vector3s-copy!
(defun vector3s-copy! ((arg0 vector) (arg1 vector))
(let ((v1-0 "Copy a vector3s"))
)
"Copy a vector3s"
(set! (-> arg0 x) (-> arg1 x))
(set! (-> arg0 y) (-> arg1 y))
(set! (-> arg0 z) (-> arg1 z))
@@ -1153,8 +1115,7 @@
;; definition for function vector3s+!
(defun vector3s+! ((arg0 vector) (arg1 vector) (arg2 vector))
(let ((v1-0 "Add 2 vectors3."))
)
"Add 2 vectors3."
(set! (-> arg0 x) (+ (-> arg1 x) (-> arg2 x)))
(set! (-> arg0 y) (+ (-> arg1 y) (-> arg2 y)))
(set! (-> arg0 z) (+ (-> arg1 z) (-> arg2 z)))
@@ -1163,8 +1124,7 @@
;; definition for function vector3s*float!
(defun vector3s*float! ((arg0 vector) (arg1 vector) (arg2 float))
(let ((v1-0 "mult vectors3 by float"))
)
"mult vectors3 by float"
(set! (-> arg0 x) (* (-> arg1 x) arg2))
(set! (-> arg0 y) (* (-> arg1 y) arg2))
(set! (-> arg0 z) (* (-> arg1 z) arg2))
@@ -1173,8 +1133,7 @@
;; definition for function vector3s-!
(defun vector3s-! ((arg0 vector) (arg1 vector) (arg2 vector))
(let ((v1-0 "Subtract 2 vectors3: c = (a - b)."))
)
"Subtract 2 vectors3: c = (a - b)."
(set! (-> arg0 x) (- (-> arg1 x) (-> arg2 x)))
(set! (-> arg0 y) (- (-> arg1 y) (-> arg2 y)))
(set! (-> arg0 z) (- (-> arg1 z) (-> arg2 z)))