mirror of
https://github.com/open-goal/jak-project
synced 2026-09-06 11:20:54 -04:00
[OpenGOAL] make multiplication/divsion like GOAL and support in decompiler (#483)
* support in compiler * multiplication in the decompiler * update divisions
This commit is contained in:
@@ -41,9 +41,7 @@
|
||||
dma-bucket-insert-tag
|
||||
((base dma-bucket) (idx int) (tag-start pointer) (tag-end (pointer dma-tag)))
|
||||
(let
|
||||
((bucket
|
||||
(the-as dma-bucket (+ (the-as uint base) (the-as uint (shl idx 4))))
|
||||
)
|
||||
((bucket (the-as dma-bucket (+ (the-as uint base) (the-as uint (* idx 16)))))
|
||||
)
|
||||
(set! (-> (the-as dma-bucket (-> bucket last)) next) (the-as uint tag-start))
|
||||
(set! (-> bucket last) tag-end)
|
||||
@@ -54,6 +52,3 @@
|
||||
;; failed to figure out what this is:
|
||||
(let ((v0-0 0))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -161,17 +161,13 @@
|
||||
)
|
||||
(set!
|
||||
(-> buf-ptr vif1)
|
||||
(new 'static 'vif-tag
|
||||
:cmd (vif-cmd mpg)
|
||||
:num (shl qwc-now 1)
|
||||
:imm origin
|
||||
)
|
||||
(new 'static 'vif-tag :cmd (vif-cmd mpg) :num (* qwc-now 2) :imm origin)
|
||||
)
|
||||
(set! (-> dma-buf-2 base) (&+ (the-as pointer buf-ptr) 16))
|
||||
)
|
||||
(&+! func-ptr (shl qwc-now 4))
|
||||
(&+! func-ptr (* qwc-now 16))
|
||||
(set! qlen (- qlen qwc-now))
|
||||
(+! origin (shl qwc-now 1))
|
||||
(+! origin (* qwc-now 2))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -211,8 +207,3 @@
|
||||
(dma-send-chain arg0 (the-as uint (-> arg1 data)))
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -268,11 +268,11 @@
|
||||
(format
|
||||
stream
|
||||
" #x~X: #x~2X #x~2X #x~2X #x~2X~%"
|
||||
(+ (+ (shl i 2) 4) (the-as int data))
|
||||
(-> data-ptr (shl i 2))
|
||||
(-> data-ptr (+ (shl i 2) 1))
|
||||
(-> data-ptr (+ (shl i 2) 2))
|
||||
(-> data-ptr (+ (shl i 2) 3))
|
||||
(+ (+ (* i 4) 4) (the-as int data))
|
||||
(-> data-ptr (* i 4))
|
||||
(-> data-ptr (+ (* i 4) 1))
|
||||
(-> data-ptr (+ (* i 4) 2))
|
||||
(-> data-ptr (+ (* i 4) 3))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -299,11 +299,11 @@
|
||||
(format
|
||||
stream
|
||||
" #x~X: #x~8x #x~8x #x~8x #x~8x~%"
|
||||
(+ (+ (shl s2-2 4) 4) (the-as int data))
|
||||
(-> s3-2 (shl s2-2 2))
|
||||
(-> s3-2 (+ (shl s2-2 2) 1))
|
||||
(-> s3-2 (+ (shl s2-2 2) 2))
|
||||
(-> s3-2 (+ (shl s2-2 2) 3))
|
||||
(+ (+ (* s2-2 16) 4) (the-as int data))
|
||||
(-> s3-2 (* s2-2 4))
|
||||
(-> s3-2 (+ (* s2-2 4) 1))
|
||||
(-> s3-2 (+ (* s2-2 4) 2))
|
||||
(-> s3-2 (+ (* s2-2 4) 3))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -314,11 +314,11 @@
|
||||
(format
|
||||
stream
|
||||
" #x~X: #x~4x #x~4x #x~4x #x~4x~%"
|
||||
(+ (+ (shl s2-3 3) 4) (the-as int data))
|
||||
(-> s3-3 (shl s2-3 2))
|
||||
(-> s3-3 (+ (shl s2-3 2) 1))
|
||||
(-> s3-3 (+ (shl s2-3 2) 2))
|
||||
(-> s3-3 (+ (shl s2-3 2) 3))
|
||||
(+ (+ (* s2-3 8) 4) (the-as int data))
|
||||
(-> s3-3 (* s2-3 4))
|
||||
(-> s3-3 (+ (* s2-3 4) 1))
|
||||
(-> s3-3 (+ (* s2-3 4) 2))
|
||||
(-> s3-3 (+ (* s2-3 4) 3))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -357,7 +357,7 @@
|
||||
(format
|
||||
stream
|
||||
" #x~X: #x~4x #x~4x~%"
|
||||
(+ (+ (shl s2-6 2) 4) (the-as int data))
|
||||
(+ (+ (* s2-6 4) 4) (the-as int data))
|
||||
(-> (&+ s3-6 (* 6 s2-6)) 0)
|
||||
(-> s3-6 (+ (* 3 s2-6) 1))
|
||||
)
|
||||
@@ -389,7 +389,7 @@
|
||||
(unpack-imm vif-unpack-imm)
|
||||
)
|
||||
(let ((byte-idx 0))
|
||||
(while (< byte-idx (shl words 2))
|
||||
(while (< byte-idx (* words 4))
|
||||
(let ((packet-size 4))
|
||||
(let ((first-tag (-> data 0)))
|
||||
(format stream " #x~X:" data)
|
||||
@@ -481,7 +481,7 @@
|
||||
(set! packet-size #x100000)
|
||||
(set!
|
||||
packet-size
|
||||
(the-as int (shl (the-as int (-> first-tag imm)) 4))
|
||||
(the-as int (* (-> first-tag imm) 16))
|
||||
)
|
||||
)
|
||||
(format
|
||||
@@ -497,11 +497,11 @@
|
||||
(format
|
||||
stream
|
||||
" #x~X: #x~8x #x~8x #x~8x #x~8x~%"
|
||||
(+ (+ (shl data-idx 4) 4) (the-as int data))
|
||||
(-> data-ptr (shl data-idx 2))
|
||||
(-> data-ptr (+ (shl data-idx 2) 1))
|
||||
(-> data-ptr (+ (shl data-idx 2) 2))
|
||||
(-> data-ptr (+ (shl data-idx 2) 3))
|
||||
(+ (+ (* data-idx 16) 4) (the-as int data))
|
||||
(-> data-ptr (* data-idx 4))
|
||||
(-> data-ptr (+ (* data-idx 4) 1))
|
||||
(-> data-ptr (+ (* data-idx 4) 2))
|
||||
(-> data-ptr (+ (* data-idx 4) 3))
|
||||
)
|
||||
(set! data-idx (+ data-idx 1))
|
||||
)
|
||||
@@ -578,7 +578,7 @@
|
||||
(&+! data packet-size)
|
||||
)
|
||||
)
|
||||
(- byte-idx (shl words 2))
|
||||
(- byte-idx (* words 4))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -744,10 +744,7 @@
|
||||
(pointer vif-tag)
|
||||
(+ (the-as uint addr) (the-as uint v0-9))
|
||||
)
|
||||
(the-as
|
||||
int
|
||||
(- (shl (the-as int qwc) 2) (the-as uint (sar v0-9 2)))
|
||||
)
|
||||
(the-as int (- (* qwc 4) (the-as uint (/ v0-9 4))))
|
||||
stream-2
|
||||
(= mode-2 'details)
|
||||
)
|
||||
@@ -772,7 +769,7 @@
|
||||
(pointer vif-tag)
|
||||
(&-> (the-as (pointer uint64) data-2) 1)
|
||||
)
|
||||
(the-as int (+ (shl (the-as int qwc) 2) 2))
|
||||
(the-as int (+ (* qwc 4) 2))
|
||||
stream-2
|
||||
(= mode-2 'details)
|
||||
)
|
||||
@@ -783,10 +780,7 @@
|
||||
dma-packet
|
||||
(+
|
||||
(the-as uint data-2)
|
||||
(the-as
|
||||
uint
|
||||
(shl (the-as int (+ (the-as uint qwc) (the-as uint 1))) 4)
|
||||
)
|
||||
(the-as uint (* (+ (the-as uint qwc) (the-as uint 1)) 16))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -802,7 +796,7 @@
|
||||
(pointer vif-tag)
|
||||
(&-> (the-as (pointer uint64) data-2) 1)
|
||||
)
|
||||
(the-as int (+ (shl (the-as int qwc) 2) 2))
|
||||
(the-as int (+ (* qwc 4) 2))
|
||||
stream-2
|
||||
(= mode-2 'details)
|
||||
)
|
||||
@@ -826,7 +820,7 @@
|
||||
(pointer vif-tag)
|
||||
(&-> (the-as (pointer uint64) data-2) 1)
|
||||
)
|
||||
(the-as int (+ (shl (the-as int qwc) 2) 2))
|
||||
(the-as int (+ (* qwc 4) 2))
|
||||
stream-2
|
||||
(= mode-2 'details)
|
||||
)
|
||||
@@ -855,7 +849,7 @@
|
||||
(pointer vif-tag)
|
||||
(&-> (the-as (pointer uint64) data-2) 1)
|
||||
)
|
||||
(the-as int (+ (shl (the-as int qwc) 2) 2))
|
||||
(the-as int (+ (* qwc 4) 2))
|
||||
stream-2
|
||||
(= mode-2 'details)
|
||||
)
|
||||
@@ -891,7 +885,7 @@
|
||||
(pointer vif-tag)
|
||||
(&-> (the-as (pointer uint64) data-2) 1)
|
||||
)
|
||||
(the-as int (+ (shl (the-as int qwc) 2) 2))
|
||||
(the-as int (+ (* qwc 4) 2))
|
||||
stream-2
|
||||
(= mode-2 'details)
|
||||
)
|
||||
|
||||
@@ -294,18 +294,18 @@
|
||||
0
|
||||
"~4,'0X: ~8,'0X ~8,'0X ~8,'0X ~8,'0X"
|
||||
s5-0
|
||||
(-> gp-0 (shl s5-0 2))
|
||||
(-> gp-0 (+ (shl s5-0 2) 1))
|
||||
(-> gp-0 (+ (shl s5-0 2) 2))
|
||||
(-> gp-0 (+ (shl s5-0 2) 3))
|
||||
(-> gp-0 (* s5-0 4))
|
||||
(-> gp-0 (+ (* s5-0 4) 1))
|
||||
(-> gp-0 (+ (* s5-0 4) 2))
|
||||
(-> gp-0 (+ (* s5-0 4) 3))
|
||||
)
|
||||
(format
|
||||
0
|
||||
" ~F ~F ~F ~F ~%"
|
||||
(-> gp-0 (shl s5-0 2))
|
||||
(-> gp-0 (+ (shl s5-0 2) 1))
|
||||
(-> gp-0 (+ (shl s5-0 2) 2))
|
||||
(-> gp-0 (+ (shl s5-0 2) 3))
|
||||
(-> gp-0 (* s5-0 4))
|
||||
(-> gp-0 (+ (* s5-0 4) 1))
|
||||
(-> gp-0 (+ (* s5-0 4) 2))
|
||||
(-> gp-0 (+ (* s5-0 4) 3))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -321,18 +321,18 @@
|
||||
0
|
||||
"~4,'0X: ~8x ~8x ~8x ~8x"
|
||||
s2-0
|
||||
(-> s4-0 (shl s2-0 2))
|
||||
(-> s4-0 (+ (shl s2-0 2) 1))
|
||||
(-> s4-0 (+ (shl s2-0 2) 2))
|
||||
(-> s4-0 (+ (shl s2-0 2) 3))
|
||||
(-> s4-0 (* s2-0 4))
|
||||
(-> s4-0 (+ (* s2-0 4) 1))
|
||||
(-> s4-0 (+ (* s2-0 4) 2))
|
||||
(-> s4-0 (+ (* s2-0 4) 3))
|
||||
)
|
||||
(format
|
||||
0
|
||||
" ~F ~F ~F ~F ~%"
|
||||
(-> s4-0 (shl s2-0 2))
|
||||
(-> s4-0 (+ (shl s2-0 2) 1))
|
||||
(-> s4-0 (+ (shl s2-0 2) 2))
|
||||
(-> s4-0 (+ (shl s2-0 2) 3))
|
||||
(-> s4-0 (* s2-0 4))
|
||||
(-> s4-0 (+ (* s2-0 4) 1))
|
||||
(-> s4-0 (+ (* s2-0 4) 2))
|
||||
(-> s4-0 (+ (* s2-0 4) 3))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -385,7 +385,7 @@
|
||||
(set! (-> spr-to-bank chcr) (new 'static 'dma-chcr :str #x1))
|
||||
(.sync.l)
|
||||
(dma-sync (the-as pointer spr-to-bank) 0 0)
|
||||
(&+! src (shl qwc-transferred-now 4))
|
||||
(&+! src (* qwc-transferred-now 16))
|
||||
(set! (-> spr-from-bank madr) (the-as uint dst))
|
||||
(set! (-> spr-from-bank sadr) (the-as uint 0))
|
||||
(set! (-> spr-from-bank qwc) (the-as uint qwc-transferred-now))
|
||||
@@ -393,7 +393,7 @@
|
||||
(set! (-> spr-from-bank chcr) (new 'static 'dma-chcr :str #x1))
|
||||
(.sync.l)
|
||||
(dma-sync (the-as pointer spr-from-bank) 0 0)
|
||||
(&+! dst (shl qwc-transferred-now 4))
|
||||
(&+! dst (* qwc-transferred-now 16))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -410,9 +410,3 @@
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(dma-initialize)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -167,10 +167,7 @@
|
||||
(object-new
|
||||
allocation
|
||||
type-to-make
|
||||
(the-as
|
||||
int
|
||||
(+ (-> type-to-make size) (the-as uint (shl (+ length -1) 5)))
|
||||
)
|
||||
(the-as int (+ (-> type-to-make size) (the-as uint (* (+ length -1) 32))))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -291,7 +288,7 @@
|
||||
(defmethod asize-of engine ((obj engine))
|
||||
(the-as
|
||||
int
|
||||
(+ (-> engine size) (the-as uint (shl (+ (-> obj allocated-length) -1) 5)))
|
||||
(+ (-> engine size) (the-as uint (* (+ (-> obj allocated-length) -1) 32)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -542,7 +539,3 @@
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -104,32 +104,14 @@
|
||||
(height (-> *video-parms* screen-sy))
|
||||
(file (new 'debug 'file-stream "image.raw" 'write))
|
||||
)
|
||||
(let ((buff0 (new 'debug 'boxed-array uint128 (sar (* width height) 2))))
|
||||
(let ((buff1 (new 'debug 'boxed-array uint128 (sar (* width height) 2))))
|
||||
(let ((buff0 (new 'debug 'boxed-array uint128 (/ (* width height) 4))))
|
||||
(let ((buff1 (new 'debug 'boxed-array uint128 (/ (* width height) 4))))
|
||||
(let ((packet (new 'static 'gs-store-image-packet)))
|
||||
(gs-set-default-store-image
|
||||
packet
|
||||
#x2800
|
||||
(sar width 6)
|
||||
0
|
||||
0
|
||||
0
|
||||
width
|
||||
height
|
||||
)
|
||||
(gs-set-default-store-image packet #x2800 (/ width 64) 0 0 0 width height)
|
||||
(flush-cache 0)
|
||||
(gs-store-image packet (-> buff0 data))
|
||||
(sync-path 0 0)
|
||||
(gs-set-default-store-image
|
||||
packet
|
||||
#x3000
|
||||
(sar width 6)
|
||||
0
|
||||
0
|
||||
0
|
||||
width
|
||||
height
|
||||
)
|
||||
(gs-set-default-store-image packet #x3000 (/ width 64) 0 0 0 width height)
|
||||
(flush-cache 0)
|
||||
(gs-store-image packet (-> buff1 data))
|
||||
)
|
||||
@@ -142,13 +124,13 @@
|
||||
(while (< y-idx height)
|
||||
(file-stream-write
|
||||
file
|
||||
(&+ ptr-0 (* y-idx (shl width 2)))
|
||||
(the-as uint (shl width 2))
|
||||
(&+ ptr-0 (* y-idx (* width 4)))
|
||||
(the-as uint (* width 4))
|
||||
)
|
||||
(file-stream-write
|
||||
file
|
||||
(&+ ptr-1 (* y-idx (shl width 2)))
|
||||
(the-as uint (shl width 2))
|
||||
(&+ ptr-1 (* y-idx (* width 4)))
|
||||
(the-as uint (* width 4))
|
||||
)
|
||||
(set! y-idx (+ y-idx 1))
|
||||
)
|
||||
@@ -158,13 +140,13 @@
|
||||
(while (< y-idx-2 height)
|
||||
(file-stream-write
|
||||
file
|
||||
(&+ ptr-1 (* y-idx-2 (shl width 2)))
|
||||
(the-as uint (shl width 2))
|
||||
(&+ ptr-1 (* y-idx-2 (* width 4)))
|
||||
(the-as uint (* width 4))
|
||||
)
|
||||
(file-stream-write
|
||||
file
|
||||
(&+ ptr-0 (* y-idx-2 (shl width 2)))
|
||||
(the-as uint (shl width 2))
|
||||
(&+ ptr-0 (* y-idx-2 (* width 4)))
|
||||
(the-as uint (* width 4))
|
||||
)
|
||||
(set! y-idx-2 (+ y-idx-2 1))
|
||||
)
|
||||
@@ -182,6 +164,3 @@
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -778,7 +778,7 @@
|
||||
:th (log2 (-> tex h))
|
||||
:tw (log2 (-> tex w))
|
||||
:tbw (-> tex width 0)
|
||||
:tbp0 (sar tex-addr 6)
|
||||
:tbp0 (/ (the-as int tex-addr) 64)
|
||||
:psm psm
|
||||
)
|
||||
)
|
||||
|
||||
@@ -805,8 +805,8 @@
|
||||
(format #t "~Teop : ~4d~%" (shr (shl (the-as int gp-0) 48) 63))
|
||||
(format #t "~Tid : ~4d~%" (shr (shl (the-as int gp-0) 18) 50))
|
||||
(format #t "~Tpre : ~4d~%" (shr (shl (the-as int gp-0) 17) 63))
|
||||
(format #t "~Tprim : ~4d~%" (shr (shl (the-as int gp-0) 6) 53))
|
||||
(format #t "~Tflg : ~4d~%" (shr (shl (the-as int gp-0) 4) 62))
|
||||
(format #t "~Tprim : ~4d~%" (shr (* gp-0 64) 53))
|
||||
(format #t "~Tflg : ~4d~%" (shr (* gp-0 16) 62))
|
||||
(format #t "~Tnreg : ~4d~%" (shr (the-as int gp-0) 60))
|
||||
(let ((t9-8 format)
|
||||
(a0-9 #t)
|
||||
@@ -905,14 +905,14 @@
|
||||
(a1-21 "~Tregs13: ~4d~%")
|
||||
)
|
||||
(.pcpyud v1-31 gp-0 r0-0)
|
||||
(t9-21 a0-22 a1-21 (shr (shl (the-as int v1-31) 8) 60))
|
||||
(t9-21 a0-22 a1-21 (shr (* v1-31 256) 60))
|
||||
)
|
||||
(let ((t9-22 format)
|
||||
(a0-23 #t)
|
||||
(a1-22 "~Tregs14: ~4d~%")
|
||||
)
|
||||
(.pcpyud v1-33 gp-0 r0-0)
|
||||
(t9-22 a0-23 a1-22 (shr (shl (the-as int v1-33) 4) 60))
|
||||
(t9-22 a0-23 a1-22 (shr (* v1-33 16) 60))
|
||||
)
|
||||
(let ((t9-23 format)
|
||||
(a0-24 #t)
|
||||
@@ -1053,7 +1053,7 @@
|
||||
(object-new
|
||||
allocation
|
||||
type-to-make
|
||||
(the-as int (+ (-> type-to-make size) (the-as uint (shl (+ arg0 -1) 3))))
|
||||
(the-as int (+ (-> type-to-make size) (the-as uint (* (+ arg0 -1) 8))))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1072,7 +1072,7 @@
|
||||
(-> tag regs)
|
||||
(logior
|
||||
(-> tag regs)
|
||||
(the-as uint (ash reg-idx (shl (-> packet reg-count) 2)))
|
||||
(the-as uint (ash reg-idx (* (-> packet reg-count) 4)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
(set! (-> s5-0 z) f0-2)
|
||||
)
|
||||
)
|
||||
(when (= (logand (sar (the int (-> s5-0 w)) 2) 1) 1)
|
||||
(when (= (logand (/ (the int (-> s5-0 w)) 4) 1) 1)
|
||||
(set! (-> s5-0 x) (- (-> s5-0 x)))
|
||||
(set! (-> s5-0 y) (- (-> s5-0 y)))
|
||||
(set! (-> s5-0 z) (- (-> s5-0 z)))
|
||||
@@ -46,18 +46,18 @@
|
||||
)
|
||||
(let ((v1-9 0))
|
||||
)
|
||||
(let* ((v1-12 (logand (sar (the int (-> s5-0 w)) 2) 1))
|
||||
(a1-2 (-> EulSafe (logand (sar (the int (-> s5-0 w)) 3) 3)))
|
||||
(let* ((v1-12 (logand (/ (the int (-> s5-0 w)) 4) 1))
|
||||
(a1-2 (-> EulSafe (logand (/ (the int (-> s5-0 w)) 8) 3)))
|
||||
(a0-21 (-> EulNext (+ a1-2 v1-12)))
|
||||
(v1-17 (-> EulNext (+ (- 1 v1-12) a1-2)))
|
||||
)
|
||||
(cond
|
||||
((= (logand (sar (the int (-> s5-0 w)) 1) 1) 1)
|
||||
((= (logand (/ (the int (-> s5-0 w)) 2) 1) 1)
|
||||
(set!
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a1-2 4) (shl a1-2 2)) (the-as int arg0))
|
||||
(+ (+ (* a1-2 16) (* a1-2 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
f30-0
|
||||
@@ -66,7 +66,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a1-2 4) (shl a0-21 2)) (the-as int arg0))
|
||||
(+ (+ (* a1-2 16) (* a0-21 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(* f28-0 f24-0)
|
||||
@@ -75,7 +75,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a1-2 4) (shl v1-17 2)) (the-as int arg0))
|
||||
(+ (+ (* a1-2 16) (* v1-17 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(* f28-0 f26-0)
|
||||
@@ -84,7 +84,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a0-21 4) (shl a1-2 2)) (the-as int arg0))
|
||||
(+ (+ (* a0-21 16) (* a1-2 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(* f28-0 f4-0)
|
||||
@@ -93,7 +93,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a0-21 4) (shl a0-21 2)) (the-as int arg0))
|
||||
(+ (+ (* a0-21 16) (* a0-21 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(- f0-17 (* f30-0 f3-0))
|
||||
@@ -102,7 +102,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a0-21 4) (shl v1-17 2)) (the-as int arg0))
|
||||
(+ (+ (* a0-21 16) (* v1-17 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(- (- f2-0) (* f30-0 f1-1))
|
||||
@@ -111,7 +111,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-17 4) (shl a1-2 2)) (the-as int arg0))
|
||||
(+ (+ (* v1-17 16) (* a1-2 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(- (* f28-0 f22-0))
|
||||
@@ -120,7 +120,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-17 4) (shl a0-21 2)) (the-as int arg0))
|
||||
(+ (+ (* v1-17 16) (* a0-21 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(+ f1-1 (* f30-0 f2-0))
|
||||
@@ -129,7 +129,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-17 4) (shl v1-17 2)) (the-as int arg0))
|
||||
(+ (+ (* v1-17 16) (* v1-17 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(+ (- f3-0) (* f30-0 f0-17))
|
||||
@@ -140,7 +140,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a1-2 4) (shl a1-2 2)) (the-as int arg0))
|
||||
(+ (+ (* a1-2 16) (* a1-2 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(* f30-0 f22-0)
|
||||
@@ -149,7 +149,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a1-2 4) (shl a0-21 2)) (the-as int arg0))
|
||||
(+ (+ (* a1-2 16) (* a0-21 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(+ (- f1-1) (* f28-0 f2-0))
|
||||
@@ -158,7 +158,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a1-2 4) (shl v1-17 2)) (the-as int arg0))
|
||||
(+ (+ (* a1-2 16) (* v1-17 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(+ f3-0 (* f28-0 f0-17))
|
||||
@@ -167,7 +167,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a0-21 4) (shl a1-2 2)) (the-as int arg0))
|
||||
(+ (+ (* a0-21 16) (* a1-2 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(* f30-0 f4-0)
|
||||
@@ -176,7 +176,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a0-21 4) (shl a0-21 2)) (the-as int arg0))
|
||||
(+ (+ (* a0-21 16) (* a0-21 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(+ f0-17 (* f28-0 f3-0))
|
||||
@@ -185,7 +185,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a0-21 4) (shl v1-17 2)) (the-as int arg0))
|
||||
(+ (+ (* a0-21 16) (* v1-17 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(+ (- f2-0) (* f28-0 f1-1))
|
||||
@@ -194,7 +194,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-17 4) (shl a1-2 2)) (the-as int arg0))
|
||||
(+ (+ (* v1-17 16) (* a1-2 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(- f28-0)
|
||||
@@ -203,7 +203,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-17 4) (shl a0-21 2)) (the-as int arg0))
|
||||
(+ (+ (* v1-17 16) (* a0-21 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(* f30-0 f24-0)
|
||||
@@ -212,7 +212,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-17 4) (shl v1-17 2)) (the-as int arg0))
|
||||
(+ (+ (* v1-17 16) (* v1-17 4)) (the-as int arg0))
|
||||
)
|
||||
)
|
||||
(* f30-0 f26-0)
|
||||
@@ -233,19 +233,19 @@
|
||||
)
|
||||
(let ((v1-2 0))
|
||||
)
|
||||
(let* ((v1-4 (logand (sar arg2 2) 1))
|
||||
(s3-0 (-> EulSafe (logand (sar arg2 3) 3)))
|
||||
(let* ((v1-4 (logand (/ arg2 4) 1))
|
||||
(s3-0 (-> EulSafe (logand (/ arg2 8) 3)))
|
||||
(s2-0 (-> EulNext (+ s3-0 v1-4)))
|
||||
(s1-0 (-> EulNext (+ (- 1 v1-4) s3-0)))
|
||||
)
|
||||
(cond
|
||||
((= (logand (sar arg2 1) 1) 1)
|
||||
((= (logand (/ arg2 2) 1) 1)
|
||||
(let*
|
||||
((f0-0
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s2-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -254,7 +254,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s1-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -268,13 +268,13 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s2-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s1-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -286,7 +286,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -297,14 +297,14 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(-
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s1-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -319,14 +319,14 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s1-0 2) (shl s2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s1-0 4) (* s2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s2-0 2) (shl s2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s2-0 4) (* s2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -338,7 +338,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -354,7 +354,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -363,7 +363,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -377,13 +377,13 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s2-0 2) (shl s1-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s2-0 4) (* s1-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s1-0 2) (shl s1-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s1-0 4) (* s1-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -395,7 +395,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s1-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -408,13 +408,13 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -428,14 +428,14 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s1-0 2) (shl s2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s1-0 4) (* s2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s2-0 2) (shl s2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s2-0 4) (* s2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -447,7 +447,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl s3-0 2) (shl s1-0 4)) (the-as int arg1))
|
||||
(+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -461,7 +461,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (= (logand (sar arg2 2) 1) 1)
|
||||
(when (= (logand (/ arg2 4) 1) 1)
|
||||
(set! (-> arg0 x) (- (-> arg0 x)))
|
||||
(set! (-> arg0 y) (- (-> arg0 y)))
|
||||
(set! (-> arg0 z) (- (-> arg0 z)))
|
||||
|
||||
@@ -481,7 +481,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a2-0 2) (shl a2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* a2-0 4) (* a2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(-> arg1 data 10)
|
||||
@@ -500,13 +500,13 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a3-0 2) (shl a3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* a3-0 4) (* a3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-1 2) (shl v1-1 4)) (the-as int arg1))
|
||||
(+ (+ (* v1-1 4) (* v1-1 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -514,7 +514,7 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a2-0 2) (shl a2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* a2-0 4) (* a2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -522,7 +522,7 @@
|
||||
)
|
||||
)
|
||||
(set!
|
||||
(-> (the-as (pointer float) (+ (shl a2-0 2) (the-as int arg0))))
|
||||
(-> (the-as (pointer float) (+ (* a2-0 4) (the-as int arg0))))
|
||||
(* 0.5 f0-12)
|
||||
)
|
||||
(if (!= f0-12 0.0)
|
||||
@@ -535,13 +535,13 @@
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-1 2) (shl a3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* v1-1 4) (* a3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a3-0 2) (shl v1-1 4)) (the-as int arg1))
|
||||
(+ (+ (* a3-0 4) (* v1-1 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -549,19 +549,19 @@
|
||||
)
|
||||
)
|
||||
(set!
|
||||
(-> (the-as (pointer float) (+ (shl a3-0 2) (the-as int arg0))))
|
||||
(-> (the-as (pointer float) (+ (* a3-0 4) (the-as int arg0))))
|
||||
(*
|
||||
(+
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a3-0 2) (shl a2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* a3-0 4) (* a2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a2-0 2) (shl a3-0 4)) (the-as int arg1))
|
||||
(+ (+ (* a2-0 4) (* a3-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -569,19 +569,19 @@
|
||||
)
|
||||
)
|
||||
(set!
|
||||
(-> (the-as (pointer float) (+ (shl v1-1 2) (the-as int arg0))))
|
||||
(-> (the-as (pointer float) (+ (* v1-1 4) (the-as int arg0))))
|
||||
(*
|
||||
(+
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl v1-1 2) (shl a2-0 4)) (the-as int arg1))
|
||||
(+ (+ (* v1-1 4) (* a2-0 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
(->
|
||||
(the-as
|
||||
(pointer float)
|
||||
(+ (+ (shl a2-0 2) (shl v1-1 4)) (the-as int arg1))
|
||||
(+ (+ (* a2-0 4) (* v1-1 16)) (the-as int arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
allocation
|
||||
type-to-make
|
||||
(+
|
||||
(+ (sar (logand -8 (+ length 7)) 3) -1)
|
||||
(+ (/ (logand -8 (+ length 7)) 8) -1)
|
||||
(the-as int (-> type-to-make size))
|
||||
)
|
||||
)
|
||||
@@ -60,14 +60,14 @@
|
||||
int
|
||||
(+
|
||||
(-> obj type size)
|
||||
(the-as uint (sar (logand -8 (+ (-> obj allocated-length) 7)) 3))
|
||||
(the-as uint (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; 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))))
|
||||
(let ((v1-2 (-> obj bytes (/ arg0 8))))
|
||||
(nonzero? (logand v1-2 (the-as uint (ash 1 (logand arg0 7)))))
|
||||
)
|
||||
)
|
||||
@@ -75,9 +75,9 @@
|
||||
;; definition for method 10 of type bit-array
|
||||
(defmethod clear-bit bit-array ((obj bit-array) (arg0 int))
|
||||
(set!
|
||||
(-> obj bytes (sar arg0 3))
|
||||
(-> obj bytes (/ arg0 8))
|
||||
(logand
|
||||
(-> obj bytes (sar arg0 3))
|
||||
(-> obj bytes (/ arg0 8))
|
||||
(the-as uint (lognot (ash 1 (logand arg0 7))))
|
||||
)
|
||||
)
|
||||
@@ -87,15 +87,15 @@
|
||||
;; 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))))
|
||||
(-> obj bytes (/ arg0 8))
|
||||
(logior (-> obj bytes (/ arg0 8)) (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)))
|
||||
(let ((idx (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)))
|
||||
(while (nonzero? idx)
|
||||
(+! idx -1)
|
||||
(nop!)
|
||||
@@ -963,7 +963,3 @@
|
||||
|
||||
;; definition for symbol *zero-vector*, type vector
|
||||
(define *zero-vector* (new 'static 'vector))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user