Files
jak-project/test/decompiler/reference/engine/math/vector-h_REF.gc
T
Tyler Wilding 2a315419de tests: Automate the offline reference tests better (#427)
* tests: Move all files to new directories

* scripts: Update decomp scripts

* tests: Remove hard-coded list for offline tests

* linting
2021-05-09 17:03:58 -04:00

970 lines
26 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; definition of type bit-array
(deftype bit-array (basic)
((length int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
(_pad uint8 :offset-assert 12)
(bytes uint8 :dynamic :offset 12)
)
:method-count-assert 13
:size-assert #xd
:flag-assert #xd0000000d
(:methods
(new (symbol type int) _type_ 0)
(get-bit (_type_ int) symbol 9)
(clear-bit (_type_ int) int 10)
(set-bit (_type_ int) int 11)
(clear (_type_) _type_ 12)
)
)
;; definition for method 3 of type bit-array
(defmethod inspect bit-array ((obj bit-array))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
obj
)
;; definition for method 0 of type bit-array
(defmethod new bit-array ((allocation symbol) (type-to-make type) (length int))
(let
((obj
(object-new
allocation
type-to-make
(+
(+ (sar (logand -8 (+ length 7)) 3) -1)
(the-as int (-> type-to-make size))
)
)
)
)
(set! (-> obj length) length)
(set! (-> obj allocated-length) length)
obj
)
)
;; definition for method 4 of type bit-array
(defmethod length bit-array ((obj bit-array))
(-> obj length)
)
;; definition for method 5 of type bit-array
;; INFO: Return type mismatch uint vs int.
(defmethod asize-of bit-array ((obj bit-array))
(the-as
int
(+
(-> obj type size)
(the-as uint (sar (logand -8 (+ (-> obj allocated-length) 7)) 3))
)
)
)
;; definition for method 9 of type bit-array
(defmethod get-bit bit-array ((obj bit-array) (arg0 int))
(let ((v1-2 (-> obj bytes (sar arg0 3))))
(nonzero? (logand v1-2 (the-as uint (ash 1 (logand arg0 7)))))
)
)
;; definition for method 10 of type bit-array
(defmethod clear-bit bit-array ((obj bit-array) (arg0 int))
(set!
(-> obj bytes (sar arg0 3))
(logand
(-> obj bytes (sar arg0 3))
(the-as uint (lognot (ash 1 (logand arg0 7))))
)
)
0
)
;; definition for method 11 of type bit-array
(defmethod set-bit bit-array ((obj bit-array) (arg0 int))
(set!
(-> obj bytes (sar arg0 3))
(logior (-> obj bytes (sar arg0 3)) (the-as uint (ash 1 (logand arg0 7))))
)
0
)
;; definition for method 12 of type bit-array
(defmethod clear bit-array ((obj bit-array))
(let ((idx (sar (logand -8 (+ (-> obj allocated-length) 7)) 3)))
(while (nonzero? idx)
(+! idx -1)
(nop!)
(nop!)
(set! (-> obj bytes idx) (the-as uint 0))
)
)
obj
)
;; definition of type vector4ub
(deftype vector4ub (structure)
((data uint8 4 :offset-assert 0)
(x uint8 :offset 0)
(y uint8 :offset 1)
(z uint8 :offset 2)
(w uint8 :offset 3)
(clr uint32 :offset 0)
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector4ub
(defmethod inspect vector4ub ((obj vector4ub))
(format #t "[~8x] ~A~%" obj 'vector4ub)
(format #t "~Tdata[4] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
(format #t "~Tz: ~D~%" (-> obj data 2))
(format #t "~Tw: ~D~%" (-> obj data 3))
(format #t "~Tclr: ~D~%" (-> obj clr))
obj
)
;; definition of type vector4b
(deftype vector4b (structure)
((data int8 4 :offset-assert 0)
(x int8 :offset 0)
(y int8 :offset 1)
(z int8 :offset 2)
(w int8 :offset 3)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector4b
(defmethod inspect vector4b ((obj vector4b))
(format #t "[~8x] ~A~%" obj 'vector4b)
(format #t "~Tdata[4] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
(format #t "~Tz: ~D~%" (-> obj data 2))
(format #t "~Tw: ~D~%" (-> obj data 3))
obj
)
;; definition of type vector2h
(deftype vector2h (structure)
((data int16 2 :offset-assert 0)
(x int16 :offset 0)
(y int16 :offset 2)
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector2h
(defmethod inspect vector2h ((obj vector2h))
(format #t "[~8x] ~A~%" obj 'vector2h)
(format #t "~Tdata[2] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
obj
)
;; definition of type vector2uh
(deftype vector2uh (structure)
((data uint16 2 :offset-assert 0)
(x uint16 :offset 0)
(y uint16 :offset 2)
(val uint32 :offset 0)
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector2uh
(defmethod inspect vector2uh ((obj vector2uh))
(format #t "[~8x] ~A~%" obj 'vector2uh)
(format #t "~Tdata[2] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
(format #t "~Tval: ~D~%" (-> obj val))
obj
)
;; definition of type vector3h
(deftype vector3h (structure)
((data int16 2 :offset-assert 0)
(x int16 :offset 0)
(y int16 :offset 2)
(z int16 :offset-assert 4)
)
:method-count-assert 9
:size-assert #x6
:flag-assert #x900000006
)
;; definition for method 3 of type vector3h
(defmethod inspect vector3h ((obj vector3h))
(format #t "[~8x] ~A~%" obj 'vector3h)
(format #t "~Tdata[2] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
(format #t "~Tz: ~D~%" (-> obj z))
obj
)
;; definition of type vector2w
(deftype vector2w (structure)
((data int32 2 :offset-assert 0)
(x int32 :offset 0)
(y int32 :offset 4)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type vector2w
(defmethod inspect vector2w ((obj vector2w))
(format #t "[~8x] ~A~%" obj 'vector2w)
(format #t "~Tdata[2] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
obj
)
;; definition of type vector3w
(deftype vector3w (structure)
((data int32 3 :offset-assert 0)
(x int32 :offset 0)
(y int32 :offset 4)
(z int32 :offset 8)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type vector3w
(defmethod inspect vector3w ((obj vector3w))
(format #t "[~8x] ~A~%" obj 'vector3w)
(format #t "~Tdata[3] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
(format #t "~Tz: ~D~%" (-> obj data 2))
obj
)
;; definition of type vector4w
(deftype vector4w (structure)
((data int32 4 :offset-assert 0)
(x int32 :offset 0)
(y int32 :offset 4)
(z int32 :offset 8)
(w int32 :offset 12)
(dword uint64 2 :offset 0)
(quad uint128 :offset 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector4w
;; Used lq/sq
(defmethod inspect vector4w ((obj vector4w))
(format #t "[~8x] ~A~%" obj 'vector4w)
(format #t "~Tdata[4] @ #x~X~%" (&-> obj x))
(format #t "~Tx: ~D~%" (-> obj x))
(format #t "~Ty: ~D~%" (-> obj y))
(format #t "~Tz: ~D~%" (-> obj z))
(format #t "~Tw: ~D~%" (-> obj w))
(format #t "~Tdword[2] @ #x~X~%" (&-> obj x))
(format #t "~Tquad: ~D~%" (-> obj quad))
obj
)
;; definition for method 2 of type vector4w
(defmethod print vector4w ((obj vector4w))
(format
#t
"#<vector4w ~D ~D ~D ~D @ #x~X>"
(-> obj x)
(-> obj y)
(-> obj z)
(-> obj w)
obj
)
obj
)
;; definition of type vector4w-2
(deftype vector4w-2 (structure)
((data int32 8 :offset-assert 0)
(quad uint128 2 :offset 0)
(vector vector4w 2 :offset 0)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type vector4w-2
(defmethod inspect vector4w-2 ((obj vector4w-2))
(format #t "[~8x] ~A~%" obj 'vector4w-2)
(format #t "~Tdata[8] @ #x~X~%" (-> obj data))
(format #t "~Tquad[2] @ #x~X~%" (-> obj data))
(format #t "~Tvector[2] @ #x~X~%" (-> obj data))
obj
)
;; definition of type vector4w-3
(deftype vector4w-3 (structure)
((data int32 12 :offset-assert 0)
(quad uint128 3 :offset 0)
(vector vector4w 3 :offset 0)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type vector4w-3
(defmethod inspect vector4w-3 ((obj vector4w-3))
(format #t "[~8x] ~A~%" obj 'vector4w-3)
(format #t "~Tdata[12] @ #x~X~%" (-> obj data))
(format #t "~Tquad[3] @ #x~X~%" (-> obj data))
(format #t "~Tvector[3] @ #x~X~%" (-> obj data))
obj
)
;; definition of type vector4w-4
(deftype vector4w-4 (structure)
((data int32 16 :offset-assert 0)
(quad uint128 4 :offset 0)
(vector vector4w 4 :offset 0)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; definition for method 3 of type vector4w-4
(defmethod inspect vector4w-4 ((obj vector4w-4))
(format #t "[~8x] ~A~%" obj 'vector4w-4)
(format #t "~Tdata[16] @ #x~X~%" (-> obj data))
(format #t "~Tquad[4] @ #x~X~%" (-> obj data))
(format #t "~Tvector[4] @ #x~X~%" (-> obj data))
obj
)
;; definition of type vector4h
(deftype vector4h (structure)
((data int16 4 :offset-assert 0)
(x int16 :offset 0)
(y int16 :offset 2)
(z int16 :offset 4)
(w int16 :offset 6)
(long uint64 :offset 0)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type vector4h
(defmethod inspect vector4h ((obj vector4h))
(format #t "[~8x] ~A~%" obj 'vector4h)
(format #t "~Tdata[4] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~D~%" (-> obj data 0))
(format #t "~Ty: ~D~%" (-> obj data 1))
(format #t "~Tz: ~D~%" (-> obj data 2))
(format #t "~Tw: ~D~%" (-> obj data 3))
(format #t "~Tlong: ~D~%" (-> obj long))
obj
)
;; definition of type vector8h
(deftype vector8h (structure)
((data int16 8 :offset-assert 0)
(quad uint128 :offset 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector8h
;; Used lq/sq
(defmethod inspect vector8h ((obj vector8h))
(format #t "[~8x] ~A~%" obj 'vector8h)
(format #t "~Tdata[8] @ #x~X~%" (-> obj data))
(format #t "~Tquad: ~D~%" (-> obj quad))
obj
)
;; definition of type vector16b
(deftype vector16b (structure)
((data int8 16 :offset-assert 0)
(quad uint128 :offset 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector16b
;; Used lq/sq
(defmethod inspect vector16b ((obj vector16b))
(format #t "[~8x] ~A~%" obj 'vector16b)
(format #t "~Tdata[8] @ #x~X~%" (-> obj data))
(format #t "~Tquad: ~D~%" (-> obj quad))
obj
)
;; definition of type vector
(deftype vector (structure)
((data float 4 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(z float :offset 8)
(w float :offset 12)
(quad uint128 :offset 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector
;; INFO: this function exists in multiple non-identical object files
;; Used lq/sq
(defmethod inspect vector ((obj vector))
(format #t "[~8x] ~A~%" obj 'vector)
(format #t "~Tdata[4] @ #x~X~%" (&-> obj x))
(format #t "~Tx: ~f~%" (-> obj x))
(format #t "~Ty: ~f~%" (-> obj y))
(format #t "~Tz: ~f~%" (-> obj z))
(format #t "~Tw: ~f~%" (-> obj w))
(format #t "~Tquad: ~D~%" (-> obj quad))
obj
)
;; definition for method 3 of type vector
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect vector ((obj vector))
(format #t "[~8x] vector~%" obj)
(format
#t
"~T[~F] [~F] [~F] [~F]~%"
(-> obj x)
(-> obj y)
(-> obj z)
(-> obj w)
)
obj
)
;; definition for method 2 of type vector
(defmethod print vector ((obj vector))
(format
#t
"#<vector ~F ~F ~F ~F @ #x~X>"
(-> obj x)
(-> obj y)
(-> obj z)
(-> obj w)
obj
)
obj
)
;; definition for symbol *null-vector*, type vector
(define *null-vector* (new 'static 'vector :w 1.0))
;; definition for symbol *identity-vector*, type vector
(define *identity-vector* (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0))
;; definition for symbol *x-vector*, type vector
(define *x-vector* (new 'static 'vector :x 1.0 :w 1.0))
;; definition for symbol *y-vector*, type vector
(define *y-vector* (new 'static 'vector :y 1.0 :w 1.0))
;; definition for symbol *z-vector*, type vector
(define *z-vector* (new 'static 'vector :z 1.0 :w 1.0))
;; definition for symbol *up-vector*, type vector
(define *up-vector* (new 'static 'vector :y 1.0 :w 1.0))
;; definition of type vector4s-3
(deftype vector4s-3 (structure)
((data float 12 :offset-assert 0)
(quad uint128 3 :offset 0)
(vector vector 3 :inline :offset 0)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type vector4s-3
(defmethod inspect vector4s-3 ((obj vector4s-3))
(format #t "[~8x] ~A~%" obj 'vector4s-3)
(format #t "~Tdata[12] @ #x~X~%" (-> obj data))
(format #t "~Tquad[3] @ #x~X~%" (-> obj data))
(format #t "~Tvector[3] @ #x~X~%" (-> obj data))
obj
)
;; definition of type vector-array
(deftype vector-array (inline-array-class)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector-array
(defmethod inspect vector-array ((obj vector-array))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tdata[0] @ #x~X~%" (&-> obj data 4))
obj
)
;; failed to figure out what this is:
(set! (-> vector-array heap-base) (the-as uint 16))
;; definition of type rgbaf
(deftype rgbaf (vector)
((r float :offset 0)
(g float :offset 4)
(b float :offset 8)
(a float :offset 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type rgbaf
;; Used lq/sq
(defmethod inspect rgbaf ((obj rgbaf))
(format #t "[~8x] ~A~%" obj 'rgbaf)
(format #t "~Tdata[4] @ #x~X~%" (&-> obj x))
(format #t "~Tx: ~f~%" (-> obj x))
(format #t "~Ty: ~f~%" (-> obj y))
(format #t "~Tz: ~f~%" (-> obj z))
(format #t "~Tw: ~f~%" (-> obj w))
(format #t "~Tquad: ~D~%" (-> obj quad))
(format #t "~Tr: ~f~%" (-> obj x))
(format #t "~Tg: ~f~%" (-> obj y))
(format #t "~Tb: ~f~%" (-> obj z))
(format #t "~Ta: ~f~%" (-> obj w))
obj
)
;; definition of type plane
(deftype plane (vector)
((a float :offset 0)
(b float :offset 4)
(c float :offset 8)
(d float :offset 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type plane
;; Used lq/sq
(defmethod inspect plane ((obj plane))
(format #t "[~8x] ~A~%" obj 'plane)
(format #t "~Tdata[4] @ #x~X~%" (&-> obj x))
(format #t "~Tx: ~f~%" (-> obj x))
(format #t "~Ty: ~f~%" (-> obj y))
(format #t "~Tz: ~f~%" (-> obj z))
(format #t "~Tw: ~f~%" (-> obj w))
(format #t "~Tquad: ~D~%" (-> obj quad))
(format #t "~Ta: ~f~%" (-> obj x))
(format #t "~Tb: ~f~%" (-> obj y))
(format #t "~Tc: ~f~%" (-> obj z))
(format #t "~Td: ~f~%" (-> obj w))
obj
)
;; definition of type sphere
(deftype sphere (vector)
((r float :offset 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type sphere
;; Used lq/sq
(defmethod inspect sphere ((obj sphere))
(format #t "[~8x] ~A~%" obj 'sphere)
(format #t "~Tdata[4] @ #x~X~%" (&-> obj x))
(format #t "~Tx: ~f~%" (-> obj x))
(format #t "~Ty: ~f~%" (-> obj y))
(format #t "~Tz: ~f~%" (-> obj z))
(format #t "~Tw: ~f~%" (-> obj w))
(format #t "~Tquad: ~D~%" (-> obj quad))
(format #t "~Tr: ~f~%" (-> obj w))
obj
)
;; definition of type isphere
(deftype isphere (vec4s)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition of type box8s
(deftype box8s (structure)
((data float 8 :offset-assert 0)
(quad uint128 2 :offset 0)
(vector vector 2 :offset 0)
(min vector :inline :offset 0)
(max vector :inline :offset 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type box8s
(defmethod inspect box8s ((obj box8s))
(format #t "[~8x] ~A~%" obj 'box8s)
(format #t "~Tdata[8] @ #x~X~%" (-> obj data))
(format #t "~Tquad[2] @ #x~X~%" (-> obj data))
(format #t "~Tvector[2] @ #x~X~%" (-> obj data))
(format #t "~Tmin: #<vector @ #x~X>~%" (-> obj data))
(format #t "~Tmax: #<vector @ #x~X>~%" (&-> obj data 4))
obj
)
;; definition of type box8s-array
(deftype box8s-array (inline-array-class)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type box8s-array
(defmethod inspect box8s-array ((obj box8s-array))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tdata[0] @ #x~X~%" (&-> obj data 4))
obj
)
;; failed to figure out what this is:
(set! (-> box8s-array heap-base) (the-as uint 32))
;; definition of type cylinder
(deftype cylinder (structure)
((origin vector :inline :offset-assert 0)
(axis vector :inline :offset-assert 16)
(radius float :offset-assert 32)
(length float :offset-assert 36)
)
:method-count-assert 11
:size-assert #x28
:flag-assert #xb00000028
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
)
)
;; definition for method 3 of type cylinder
(defmethod inspect cylinder ((obj cylinder))
(format #t "[~8x] ~A~%" obj 'cylinder)
(format #t "~Torigin: #<vector @ #x~X>~%" (-> obj origin))
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
(format #t "~Tradius: ~f~%" (-> obj radius))
(format #t "~Tlength: ~f~%" (-> obj length))
obj
)
;; definition of type cylinder-flat
(deftype cylinder-flat (structure)
((origin vector :inline :offset-assert 0)
(axis vector :inline :offset-assert 16)
(radius float :offset-assert 32)
(length float :offset-assert 36)
)
:method-count-assert 11
:size-assert #x28
:flag-assert #xb00000028
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
)
)
;; definition for method 3 of type cylinder-flat
(defmethod inspect cylinder-flat ((obj cylinder-flat))
(format #t "[~8x] ~A~%" obj 'cylinder-flat)
(format #t "~Torigin: #<vector @ #x~X>~%" (-> obj origin))
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
(format #t "~Tradius: ~f~%" (-> obj radius))
(format #t "~Tlength: ~f~%" (-> obj length))
obj
)
;; definition of type vertical-planes
(deftype vertical-planes (structure)
((data uint128 4 :offset-assert 0)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; definition for method 3 of type vertical-planes
(defmethod inspect vertical-planes ((obj vertical-planes))
(format #t "[~8x] ~A~%" obj 'vertical-planes)
(format #t "~Tdata[4] @ #x~X~%" (-> obj data))
obj
)
;; definition of type vertical-planes-array
(deftype vertical-planes-array (basic)
((length uint32 :offset-assert 4)
(data vertical-planes :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vertical-planes-array
(defmethod inspect vertical-planes-array ((obj vertical-planes-array))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)
;; definition of type qword
(deftype qword (structure)
((data uint32 4 :offset-assert 0)
(byte uint8 16 :offset 0)
(hword uint16 8 :offset 0)
(word uint32 4 :offset 0)
(dword uint64 2 :offset 0)
(quad uint128 :offset 0)
(vector vector :inline :offset 0)
(vector4w vector4w :inline :offset 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type qword
;; Used lq/sq
(defmethod inspect qword ((obj qword))
(format #t "[~8x] ~A~%" obj 'qword)
(format #t "~Tdata[4] @ #x~X~%" (-> obj data))
(format #t "~Tbyte[16] @ #x~X~%" (-> obj data))
(format #t "~Thword[8] @ #x~X~%" (-> obj data))
(format #t "~Tword[4] @ #x~X~%" (-> obj data))
(format #t "~Tdword[2] @ #x~X~%" (-> obj data))
(format #t "~Tquad: ~D~%" (-> obj quad))
(format #t "~Tvector: #<vector @ #x~X>~%" (-> obj data))
(format #t "~Tvector4w: #<vector4w @ #x~X>~%" (-> obj data))
obj
)
;; definition of type vector3s
(deftype vector3s (structure)
((data float 3 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(z float :offset 8)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type vector3s
(defmethod inspect vector3s ((obj vector3s))
(format #t "[~8x] ~A~%" obj 'vector3s)
(format #t "~Tdata[3] @ #x~X~%" (-> obj data))
(format #t "~Tx: ~f~%" (-> obj data 0))
(format #t "~Ty: ~f~%" (-> obj data 1))
(format #t "~Tz: ~f~%" (-> obj data 2))
obj
)
;; definition for function vector-dot
;; WARN: Unsupported inline assembly instruction kind - [mula.s f0, f3]
;; WARN: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; WARN: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defun vector-dot ((arg0 vector) (arg1 vector))
(local-vars (f0-1 float))
(let ((f0-0 (-> arg0 x))
(f1-0 (-> arg0 y))
(f2-0 (-> arg0 z))
(f3-0 (-> arg1 x))
(f4-0 (-> arg1 y))
(f5-0 (-> arg1 z))
)
(.mula.s f0-0 f3-0)
(.madda.s f1-0 f4-0)
(.madd.s f0-1 f2-0 f5-0)
)
f0-1
)
;; definition for function vector-dot-vu
(defun vector-dot-vu ((arg0 vector) (arg1 vector))
(local-vars (v0-0 float))
(rlet ((vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf1 (&-> arg0 quad))
(.lvf vf2 (&-> arg1 quad))
(.mul.vf vf1 vf1 vf2)
(.add.y.vf vf1 vf1 vf1 :mask #b1)
(.add.z.vf vf1 vf1 vf1 :mask #b1)
(.mov v0-0 vf1)
v0-0
)
)
;; definition for function vector4-dot
;; WARN: Unsupported inline assembly instruction kind - [mula.s f0, f4]
;; WARN: Unsupported inline assembly instruction kind - [madda.s f1, f5]
;; WARN: Unsupported inline assembly instruction kind - [madda.s f2, f6]
;; WARN: Unsupported inline assembly instruction kind - [madd.s f0, f3, f7]
(defun vector4-dot ((arg0 vector) (arg1 vector))
(local-vars (f0-1 float))
(let ((f0-0 (-> arg0 x))
(f1-0 (-> arg0 y))
(f2-0 (-> arg0 z))
(f3-0 (-> arg0 w))
(f4-0 (-> arg1 x))
(f5-0 (-> arg1 y))
(f6-0 (-> arg1 z))
(f7-0 (-> arg1 w))
)
(.mula.s f0-0 f4-0)
(.madda.s f1-0 f5-0)
(.madda.s f2-0 f6-0)
(.madd.s f0-1 f3-0 f7-0)
)
f0-1
)
;; definition for function vector4-dot-vu
(defun vector4-dot-vu ((arg0 vector) (arg1 vector))
(local-vars (v0-0 float))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(.lvf vf1 (&-> arg0 quad))
(.lvf vf2 (&-> arg1 quad))
(.mul.vf vf1 vf1 vf2)
(.add.w.vf vf3 vf0 vf0 :mask #b1)
(.mul.x.vf acc vf3 vf1 :mask #b1)
(.add.mul.y.vf acc vf3 vf1 acc :mask #b1)
(.add.mul.z.vf acc vf3 vf1 acc :mask #b1)
(.add.mul.w.vf vf1 vf3 vf1 acc :mask #b1)
(.mov v0-0 vf1)
v0-0
)
)
;; definition for function vector+!
(defun vector+! ((arg0 vector) (arg1 vector) (arg2 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> arg1 quad))
(.lvf vf5 (&-> arg2 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> arg0 quad) vf6)
arg0
)
)
;; definition for function vector-!
(defun vector-! ((arg0 vector) (arg1 vector) (arg2 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(.lvf vf4 (&-> arg1 quad))
(.lvf vf5 (&-> arg2 quad))
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> arg0 quad) vf6)
arg0
)
)
;; definition for function vector-zero!
;; Used lq/sq
(defun vector-zero! ((arg0 vector))
(set! (-> arg0 quad) (the-as uint128 0))
arg0
)
;; definition for function vector-reset!
(defun vector-reset! ((arg0 vector))
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(.svf (&-> arg0 quad) vf0)
arg0
)
)
;; definition for function vector-copy!
;; Used lq/sq
(defun vector-copy! ((arg0 vector) (arg1 vector))
(set! (-> arg0 quad) (-> arg1 quad))
arg0
)
;; definition for symbol *zero-vector*, type vector
(define *zero-vector* (new 'static 'vector))