diff options
author | colin <colin@cicadas.surf> | 2024-06-01 10:30:48 -0700 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-06-01 10:30:48 -0700 |
commit | ee76182976c0f5e45ab7e2adb792bf016fde07f2 (patch) | |
tree | a088b85de6579942a26561f72a903d472f7f2615 | |
parent | c169d4fd94660039be481e41d740983beaa066ae (diff) |
Update: instr fetcher to output to src/raw-instrs.lisp
-rw-r--r-- | fetch-wasm-instrs.lisp | 18 | ||||
-rw-r--r-- | src/raw-instrs.lisp | 69 |
2 files changed, 60 insertions, 27 deletions
diff --git a/fetch-wasm-instrs.lisp b/fetch-wasm-instrs.lisp index 4735214..677f857 100644 --- a/fetch-wasm-instrs.lisp +++ b/fetch-wasm-instrs.lisp @@ -94,14 +94,24 @@ :when instr :collect (make-instr instr code type)))) -(format t "Fetching all instructions from~% ~a~%" +) +(format t "Fetching all instructions from~% ~a~%" + +source-url+) (let ((instrs (get-all-instructions))) - (format t "Writing to disk in ./instrs.sexp~%") - (with-open-file (out "instrs.sexp" + (format t "Writing to disk in ./src/raw-instrs.lisp~%") + (with-open-file (out "src/raw-instrs.lisp" :direction :output :if-exists :supersede :if-does-not-exist :create) - (write instrs :stream out))) + (princ " +(defpackage #:sarcasm.raw-instrs + (:use :cl) + (:export #:raw-instrs)) + +(in-package #:sarcasm.raw-instrs) +(defparameter raw-instrs + '" out) + (write instrs :stream out) + (princ ")" out))) (format t "DONE~%") (uiop:quit) diff --git a/src/raw-instrs.lisp b/src/raw-instrs.lisp index bdbde12..7fdbe66 100644 --- a/src/raw-instrs.lisp +++ b/src/raw-instrs.lisp @@ -1,3 +1,4 @@ + (defpackage #:sarcasm.raw-instrs (:use :cl) (:export #:raw-instrs)) @@ -12,7 +13,8 @@ (:INSTR ("else") :CODE NIL :TYPE NIL) (:INSTR ("end") :CODE NIL :TYPE NIL) (:INSTR ("br" "l") :CODE (12) :TYPE ((:|t1*| :|t*|) (:|t2*|))) (:INSTR ("brif" "l") :CODE (13) :TYPE ((:|t*| :I32) (:|t*|))) - (:INSTR ("brtable" "l^*" "l") :CODE (14) :TYPE ((:|t1*| :|t*| :I32) (:|t2*|))) + (:INSTR ("brtable" "l^*" "l") :CODE (14) :TYPE + ((:|t1*| :|t*| :I32) (:|t2*|))) (:INSTR ("return") :CODE (15) :TYPE ((:|t1*| :|t*|) (:|t2*|))) (:INSTR ("call" "x") :CODE (16) :TYPE ((:|t1*|) (:|t2*|))) (:INSTR ("callindirect" "x" "y") :CODE (17) :TYPE ((:|t1*| :I32) (:|t2*|))) @@ -212,9 +214,12 @@ (:INSTR ("v128.load32x2_s" "memarg") :CODE (253 5) :TYPE ((:I32) (:V128))) (:INSTR ("v128.load32x2_u" "memarg") :CODE (253 6) :TYPE ((:I32) (:V128))) (:INSTR ("v128.load8_splat" "memarg") :CODE (253 7) :TYPE ((:I32) (:V128))) - (:INSTR ("v128.load16_splat" "memarg") :CODE (253 8) :TYPE ((:I32) (:V128))) - (:INSTR ("v128.load32_splat" "memarg") :CODE (253 9) :TYPE ((:I32) (:V128))) - (:INSTR ("v128.load64_splat" "memarg") :CODE (253 10) :TYPE ((:I32) (:V128))) + (:INSTR ("v128.load16_splat" "memarg") :CODE (253 8) :TYPE + ((:I32) (:V128))) + (:INSTR ("v128.load32_splat" "memarg") :CODE (253 9) :TYPE + ((:I32) (:V128))) + (:INSTR ("v128.load64_splat" "memarg") :CODE (253 10) :TYPE + ((:I32) (:V128))) (:INSTR ("v128.store" "memarg") :CODE (253 11) :TYPE ((:I32 :V128) NIL)) (:INSTR ("v128.vconst" "i128") :CODE (253 12) :TYPE (NIL (:V128))) (:INSTR ("i8x16.shuffle" "laneidx^16") :CODE (253 13) :TYPE @@ -238,16 +243,20 @@ ((:V128) (:I32))) (:INSTR ("i16x8.replacelane" "laneidx") :CODE (253 26) :TYPE ((:V128 :I32) (:V128))) - (:INSTR ("i32x4.extractlane" "laneidx") :CODE (253 27) :TYPE ((:V128) (:I32))) + (:INSTR ("i32x4.extractlane" "laneidx") :CODE (253 27) :TYPE + ((:V128) (:I32))) (:INSTR ("i32x4.replacelane" "laneidx") :CODE (253 28) :TYPE ((:V128 :I32) (:V128))) - (:INSTR ("i64x2.extractlane" "laneidx") :CODE (253 29) :TYPE ((:V128) (:I64))) + (:INSTR ("i64x2.extractlane" "laneidx") :CODE (253 29) :TYPE + ((:V128) (:I64))) (:INSTR ("i64x2.replacelane" "laneidx") :CODE (253 30) :TYPE ((:V128 :I64) (:V128))) - (:INSTR ("f32x4.extractlane" "laneidx") :CODE (253 31) :TYPE ((:V128) (:F32))) + (:INSTR ("f32x4.extractlane" "laneidx") :CODE (253 31) :TYPE + ((:V128) (:F32))) (:INSTR ("f32x4.replacelane" "laneidx") :CODE (253 32) :TYPE ((:V128 :F32) (:V128))) - (:INSTR ("f64x2.extractlane" "laneidx") :CODE (253 33) :TYPE ((:V128) (:F64))) + (:INSTR ("f64x2.extractlane" "laneidx") :CODE (253 33) :TYPE + ((:V128) (:F64))) (:INSTR ("f64x2.replacelane" "laneidx") :CODE (253 34) :TYPE ((:V128 :F64) (:V128))) (:INSTR ("i8x16.veq") :CODE (253 35) :TYPE ((:V128 :V128) (:V128))) @@ -297,7 +306,8 @@ (:INSTR ("v128.vandnot") :CODE (253 79) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("v128.vor") :CODE (253 80) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("v128.vxor") :CODE (253 81) :TYPE ((:V128 :V128) (:V128))) - (:INSTR ("v128.bitselect") :CODE (253 82) :TYPE ((:V128 :V128 :V128) (:V128))) + (:INSTR ("v128.bitselect") :CODE (253 82) :TYPE + ((:V128 :V128 :V128) (:V128))) (:INSTR ("v128.anytrue") :CODE (253 83) :TYPE ((:V128) (:I32))) (:INSTR ("v128.load8_lane" "memarg" "laneidx") :CODE (253 84) :TYPE ((:I32 :V128) (:V128))) @@ -315,10 +325,14 @@ ((:I32 :V128) NIL)) (:INSTR ("v128.store64_lane" "memarg" "laneidx") :CODE (253 91) :TYPE ((:I32 :V128) NIL)) - (:INSTR ("v128.load32_zero" "memarg") :CODE (253 92) :TYPE ((:I32) (:V128))) - (:INSTR ("v128.load64_zero" "memarg") :CODE (253 93) :TYPE ((:I32) (:V128))) - (:INSTR ("f32x4.vdemote_f64x2_zero") :CODE (253 94) :TYPE ((:V128) (:V128))) - (:INSTR ("f64x2.vpromote_low_f32x4") :CODE (253 95) :TYPE ((:V128) (:V128))) + (:INSTR ("v128.load32_zero" "memarg") :CODE (253 92) :TYPE + ((:I32) (:V128))) + (:INSTR ("v128.load64_zero" "memarg") :CODE (253 93) :TYPE + ((:I32) (:V128))) + (:INSTR ("f32x4.vdemote_f64x2_zero") :CODE (253 94) :TYPE + ((:V128) (:V128))) + (:INSTR ("f64x2.vpromote_low_f32x4") :CODE (253 95) :TYPE + ((:V128) (:V128))) (:INSTR ("i8x16.vabs") :CODE (253 96) :TYPE ((:V128) (:V128))) (:INSTR ("i8x16.vneg") :CODE (253 97) :TYPE ((:V128) (:V128))) (:INSTR ("i8x16.vpopcnt") :CODE (253 98) :TYPE ((:V128) (:V128))) @@ -379,11 +393,15 @@ (:INSTR ("i16x8.vshr_s") :CODE (253 140 1) :TYPE ((:V128 :I32) (:V128))) (:INSTR ("i16x8.vshr_u") :CODE (253 141 1) :TYPE ((:V128 :I32) (:V128))) (:INSTR ("i16x8.vadd") :CODE (253 142 1) :TYPE ((:V128 :V128) (:V128))) - (:INSTR ("i16x8.vadd_sat_s") :CODE (253 143 1) :TYPE ((:V128 :V128) (:V128))) - (:INSTR ("i16x8.vadd_sat_u") :CODE (253 144 1) :TYPE ((:V128 :V128) (:V128))) + (:INSTR ("i16x8.vadd_sat_s") :CODE (253 143 1) :TYPE + ((:V128 :V128) (:V128))) + (:INSTR ("i16x8.vadd_sat_u") :CODE (253 144 1) :TYPE + ((:V128 :V128) (:V128))) (:INSTR ("i16x8.vsub") :CODE (253 145 1) :TYPE ((:V128 :V128) (:V128))) - (:INSTR ("i16x8.vsub_sat_s") :CODE (253 146 1) :TYPE ((:V128 :V128) (:V128))) - (:INSTR ("i16x8.vsub_sat_u") :CODE (253 147 1) :TYPE ((:V128 :V128) (:V128))) + (:INSTR ("i16x8.vsub_sat_s") :CODE (253 146 1) :TYPE + ((:V128 :V128) (:V128))) + (:INSTR ("i16x8.vsub_sat_u") :CODE (253 147 1) :TYPE + ((:V128 :V128) (:V128))) (:INSTR ("f64x2.vnearest") :CODE (253 148 1) :TYPE ((:V128) (:V128))) (:INSTR ("i16x8.vmul") :CODE (253 149 1) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("i16x8.vmin_s") :CODE (253 150 1) :TYPE ((:V128 :V128) (:V128))) @@ -421,7 +439,8 @@ (:INSTR ("i32x4.vmin_u") :CODE (253 183 1) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("i32x4.vmax_s") :CODE (253 184 1) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("i32x4.vmax_u") :CODE (253 185 1) :TYPE ((:V128 :V128) (:V128))) - (:INSTR ("i32x4.dot_i16x8_s") :CODE (253 186 1) :TYPE ((:V128 :V128) (:V128))) + (:INSTR ("i32x4.dot_i16x8_s") :CODE (253 186 1) :TYPE + ((:V128 :V128) (:V128))) (:INSTR ("i32x4.extmul_low_i16x8_s") :CODE (253 188 1) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("i32x4.extmul_high_i16x8_s") :CODE (253 189 1) :TYPE @@ -484,10 +503,14 @@ (:INSTR ("f64x2.vmax") :CODE (253 245 1) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("f64x2.vpmin") :CODE (253 246 1) :TYPE ((:V128 :V128) (:V128))) (:INSTR ("f64x2.vpmax") :CODE (253 247 1) :TYPE ((:V128 :V128) (:V128))) - (:INSTR ("i32x4.trunc_sat_f32x4_s") :CODE (253 248 1) :TYPE ((:V128) (:V128))) - (:INSTR ("i32x4.trunc_sat_f32x4_u") :CODE (253 249 1) :TYPE ((:V128) (:V128))) - (:INSTR ("f32x4.vconvert_i32x4_s") :CODE (253 250 1) :TYPE ((:V128) (:V128))) - (:INSTR ("f32x4.vconvert_i32x4_u") :CODE (253 251 1) :TYPE ((:V128) (:V128))) + (:INSTR ("i32x4.trunc_sat_f32x4_s") :CODE (253 248 1) :TYPE + ((:V128) (:V128))) + (:INSTR ("i32x4.trunc_sat_f32x4_u") :CODE (253 249 1) :TYPE + ((:V128) (:V128))) + (:INSTR ("f32x4.vconvert_i32x4_s") :CODE (253 250 1) :TYPE + ((:V128) (:V128))) + (:INSTR ("f32x4.vconvert_i32x4_u") :CODE (253 251 1) :TYPE + ((:V128) (:V128))) (:INSTR ("i32x4.vtrunc_sat_f64x2_s_zero") :CODE (253 252 1) :TYPE ((:V128) (:V128))) (:INSTR ("i32x4.vtrunc_sat_f64x2_u_zero") :CODE (253 253 1) :TYPE @@ -495,4 +518,4 @@ (:INSTR ("f64x2.vconvert_low_i32x4_s") :CODE (253 254 1) :TYPE ((:V128) (:V128))) (:INSTR ("f64x2.vconvert_low_i32x4_u") :CODE (253 255 1) :TYPE - ((:V128) (:V128))))) + ((:V128) (:V128)))))
\ No newline at end of file |