Sunday, December 31

New Year Coding Resolutions


  1. Finish cl-screen

  2. Finish and post my x86 assembler in Common Lisp to CommonLisp.net

  3. Write a new software renderer in Lisp

  4. Finally get the hang of writing setf expanders

  5. Write an animation testbed in Lisp

  6. At least make a start at writing a game again.

  7. Learn some Haskell

  8. Get more famililar with partial differential equations, the nabala operator and the jacobian matrix

Saturday, December 30

A Games/3d oriented lisp

Thoughts about the desirable properties of a Lisp optimised for fast 3d games use.



  1. Generational and/or incremental garbage collection.

  2. Incremental means gc collection can be time-bounded; generational will be more effective in culling short lived, small objects, and give us cache wins. Allocation should be trivial as possible.


  3. Native vector, matrix and quaternion types that map to SIMD

  4. De riguer for fast 3d operations: an inline assembler build into the language, coupled with macro expansion would probably mean that these not be coded


  5. Hashtables

  6. Too useful for lots of things


  7. Property lists

  8. Ditto: perfect for game AI


  9. Simple function call syntax

  10. CL's function call syntax is relatively complicated and makes optimisation harder.


  11. Fast single dimensional arrays

  12. A neccesity.


  13. Unhygenic macros

  14. A big system can be build from a relatively small one via CL-style macro-expansion..


  15. Readtable

  16. Ideal for rolling gustom syntax. CL's readtable has too many characters reserved. We need to keep ours free


  17. Optional compile-time type declarations

  18. Enables an optimiser to do a better job, and keeps more unboxed values arond


  19. Integrated shader compiler

  20. Shaders are just too useful not to have: an embedded lisp style shader with macroexpansion facilities would help a great deal.


  21. Sockets

  22. Needed for multiplayer games, and editors that run alongside the game


  23. Good FFI - to bind to c/c++ libraries

  24. A lot of exisiting code is in C - eg OpenGL


  25. Fast, streamable file I/O library

  26. Streaming in new data as the game runs is very important for large worlds.


  27. Heaps

  28. We will need to allocate hunks of memory for talking to 'C' libraries and just because we can? Not sure about this one


  29. Datatypes /library specifically for geometry - flexible mesh loading/compilation

  30. We will need acres of geometry, as usual..


  31. Datatypes / library specifically for texture and image processing

  32. And acres of texture maps, etc applied to them


  33. Datatypes / library for spatial structures: quadrees, bsp trees, octtrees, r-trees

  34. Good Scene management requires these


  35. Aggressive optimization: register colouring, scheduling, peephole..etc

  36. Goes without saying



That will do for now..;-)

Saturday, December 9

The birth of an assembler.

The story so far..It's all surprisingly easy in Lisp...


; SLIME 2006-10-28
CL-USER> (asdf:oos 'asdf:load-op 'cl-x86-asm)
; loading system definition from /home/johnc/.sbcl/systems/cl-x86-asm.asd
; into #
; registering # as CL-X86-ASM
; compiling file "/home/johnc/projects/msc/x86instructions.lisp" (written 09 DEC 2006 03:29:02 PM):
; compiling (IN-PACKAGE :CL-X86-ASM)
; compiling (DEFPARAMETER *INSTRUCTION-TABLE* ...)
; compiling (DEFPARAMETER *INSTRUCTION-LOOKUP-TABLE* ...)
; compiling (DEFUN MAKE-INSTRUCTION-HASH-TABLE ...)
; compiling (DEFUN LOOKUP-INSTRUCTION ...)

; /home/johnc/projects/msc/x86instructions.fasl written
; compilation finished in 0:00:00
; compiling file "/home/johnc/projects/msc/x86-assembler.lisp" (written 09 DEC 2006 03:28:00 PM):
; compiling (IN-PACKAGE :CL-X86-ASM)
; compiling (DEFPARAMETER *CURRENT-BITS-SIZE* ...)
; compiling (DEFUN SWITCH-BITS ...)
; compiling (DEFUN SYMBOL-IS-IN-PACKAGE ...)
; compiling (DEFUN IS-OPERAND-TYPE-P ...)
; compiling (DEFUN FIND-CORRECT-DESCRIPTION ...)
; compiling (DEFUN EXTRACT-ENCODING-FROM-DESCRIPTION ...)
; compiling (DEFUN PROCESS-ENCODING ...)

; file: /home/johnc/projects/msc/x86-assembler.lisp
; in: DEFUN PROCESS-ENCODING
; (DEFUN CL-X86-ASM::PROCESS-ENCODING
; (CL-X86-ASM::INSTRUCTION CL-X86-ASM::OPERANDS
; CL-X86-ASM::OPERAND-DESCRIPTION)
; CL-X86-ASM::OPERAND-DESCRIPTION)
; --> PROGN EVAL-WHEN SB-IMPL::%DEFUN SB-INT:NAMED-LAMBDA
; ==>
; #'(SB-INT:NAMED-LAMBDA CL-X86-ASM::PROCESS-ENCODING
; (CL-X86-ASM::INSTRUCTION CL-X86-ASM::OPERANDS
; CL-X86-ASM::OPERAND-DESCRIPTION)
; (BLOCK CL-X86-ASM::PROCESS-ENCODING
; CL-X86-ASM::OPERAND-DESCRIPTION))
;
; caught STYLE-WARNING:
; The variable INSTRUCTION is defined but never used.
;
; caught STYLE-WARNING:
; The variable OPERANDS is defined but never used.

; compiling (DEFUN ASSEMBLE-INSTRUCTION-OR-DIRECTIVE ...)
; compiling (DEFUN ASSEMBLE-FORM ...)
; compiling (DEFUN ASSEMBLE-FORMS ...)

; /home/johnc/projects/msc/x86-assembler.fasl written
; compilation finished in 0:00:00
WARNING:
COMPILE-FILE warned while performing # on
#.

; file: /home/johnc/projects/msc/x86-assembler.lisp
; in: DEFUN CL-X86-ASM::IS-OPERAND-TYPE-P
; (ASSOC CL-X86-ASM::OPERAND-TYPE CL-X86-ASM::*OPERAND-TYPE-CHECKERS*)
;
; caught WARNING:
; undefined variable: CL-X86-ASM::*OPERAND-TYPE-CHECKERS*

; in: DEFUN CL-X86-ASM::ASSEMBLE-FORM
; (FIRST LIST)
; ==>
; (CAR LIST)
;
; caught WARNING:
; undefined variable: LIST

;
; caught WARNING:
; These variables are undefined:
; CL-X86-ASM::*OPERAND-TYPE-CHECKERS* LIST
;
; compilation unit finished
; caught 3 WARNING conditions
; caught 2 STYLE-WARNING conditions
NIL
CL-USER> (cl-x86-asm::make-instruction-hash-table)
Adding :XORPS to table - ((xmm1 xmm2/m128) (15 87 /r))
Adding :XORPD to table - ((xmm1 xmm2/m128) (102 15 87 /r))
Adding :XOR to table - ((EAX imm32) (o32 53 id))
Adding :XOR to table - ((AX imm16) (o16 53 iw))
Adding :XOR to table - ((AL imm8) (52 ib))
Adding :XOR to table - ((r/m32 imm8) (o32 131 /6 ib))
Adding :XOR to table - ((r/m16 imm8) (o16 131 /6 ib))
Adding :XOR to table - ((r/m32 imm32) (o32 129 /6 id))
Adding :XOR to table - ((r/m16 imm16) (o16 129 /6 iw))
Adding :XOR to table - ((r/m8 imm8) (128 /6 ib))
Adding :XOR to table - ((reg32 r/m32) (o32 51 /r))
Adding :XOR to table - ((reg16 r/m16) (o16 51 /r))
Adding :XOR to table - ((reg8 r/m8) (50 /r))
Adding :XOR to table - ((r/m32 reg32) (o32 49 /r))
Adding :XOR to table - ((r/m16 reg16) (o16 49 /r))
Adding :XOR to table - ((r/m8 reg8) (48 /r))
Adding :XLATB to table - (NIL (215))
Adding :XLAT to table - (NIL (215))
Adding :XCHG to table - ((reg32 EAX) (o32 144 +r))
Adding :XCHG to table - ((reg16 AX) (o16 144 +r))
Adding :XCHG to table - ((EAX reg32) (o32 144 +r))
Adding :XCHG to table - ((AX reg16) (o16 144 +r))
Adding :XCHG to table - ((r/m32 reg32) (o32 135 /r))
Adding :XCHG to table - ((r/m16 reg16) (o16 135 /r))
Adding :XCHG to table - ((r/m8 reg8) (134 /r))
Adding :XCHG to table - ((reg32 r/m32) (o32 135 /r))
Adding :XCHG to table - ((reg16 r/m8) (o16 135 /r))
Adding :XCHG to table - ((reg8 r/m8) (134 /r))
Adding :XBTS to table - ((reg32 r/m32) (o32 15 166 /r))
Adding :XBTS to table - ((reg16 r/m16) (o16 15 166 /r))
Adding :XADD to table - ((r/m32 reg32) (o32 15 193 /r))
Adding :XADD to table - ((r/m16 reg16) (o16 15 193 /r))
Adding :XADD to table - ((r/m8 reg8) (15 192 /r))
Adding :WRSHR to table - ((r/m32) (15 55 /0))
Adding :WRMSR to table - (NIL (15 48))
Adding :WBINVD to table - (NIL (15 9))
Adding :FWAIT to table - (NIL (155))
Adding :WAIT to table - (NIL (155))
Adding :VERW to table - ((r/m16) (15 0 /5))
Adding :VERR to table - ((r/m16) (15 0 /4))
Adding :UNPCKLPS to table - ((xmm1 xmm2/m128) (15 20 /r))
Adding :UNPCKLPD to table - ((xmm1 xmm2/m128) (102 15 20 /r))
Adding :UNPCKHPS to table - ((xmm1 xmm2/m128) (15 21 /r))
Adding :UNPCKHPD to table - ((xmm1 xmm2/m128) (102 15 21 /r))
Adding :UMOV to table - ((reg32 r/m32) (o32 15 19 /r))
Adding :UMOV to table - ((reg16 r/m16) (o16 15 19 /r))
Adding :UMOV to table - ((reg8 r/m8) (15 18 /r))
Adding :UMOV to table - ((r/m32 reg32) (o32 15 17 /r))
Adding :UMOV to table - ((r/m16 reg16) (o16 15 17 /r))
Adding :UMOV to table - ((r/m8 reg8) (15 16 /r))
Adding :UD2 to table - (NIL (15 11))
Adding :UD1 to table - (NIL (15 185))
Adding :UD0 to table - (NIL (15 255))
Adding :UCOMISS to table - ((xmm1 xmm2/m128) (15 46 /r))
Adding :UCOMISD to table - ((xmm1 xmm2/m128) (102 15 46 /r))
Adding :TEST to table - ((EAX imm32) (o32 169 id))
Adding :TEST to table - ((AX imm16) (o16 169 iw))
Adding :TEST to table - ((AL imm8) (168 ib))
Adding :TEST to table - ((r/m32 imm32) (o32 247 /0 id))
Adding :TEST to table - ((r/m16 imm16) (o16 247 /0 iw))
Adding :TEST to table - ((r/m8 imm8) (246 /0 ib))
Adding :TEST to table - ((r/m32 reg32) (o32 133 /r))
Adding :TEST to table - ((r/m16 reg16) (o16 133 /r))
Adding :TEST to table - ((r/m8 reg8) (132 /r))
Adding :SYSRET to table - (NIL (15 7))
Adding :SYSEXIT to table - (NIL (15 53))
Adding :SYSENTER to table - (NIL (15 52))
Adding :SYSCALL to table - (NIL (15 5))
Adding :SVTS to table - ((m80) (15 124 /0))
Adding :SVLDT to table - ((m80) (15 122 /0))
Adding :SVDC to table - ((m80 segreg) (15 120 /r))
Adding :SUBSS to table - ((xmm1 xmm2/m128) (243 15 92 /r))
Adding :SUBSD to table - ((xmm1 xmm2/m128) (242 15 92 /r))
Adding :SUBPS to table - ((xmm1 xmm2/m128) (15 92 /r))
Adding :SUBPD to table - ((xmm1 xmm2/m128) (102 15 92 /r))
Adding :SUB to table - ((EAX imm32) (o32 45 id))
Adding :SUB to table - ((AX imm16) (o16 45 iw))
Adding :SUB to table - ((AL imm8) (44 ib))
Adding :SUB to table - ((r/m32 imm8) (o32 131 /5 ib))
Adding :SUB to table - ((r/m16 imm8) (o16 131 /5 ib))
Adding :SUB to table - ((r/m32 imm32) (o32 129 /5 id))
Adding :SUB to table - ((r/m16 imm16) (o16 129 /5 iw))
Adding :SUB to table - ((r/m8 imm8) (128 /5 ib))
Adding :SUB to table - ((reg32 r/m32) (o32 43 /r))
Adding :SUB to table - ((reg16 r/m16) (o16 43 /r))
Adding :SUB to table - ((reg8 r/m8) (42 /r))
Adding :SUB to table - ((r/m32 reg32) (o32 41 /r))
Adding :SUB to table - ((r/m16 reg16) (o16 41 /r))
Adding :SUB to table - ((r/m8 reg8) (40 /r))
Adding :STR to table - ((r/m16) (15 0 /1))
Adding :STOSD to table - (NIL (o32 171))
Adding :STOSW to table - (NIL (o16 171))
Adding :STOSB to table - (NIL (170))
Adding :STMXCSR to table - ((m32) (15 174 /3))
Adding :STI to table - (NIL (251))
Adding :STD to table - (NIL (253))
Adding :STC to table - (NIL (249))
Adding :SQRTSS to table - ((xmm1 xmm2/m128) (243 15 81 /r))
Adding :SQRTSD to table - ((xmm1 xmm2/m128) (242 15 81 /r))
Adding :SQRTPS to table - ((xmm1 xmm2/m128) (15 81 /r))
Adding :SQRTPD to table - ((xmm1 xmm2/m128) (102 15 81 /r))
Adding :SMSW to table - ((r/m16) (15 1 /4))
Adding :SMINTOLD to table - (NIL (15 126))
Adding :SMINT to table - (NIL (15 56))
Adding :SMI to table - (NIL (241))
Adding :SHUFPS to table - ((xmm1 xmm2/m128 imm8) (15 198 /r ib))
Adding :SHUFPD to table - ((xmm1 xmm2/m128 imm8) (102 15 198 /r ib))
Adding :SHRD to table - ((r/m32 reg32 CL) (o32 15 173 /r))
Adding :SHRD to table - ((r/m16 reg16 CL) (o16 15 173 /r))
Adding :SHRD to table - ((r/m32 reg32 imm8) (o32 15 172 /r ib))
Adding :SHRD to table - ((r/m16 reg16 imm8) (o16 15 172 /r ib))
Adding :SHLD to table - ((r/m16 reg32 CL) (o32 15 165 /r))
Adding :SHLD to table - ((r/m16 reg16 CL) (o16 15 165 /r))
Adding :SHLD to table - ((r/m16 reg32 imm8) (o32 15 164 /r ib))
Adding :SHLD to table - ((r/m16 reg16 imm8) (o16 15 164 /r ib))
Adding :SHR to table - ((r/m32 imm8) (o32 193 /5 ib))
Adding :SHR to table - ((r/m32 CL) (o32 211 /5))
Adding :SHR to table - ((r/m32 1) (o32 209 /5))
Adding :SHR to table - ((r/m16 imm8) (o16 193 /5 ib))
Adding :SHR to table - ((r/m16 CL) (o16 211 /5))
Adding :SHR to table - ((r/m16 1) (o16 209 /5))
Adding :SHR to table - ((r/m8 imm8) (192 /5 ib))
Adding :SHR to table - ((r/m8 CL) (210 /5))
Adding :SHR to table - ((r/m8 1) (208 /5))
Adding :SHL to table - ((r/m32 imm8) (o32 193 /4 ib))
Adding :SHL to table - ((r/m32 CL) (o32 211 /4))
Adding :SHL to table - ((r/m32 1) (o32 209 /4))
Adding :SHL to table - ((r/m16 imm8) (o16 193 /4 ib))
Adding :SHL to table - ((r/m16 CL) (o16 211 /4))
Adding :SHL to table - ((r/m16 1) (o16 209 /4))
Adding :SHL to table - ((r/m8 imm8) (192 /4 ib))
Adding :SHL to table - ((r/m8 CL) (210 /4))
Adding :SHL to table - ((r/m8 1) (208 /4))
Adding :SLDT to table - ((r/m16) (15 0 /0))
Adding :SIDT to table - ((mem) (15 1 /1))
Adding :SGDT to table - ((mem) (15 1 /0))
Adding :SFENCE to table - (NIL (15 174 /7))
Adding :SCASD to table - (NIL (o32 175))
Adding :SCASW to table - (NIL (o16 175))
Adding :SCASB to table - (NIL (174))
Adding :SBB to table - ((EAX imm32) (o32 29 id))
Adding :SBB to table - ((AX imm16) (o16 29 iw))
Adding :SBB to table - ((AL imm8) (28 ib))
Adding :SBB to table - ((r/m32 imm8) (o32 131 /3 ib))
Adding :SBB to table - ((r/m16 imm8) (o16 131 /3 ib))
Adding :SBB to table - ((r/m32 imm32) (o32 129 /3 id))
Adding :SBB to table - ((r/m16 imm16) (o16 129 /3 iw))
Adding :SBB to table - ((r/m8 imm8) (128 /3 ib))
Adding :SBB to table - ((reg32 r/m32) (o32 27 /r))
Adding :SBB to table - ((reg16 r/m16) (o16 27 /r))
Adding :SBB to table - ((reg8 r/m8) (26 /r))
Adding :SBB to table - ((r/m32 reg32) (o32 25 /r))
Adding :SBB to table - ((r/m16 reg16) (o16 25 /r))
Adding :SBB to table - ((r/m8 reg8) (24 /r))
Adding :SALC to table - (NIL (214))
Adding :SAR to table - ((r/m32 imm8) (o32 193 /7 ib))
Adding :SAR to table - ((r/m32 CL) (o32 211 /7))
Adding :SAR to table - ((r/m32 1) (o32 209 /7))
Adding :SAR to table - ((r/m16 imm8) (o16 193 /7 ib))
Adding :SAR to table - ((r/m16 CL) (o16 211 /7))
Adding :SAR to table - ((r/m16 1) (o16 209 /7))
Adding :SAR to table - ((r/m8 imm8) (192 /7 ib))
Adding :SAR to table - ((r/m8 CL) (210 /7))
Adding :SAR to table - ((r/m8 1) (208 /7))
Adding :SAL to table - ((r/m32 imm8) (o32 193 /4 ib))
Adding :SAL to table - ((r/m32 CL) (o32 211 /4))
Adding :SAL to table - ((r/m32 1) (o32 209 /4))
Adding :SAL to table - ((r/m16 imm8) (o16 193 /4 ib))
Adding :SAL to table - ((r/m16 CL) (o16 211 /4))
Adding :SAL to table - ((r/m16 1) (o16 209 /4))
Adding :SAL to table - ((r/m8 imm8) (192 /4 ib))
Adding :SAL to table - ((r/m8 CL) (210 /4))
Adding :SAL to table - ((r/m8 1) (208 /4))
Adding :SAHF to table - (NIL (158))
Adding :RSTS to table - ((m80) (15 125 /0))
Adding :RSQRTSS to table - ((xmm1 xmm2/m128) (243 15 82 /r))
Adding :RSQRTPS to table - ((xmm1 xmm2/m128) (15 82 /r))
Adding :RSM to table - (NIL (15 170))
Adding :RSLDT to table - ((m80) (15 123 /0))
Adding :RSDC to table - ((segreg m80) (15 121 /r))
Adding :ROR to table - ((r/m32 imm8) (o32 193 /1 ib))
Adding :ROR to table - ((r/m32 CL) (o32 211 /1))
Adding :ROR to table - ((r/m32 1) (o32 209 /1))
Adding :ROR to table - ((r/m16 imm8) (o16 193 /1 ib))
Adding :ROR to table - ((r/m16 CL) (o16 211 /1))
Adding :ROR to table - ((r/m16 1) (o16 209 /1))
Adding :ROR to table - ((r/m8 imm8) (192 /1 ib))
Adding :ROR to table - ((r/m8 CL) (210 /1))
Adding :ROR to table - ((r/m8 1) (208 /1))
Adding :ROL to table - ((r/m32 imm8) (o32 193 /0 ib))
Adding :ROL to table - ((r/m32 CL) (o32 211 /0))
Adding :ROL to table - ((r/m32 1) (o32 209 /0))
Adding :ROL to table - ((r/m16 imm8) (o16 193 /0 ib))
Adding :ROL to table - ((r/m16 CL) (o16 211 /0))
Adding :ROL to table - ((r/m16 1) (o16 209 /0))
Adding :ROL to table - ((r/m8 imm8) (192 /0 ib))
Adding :ROL to table - ((r/m8 CL) (210 /0))
Adding :ROL to table - ((r/m8 1) (208 /0))
Adding :RETN to table - ((imm16) (194 iw))
Adding :RETN to table - (NIL (195))
Adding :RETF to table - ((imm16) (202 iw))
Adding :RETF to table - (NIL (203))
Adding :RET to table - ((imm16) (194 iw))
Adding :RET to table - (NIL (195))
Adding :RDTSC to table - (NIL (15 49))
Adding :RDSHR to table - ((r/m32) (15 54 /0))
Adding :RDPMC to table - (NIL (15 51))
Adding :RDMSR to table - (NIL (15 50))
Adding :RCPSS to table - ((xmm1 xmm2/m128) (243 15 83 /r))
Adding :RCPPS to table - ((xmm1 xmm2/m128) (15 83 /r))
Adding :RCR to table - ((r/m32 imm8) (o32 193 /3 ib))
Adding :RCR to table - ((r/m32 CL) (o32 211 /3))
Adding :RCR to table - ((r/m32 1) (o32 209 /3))
Adding :RCR to table - ((r/m16 imm8) (o16 193 /3 ib))
Adding :RCR to table - ((r/m16 CL) (o16 211 /3))
Adding :RCR to table - ((r/m16 1) (o16 209 /3))
Adding :RCR to table - ((r/m8 imm8) (192 /3 ib))
Adding :RCR to table - ((r/m8 CL) (210 /3))
Adding :RCR to table - ((r/m8 1) (208 /3))
Adding :RCL to table - ((r/m32 imm8) (o32 193 /2 ib))
Adding :RCL to table - ((r/m32 CL) (o32 211 /2))
Adding :RCL to table - ((r/m32 1) (o32 209 /2))
Adding :RCL to table - ((r/m16 imm8) (o16 193 /2 ib))
Adding :RCL to table - ((r/m16 CL) (o16 211 /2))
Adding :RCL to table - ((r/m16 1) (o16 209 /2))
Adding :RCL to table - ((r/m8 imm8) (192 /2 ib))
Adding :RCL to table - ((r/m8 CL) (210 /2))
Adding :RCL to table - ((r/m8 1) (208 /2))
Adding :PXOR to table - ((xmm1 xmm2/m128) (102 15 239 /r))
Adding :PXOR to table - ((mm1 mm2/m64) (15 239 /r))
Adding :PUSHFW to table - (NIL (o16 156))
Adding :PUSHFD to table - (NIL (o32 156))
Adding :PUSHF to table - (NIL (156))
Adding :PUSHAW to table - (NIL (o16 96))
Adding :PUSHAD to table - (NIL (o32 96))
Adding :PUSHA to table - (NIL (96))
Adding :PUSH to table - ((imm32) (o32 104 id))
Adding :PUSH to table - ((imm16) (o16 104 iw))
Adding :PUSH to table - ((imm8) (106 ib))
Adding :PUSH to table - ((GS) (15 168))
Adding :PUSH to table - ((FS) (15 160))
Adding :PUSH to table - ((SS) (22))
Adding :PUSH to table - ((ES) (6))
Adding :PUSH to table - ((DS) (30))
Adding :PUSH to table - ((CS) (14))
Adding :PUSH to table - ((r/m32) (o32 255 /6))
Adding :PUSH to table - ((r/m16) (o16 255 /6))
Adding :PUSH to table - ((reg32) (o32 80 +r))
Adding :PUSH to table - ((reg16) (o16 80 +r))
Adding :PUNPCKLQDQ to table - ((xmm1 xmm2/m128) (102 15 108 /r))
Adding :PUNPCKLDQ to table - ((xmm1 xmm2/m128) (102 15 98 /r))
Adding :PUNPCKLWD to table - ((xmm1 xmm2/m128) (102 15 97 /r))
Adding :PUNPCKLBW to table - ((xmm1 xmm2/m128) (102 15 96 /r))
Adding :PUNPCKLDQ to table - ((mm1 mm2/m32) (15 98 /r))
Adding :PUNPCKLWD to table - ((mm1 mm2/m32) (15 97 /r))
Adding :PUNPCKLBW to table - ((mm1 mm2/m32) (15 96 /r))
Adding :PUNPCKHQDQ to table - ((xmm1 xmm2/m128) (102 15 109 /r))
Adding :PUNPCKHDQ to table - ((xmm1 xmm2/m128) (102 15 106 /r))
Adding :PUNPCKHWD to table - ((xmm1 xmm2/m128) (102 15 105 /r))
Adding :PUNPCKHBW to table - ((xmm1 xmm2/m128) (102 15 104 /r))
Adding :PUNPCKHDQ to table - ((mm1 mm2/m64) (15 106 /r))
Adding :PUNPCKHWD to table - ((mm1 mm2/m64) (15 105 /r))
Adding :PUNPCKHBW to table - ((mm1 mm2/m64) (15 104 /r))
Adding :PSWAPD to table - ((mm1 mm2/m64) (15 15 /r 187))
Adding :PSUBSIW to table - ((mm1 mm2/m64) (15 85 /r))
Adding :PSUBUSW to table - ((xmm1 xmm2/m128) (102 15 217 /r))
Adding :PSUBUSB to table - ((xmm1 xmm2/m128) (102 15 216 /r))
Adding :PSUBUSW to table - ((mm1 mm2/m64) (15 217 /r))
Adding :PSUBUSB to table - ((mm1 mm2/m64) (15 216 /r))
Adding :PSUBSW to table - ((xmm1 xmm2/m128) (102 15 233 /r))
Adding :PSUBSB to table - ((xmm1 xmm2/m128) (102 15 232 /r))
Adding :PSUBSW to table - ((mm1 mm2/m64) (15 233 /r))
Adding :PSUBSB to table - ((mm1 mm2/m64) (15 232 /r))
Adding :PSUBQ to table - ((xmm1 xmm2/m128) (102 15 251 /r))
Adding :PSUBD to table - ((xmm1 xmm2/m128) (102 15 250 /r))
Adding :PSUBW to table - ((xmm1 xmm2/m128) (102 15 249 /r))
Adding :PSUBB to table - ((xmm1 xmm2/m128) (102 15 248 /r))
Adding :PSUBQ to table - ((mm1 mm2/m64) (15 251 /r))
Adding :PSUBD to table - ((mm1 mm2/m64) (15 250 /r))
Adding :PSUBW to table - ((mm1 mm2/m64) (15 249 /r))
Adding :PSUBB to table - ((mm1 mm2/m64) (15 248 /r))
Adding :PSRLDQ to table - ((xmm1 imm8) (102 15 115 /3 ib))
Adding :PSRLQ to table - ((xmm imm8) (102 15 115 /2 ib))
Adding :PSRLQ to table - ((xmm1 xmm2/m128) (102 15 211 /r))
Adding :PSRLQ to table - ((mm imm8) (15 115 /2 ib))
Adding :PSRLQ to table - ((mm1 mm2/m64) (15 211 /r))
Adding :PSRLD to table - ((xmm imm8) (102 15 114 /2 ib))
Adding :PSRLD to table - ((xmm1 xmm2/m128) (102 15 210 /r))
Adding :PSRLD to table - ((mm imm8) (15 114 /2 ib))
Adding :PSRLD to table - ((mm1 mm2/m64) (15 210 /r))
Adding :PSRLW to table - ((xmm imm8) (102 15 113 /2 ib))
Adding :PSRLW to table - ((xmm1 xmm2/m128) (102 15 209 /r))
Adding :PSRLW to table - ((mm imm8) (15 113 /2 ib))
Adding :PSRLW to table - ((mm1 mm2/m64) (15 209 /r))
Adding :PSRAD to table - ((xmm imm8) (102 15 114 /4 ib))
Adding :PSRAD to table - ((xmm1 xmm2/m128) (102 15 226 /r))
Adding :PSRAD to table - ((mm imm8) (15 114 /4 ib))
Adding :PSRAD to table - ((mm1 mm2/m64) (15 226 /r))
Adding :PSRAW to table - ((xmm imm8) (102 15 113 /4 ib))
Adding :PSRAW to table - ((xmm1 xmm2/m128) (102 15 225 /r))
Adding :PSRAW to table - ((mm imm8) (15 113 /4 ib))
Adding :PSRAW to table - ((mm1 mm2/m64) (15 225 /r))
Adding :PSLLDQ to table - ((xmm1 imm8) (102 15 115 /7 ib))
Adding :PSLLQ to table - ((xmm imm8) (102 15 115 /6 ib))
Adding :PSLLQ to table - ((xmm1 xmm2/m128) (102 15 243 /r))
Adding :PSLLQ to table - ((mm imm8) (15 115 /6 ib))
Adding :PSLLQ to table - ((mm1 mm2/m64) (15 243 /r))
Adding :PSLLD to table - ((xmm imm8) (102 15 114 /6 ib))
Adding :PSLLD to table - ((xmm1 xmm2/m128) (102 15 242 /r))
Adding :PSLLD to table - ((mm imm8) (15 114 /6 ib))
Adding :PSLLD to table - ((mm1 mm2/m64) (15 242 /r))
Adding :PSLLW to table - ((xmm imm8) (102 15 113 /6 ib))
Adding :PSLLW to table - ((xmm1 xmm2/m128) (102 15 241 /r))
Adding :PSLLW to table - ((mm imm8) (15 113 /6 ib))
Adding :PSLLW to table - ((mm1 mm2/m64) (15 241 /r))
Adding :PSHUFW to table - ((mm1 mm2/m64 imm8) (15 112 /r ib))
Adding :PSHUFLW to table - ((xmm1 xmm2/m128 imm8) (242 15 112 /r ib))
Adding :PSHUFHW to table - ((xmm1 xmm2/m128 imm8) (243 15 112 /r ib))
Adding :PSHUFD to table - ((xmm1 xmm2/m128 imm8) (102 15 112 /r ib))
Adding :PSADBW to table - ((xmm1 xmm2/m128) (102 15 246 /r))
Adding :PSADBW to table - ((mm1 mm2/m64) (15 246 /r))
Adding :PREFETCHT2 to table - ((m8) (15 24 /3))
Adding :PREFETCHT1 to table - ((m8) (15 24 /2))
Adding :PREFETCHT0 to table - ((m8) (15 24 /1))
Adding :PREFETCHNTA to table - ((m8) (15 24 /0))
Adding :PREFETCHW to table - ((mem8) (15 13 /1))
Adding :PREFETCH to table - ((mem8) (15 13 /0))
Adding :POR to table - ((xmm1 xmm2/m128) (102 15 235 /r))
Adding :POR to table - ((mm1 mm2/m64) (15 235 /r))
Adding :POPFD to table - (NIL (o32 157))
Adding :POPFW to table - (NIL (o16 157))
Adding :POPF to table - (NIL (157))
Adding :POPAD to table - (NIL (o32 97))
Adding :POPAW to table - (NIL (o16 97))
Adding :POPA to table - (NIL (97))
Adding :POP to table - ((GS) (15 169))
Adding :POP to table - ((FS) (15 161))
Adding :POP to table - ((SS) (23))
Adding :POP to table - ((ES) (7))
Adding :POP to table - ((DS) (31))
Adding :POP to table - ((CS) (15))
Adding :POP to table - ((r/m32) (o32 143 /0))
Adding :POP to table - ((r/m16) (o16 143 /0))
Adding :POP to table - ((reg32) (o32 88 +r))
Adding :POP to table - ((reg16) (o16 88 +r))
Adding :PMVGEZB to table - ((mmxreg mem64) (15 92 /r))
Adding :PMVLZB to table - ((mmxreg mem64) (15 91 /r))
Adding :PMVNZB to table - ((mmxreg mem64) (15 90 /r))
Adding :PMVZB to table - ((mmxreg mem64) (15 88 /r))
Adding :PMULUDQ to table - ((xmm1 xmm2/m128) (102 15 244 /r))
Adding :PMULUDQ to table - ((mm1 mm2/m64) (15 244 /r))
Adding :PMULLW to table - ((xmm1 xmm2/m128) (102 15 213 /r))
Adding :PMULHW to table - ((xmm1 xmm2/m128) (102 15 229 /r))
Adding :PMULLW to table - ((mm1 mm2/m64) (15 213 /r))
Adding :PMULHW to table - ((mm1 mm2/m64) (15 229 /r))
Adding :PMULHUW to table - ((xmm1 xmm2/m128) (102 15 228 /r))
Adding :PMULHUW to table - ((mm1 mm2/m64) (15 228 /r))
Adding :PMULHRWA to table - ((mm1 mm2/m64) (15 15 /r 183))
Adding :PMULHRIW to table - ((mm1 mm2/m64) (15 93 /r))
Adding :PMULHRWC to table - ((mm1 mm2/m64) (15 89 /r))
Adding :PMOVMSKB to table - ((reg32 xmm) (102 15 215 /r))
Adding :PMOVMSKB to table - ((reg32 mm) (15 215 /r))
Adding :PMINUB to table - ((xmm1 xmm2/m128) (102 15 218 /r))
Adding :PMINUB to table - ((mm1 mm2/m64) (15 218 /r))
Adding :PMINSW to table - ((xmm1 xmm2/m128) (102 15 234 /r))
Adding :PMINSW to table - ((mm1 mm2/m64) (15 234 /r))
Adding :PMAXUB to table - ((xmm1 xmm2/m128) (102 15 222 /r))
Adding :PMAXUB to table - ((mm1 mm2/m64) (15 222 /r))
Adding :PMAXSW to table - ((xmm1 xmm2/m128) (102 15 238 /r))
Adding :PMAXSW to table - ((mm1 mm2/m64) (15 238 /r))
Adding :PMAGW to table - ((mm1 mm2/m64) (15 82 /r))
Adding :PMADDWD to table - ((xmm1 xmm2/m128) (102 15 245 /r))
Adding :PMADDWD to table - ((mm1 mm2/m64) (15 245 /r))
Adding :PMACHRIW to table - ((mm m64) (15 94 /r))
Adding :PINSRW to table - ((xmm r16/r32/m16 imm8) (102 15 196 /r ib))
Adding :PINSRW to table - ((mm r16/r32/m16 imm8) (15 196 /r ib))
Adding :PI2FW to table - ((mm1 mm2/m64) (15 15 /r 12))
Adding :PI2FD to table - ((mm1 mm2/m64) (15 15 /r 13))
Adding :PFSUBR to table - ((mm1 mm2/m64) (15 15 /r 170))
Adding :PFSUB to table - ((mm1 mm2/m64) (15 15 /r 154))
Adding :PFRSQRT to table - ((mm1 mm2/m64) (15 15 /r 151))
Adding :PFRSQIT1 to table - ((mm1 mm2/m64) (15 15 /r 167))
Adding :PFRCPIT2 to table - ((mm1 mm2/m64) (15 15 /r 182))
Adding :PFRCPIT1 to table - ((mm1 mm2/m64) (15 15 /r 166))
Adding :PFRCP to table - ((mm1 mm2/m64) (15 15 /r 150))
Adding :PFPNACC to table - ((mm1 mm2/m64) (15 15 /r 142))
Adding :PFNACC to table - ((mm1 mm2/m64) (15 15 /r 138))
Adding :PFMUL to table - ((mm1 mm2/m64) (15 15 /r 180))
Adding :PFMIN to table - ((mm1 mm2/m64) (15 15 /r 148))
Adding :PFMAX to table - ((mm1 mm2/m64) (15 15 /r 164))
Adding :PFCMPGT to table - ((mm1 mm2/m64) (15 15 /r 160))
Adding :PFCMPGE to table - ((mm1 mm2/m64) (15 15 /r 144))
Adding :PFCMPEQ to table - ((mm1 mm2/m64) (15 15 /r 176))
Adding :PFADD to table - ((mm1 mm2/m64) (15 15 /r 158))
Adding :PFACC to table - ((mm1 mm2/m64) (15 15 /r 174))
Adding :PF2IW to table - ((mm1 mm2/m64) (15 15 /r 28))
Adding :PF2ID to table - ((mm1 mm2/m64) (15 15 /r 29))
Adding :PEXTRW to table - ((reg32 xmm imm8) (102 15 197 /r ib))
Adding :PEXTRW to table - ((reg32 mm imm8) (15 197 /r ib))
Adding :PDISTIB to table - ((mm m64) (15 84 /r))
Adding :PCMPGTD to table - ((xmm1 xmm2/m128) (102 15 102 /r))
Adding :PCMPGTW to table - ((xmm1 xmm2/m128) (102 15 101 /r))
Adding :PCMPGTB to table - ((xmm1 xmm2/m128) (102 15 100 /r))
Adding :PCMPEQD to table - ((xmm1 xmm2/m128) (102 15 118 /r))
Adding :PCMPEQW to table - ((xmm1 xmm2/m128) (102 15 117 /r))
Adding :PCMPEQB to table - ((xmm1 xmm2/m128) (102 15 116 /r))
Adding :PCMPGTD to table - ((mm1 mm2/m64) (15 102 /r))
Adding :PCMPGTW to table - ((mm1 mm2/m64) (15 101 /r))
Adding :PCMPGTB to table - ((mm1 mm2/m64) (15 100 /r))
Adding :PCMPEQD to table - ((mm1 mm2/m64) (15 118 /r))
Adding :PCMPEQW to table - ((mm1 mm2/m64) (15 117 /r))
Adding :PCMPEQB to table - ((mm1 mm2/m64) (15 116 /r))
Adding :PAVGUSB to table - ((mm1 mm2/m64) (15 15 /r 191))
Adding :PAVGW to table - ((xmm1 xmm2/m128) (102 15 227 /r))
Adding :PAVGB to table - ((xmm1 xmm2/m128) (102 15 224 /r))
Adding :PAVGW to table - ((mm1 mm2/m64) (15 227 /r))
Adding :PAVGB to table - ((mm1 mm2/m64) (15 224 /r))
Adding :PAVEB to table - ((mmxreg r/m64) (15 80 /r))
Adding :PAUSE to table - (NIL (243 144))
Adding :PANDN to table - ((xmm1 xmm2/m128) (102 15 223 /r))
Adding :PAND to table - ((xmm1 xmm2/m128) (102 15 219 /r))
Adding :PANDN to table - ((mm1 mm2/m64) (15 223 /r))
Adding :PAND to table - ((mm1 mm2/m64) (15 219 /r))
Adding :PADDUSW to table - ((xmm1 xmm2/m128) (102 15 221 /r))
Adding :PADDUSB to table - ((xmm1 xmm2/m128) (102 15 220 /r))
Adding :PADDUSW to table - ((mm1 mm2/m64) (15 221 /r))
Adding :PADDUSB to table - ((mm1 mm2/m64) (15 220 /r))
Adding :PADDSIW to table - ((mmxreg r/m64) (15 81 /r))
Adding :PADDSW to table - ((xmm1 xmm2/m128) (102 15 237 /r))
Adding :PADDSB to table - ((xmm1 xmm2/m128) (102 15 236 /r))
Adding :PADDSW to table - ((mm1 mm2/m64) (15 237 /r))
Adding :PADDSB to table - ((mm1 mm2/m64) (15 236 /r))
Adding :PADDQ to table - ((xmm1 xmm2/m128) (102 15 212 /r))
Adding :PADDQ to table - ((mm1 mm2/m64) (15 212 /r))
Adding :PADDD to table - ((xmm1 xmm2/m128) (102 15 254 /r))
Adding :PADDW to table - ((xmm1 xmm2/m128) (102 15 253 /r))
Adding :PADDB to table - ((xmm1 xmm2/m128) (102 15 252 /r))
Adding :PADDD to table - ((mm1 mm2/m64) (15 254 /r))
Adding :PADDW to table - ((mm1 mm2/m64) (15 253 /r))
Adding :PADDB to table - ((mm1 mm2/m64) (15 252 /r))
Adding :PACKUSWB to table - ((xmm1 xmm2/m128) (102 15 103 /r))
Adding :PACKSSWB to table - ((xmm1 xmm2/m128) (102 15 99 /r))
Adding :PACKSSDW to table - ((xmm1 xmm2/m128) (102 15 107 /r))
Adding :PACKUSWB to table - ((mm1 mm2/m64) (15 103 /r))
Adding :PACKSSWB to table - ((mm1 mm2/m64) (15 99 /r))
Adding :PACKSSDW to table - ((mm1 mm2/m64) (15 107 /r))
Adding :OUTSD to table - (NIL (o32 111))
Adding :OUTSW to table - (NIL (o16 111))
Adding :OUTSB to table - (NIL (110))
Adding :OUT to table - ((DX EAX) (o32 239))
Adding :OUT to table - ((DX AX) (o16 239))
Adding :OUT to table - ((DX AL) (238))
Adding :OUT to table - ((imm8 EAX) (o32 231 ib))
Adding :OUT to table - ((imm8 AX) (o16 231 ib))
Adding :OUT to table - ((imm8 AL) (230 ib))
Adding :ORPS to table - ((xmm1 xmm2/m128) (15 86 /r))
Adding :ORPD to table - ((xmm1 xmm2/m128) (102 15 86 /r))
Adding :OR to table - ((EAX imm32) (o32 13 id))
Adding :OR to table - ((AX imm16) (o16 13 iw))
Adding :OR to table - ((AL imm8) (12 ib))
Adding :OR to table - ((r/m32 imm8) (o32 131 /1 ib))
Adding :OR to table - ((r/m16 imm8) (o16 131 /1 ib))
Adding :OR to table - ((r/m32 imm32) (o32 129 /1 id))
Adding :OR to table - ((r/m16 imm16) (o16 129 /1 iw))
Adding :OR to table - ((r/m8 imm8) (128 /1 ib))
Adding :OR to table - ((reg32 r/m32) (o32 11 /r))
Adding :OR to table - ((reg16 r/m16) (o16 11 /r))
Adding :OR to table - ((reg8 r/m8) (10 /r))
Adding :OR to table - ((r/m32 reg32) (o32 9 /r))
Adding :OR to table - ((r/m16 reg16) (o16 9 /r))
Adding :OR to table - ((r/m8 reg8) (8 /r))
Adding :NOP to table - (NIL (144))
Adding :NOT to table - ((r/m32) (o32 247 /2))
Adding :NOT to table - ((r/m16) (o16 247 /2))
Adding :NOT to table - ((r/m8) (246 /2))
Adding :NEG to table - ((r/m32) (o32 247 /3))
Adding :NEG to table - ((r/m16) (o16 247 /3))
Adding :NEG to table - ((r/m8) (246 /3))
Adding :MULSS to table - ((xmm1 xmm2/mem32) (243 15 89 /r))
Adding :MULSD to table - ((xmm1 xmm2/mem32) (242 15 89 /r))
Adding :MULPS to table - ((xmm1 xmm2/mem128) (15 89 /r))
Adding :MULPD to table - ((xmm1 xmm2/mem128) (102 15 89 /r))
Adding :MUL to table - ((r/m32) (o32 247 /4))
Adding :MUL to table - ((r/m16) (o16 247 /4))
Adding :MUL to table - ((r/m8) (246 /4))
Adding :MOVUPS to table - ((xmm1/mem128 xmm2) (15 17 /r))
Adding :MOVUPS to table - ((xmm1 xmm2/mem128) (15 16 /r))
Adding :MOVUPD to table - ((xmm1/mem128 xmm2) (102 15 17 /r))
Adding :MOVUPD to table - ((xmm1 xmm2/mem128) (102 15 16 /r))
Adding :MOVZX to table - ((reg32 r/m16) (o32 15 183 /r))
Adding :MOVZX to table - ((reg32 r/m8) (o32 15 182 /r))
Adding :MOVZX to table - ((reg16 r/m8) (o16 15 182 /r))
Adding :MOVSX to table - ((reg32 r/m16) (o32 15 191 /r))
Adding :MOVSX to table - ((reg32 r/m8) (o32 15 190 /r))
Adding :MOVSX to table - ((reg16 r/m8) (o16 15 190 /r))
Adding :MOVSS to table - ((xmm1/m32 xmm2) (243 15 17 /r))
Adding :MOVSS to table - ((xmm1 xmm2/m32) (243 15 16 /r))
Adding :MOVSD to table - ((xmm1/m64 xmm2) (242 15 17 /r))
Adding :MOVSD to table - ((xmm1 xmm2/m64) (242 15 16 /r))
Adding :MOVSD to table - (NIL (o32 165))
Adding :MOVSW to table - (NIL (o16 165))
Adding :MOVSB to table - (NIL (164))
Adding :MOVQ2DQ to table - ((xmm mm) (243 OF 214 /r))
Adding :MOVQ to table - ((xmm1/m64 xmm2) (102 15 214 /r))
Adding :MOVQ to table - ((xmm1 xmm2/m64) (243 15 126 /r))
Adding :MOVQ to table - ((mm1/m64 mm2) (15 127 /r))
Adding :MOVQ to table - ((mm1 mm2/m64) (15 111 /r))
Adding :MOVNTQ to table - ((m64 mm) (15 231 /r))
Adding :MOVNTPS to table - ((m128 xmm) (15 43 /r))
Adding :MOVNTPD to table - ((m128 xmm) (102 15 43 /r))
Adding :MOVNTI to table - ((m32 reg32) (15 195 /r))
Adding :MOVNTDQ to table - ((m128 xmm) (102 15 231 /r))
Adding :MOVMSKPS to table - ((reg32 xmm) (15 80 /r))
Adding :MOVMSKPD to table - ((reg32 xmm) (102 15 80 /r))
Adding :MOVLPS to table - ((m64 xmm) (OF 19 /r))
Adding :MOVLPS to table - ((xmm m64) (OF 18 /r))
Adding :MOVLPD to table - ((m64 xmm) (102 OF 19 /r))
Adding :MOVLPD to table - ((xmm m64) (102 OF 18 /r))
Adding :MOVLHPS to table - ((xmm1 xmm2) (OF 22 /r))
Adding :MOVHPS to table - ((m64 xmm) (15 23 /r))
Adding :MOVHPS to table - ((xmm m64) (15 22 /r))
Adding :MOVHPD to table - ((m64 xmm) (102 OF 23 /r))
Adding :MOVHPD to table - ((xmm m64) (102 OF 22 /r))
Adding :MOVHLPS to table - ((xmm1 xmm2) (OF 18 /r))
Adding :MOVDQU to table - ((xmm1/m128 xmm2) (243 OF 127 /r))
Adding :MOVDQU to table - ((xmm1 xmm2/m128) (243 OF 111 /r))
Adding :MOVDQA to table - ((xmm1/m128 xmm2) (102 OF 127 /r))
Adding :MOVDQA to table - ((xmm1 xmm2/m128) (102 OF 111 /r))
Adding :MOVDQ2Q to table - ((mm xmm) (242 OF 214 /r))
Adding :MOVD to table - ((r/m32 xmm) (102 15 126 /r))
Adding :MOVD to table - ((xmm r/m32) (102 15 110 /r))
Adding :MOVD to table - ((r/m32 mm) (15 126 /r))
Adding :MOVD to table - ((mm r/m32) (15 110 /r))
Adding :MOVAPS to table - ((xmm1/mem128 xmm2) (15 41 /r))
Adding :MOVAPS to table - ((xmm1 xmm2/mem128) (15 40 /r))
Adding :MOVAPD to table - ((xmm1/mem128 xmm2) (102 15 41 /r))
Adding :MOVAPD to table - ((xmm1 xmm2/mem128) (102 15 40 /r))
Adding :MOV to table - ((TR3/4/5/6/7 reg32) (15 38 /r))
Adding :MOV to table - ((DR0/1/2/3/6/7 reg32) (15 35 /r))
Adding :MOV to table - ((CR0/2/3/4 reg32) (15 34 /r))
Adding :MOV to table - ((reg32 TR3/4/5/6/7) (15 36 /r))
Adding :MOV to table - ((reg32 DR0/1/2/3/6/7) (15 33 /r))
Adding :MOV to table - ((reg32 CR0/2/3/4) (15 32 /r))
Adding :MOV to table - ((segreg r/m32) (o32 142 /r))
Adding :MOV to table - ((segreg r/m16) (o16 142 /r))
Adding :MOV to table - ((r/m32 segreg) (o32 140 /r))
Adding :MOV to table - ((r/m16 segreg) (o16 140 /r))
Adding :MOV to table - ((memoffs32 EAX) (o32 163 ow/od))
Adding :MOV to table - ((memoffs16 AX) (o16 163 ow/od))
Adding :MOV to table - ((memoffs8 AL) (162 ow/od))
Adding :MOV to table - ((EAX memoffs32) (o32 161 ow/od))
Adding :MOV to table - ((AX memoffs16) (o16 161 ow/od))
Adding :MOV to table - ((AL memoffs8) (160 ow/od))
Adding :MOV to table - ((r/m32 imm32) (o32 199 /0 id))
Adding :MOV to table - ((r/m16 imm16) (o16 199 /0 iw))
Adding :MOV to table - ((r/m8 imm8) (198 /0 ib))
Adding :MOV to table - ((reg32 imm32) (o32 184 +r id))
Adding :MOV to table - ((reg16 imm16) (o16 184 +r iw))
Adding :MOV to table - ((reg8 imm8) (176 +r ib))
Adding :MOV to table - ((reg32 r/m32) (o32 139 /r))
Adding :MOV to table - ((reg16 r/m16) (o16 139 /r))
Adding :MOV to table - ((reg8 r/m8) (138 /r))
Adding :MOV to table - ((r/m32 reg32) (o32 137 /r))
Adding :MOV to table - ((r/m16 reg16) (o16 137 /r))
Adding :MOV to table - ((r/m8 reg8) (136 /r))
Adding :MINSS to table - ((xmm1 xmm2/m32) (243 15 93 /r))
Adding :MINSD to table - ((xmm1 xmm2/m64) (242 15 93 /r))
Adding :MINPS to table - ((xmm1 xmm2/m128) (15 93 /r))
Adding :MINPD to table - ((xmm1 xmm2/m128) (102 15 93 /r))
Adding :MFENCE to table - (NIL (15 174 /6))
Adding :MAXSS to table - ((xmm1 xmm2/m32) (243 15 95 /r))
Adding :MAXSD to table - ((xmm1 xmm2/m64) (242 15 95 /r))
Adding :MAXPS to table - ((xmm1 xmm2/m128) (15 95 /r))
Adding :MAXPD to table - ((xmm1 xmm2/m128) (102 15 95 /r))
Adding :MASKMOVQ to table - ((mm1 mm2) (15 247 /r))
Adding :MASKMOVDQU to table - ((xmm1 xmm2) (102 15 247 /r))
Adding :LTR to table - ((r/m16) (15 0 /3))
Adding :LSL to table - ((reg32 r/m32) (o32 15 3 /r))
Adding :LSL to table - ((reg16 r/m16) (o16 15 3 /r))
Adding :LOOPNZ to table - ((imm ECX) (2610 224 rb))
Adding :LOOPNZ to table - ((imm CX) (2582 224 rb))
Adding :LOOPNZ to table - ((imm) (224 rb))
Adding :LOOPNE to table - ((imm ECX) (2610 224 rb))
Adding :LOOPNE to table - ((imm CX) (2582 224 rb))
Adding :LOOPNE to table - ((imm) (224 rb))
Adding :LOOPZ to table - ((imm ECX) (2610 225 rb))
Adding :LOOPZ to table - ((imm CX) (2582 225 rb))
Adding :LOOPZ to table - ((imm) (225 rb))
Adding :LOOPE to table - ((imm ECX) (2610 225 rb))
Adding :LOOPE to table - ((imm CX) (2582 225 rb))
Adding :LOOPE to table - ((imm) (225 rb))
Adding :LOOP to table - ((imm ECX) (2610 226 rb))
Adding :LOOP to table - ((imm CX) (2582 226 rb))
Adding :LOOP to table - ((imm) (226 rb))
Adding :LODSD to table - (NIL (o32 173))
Adding :LODSW to table - (NIL (o16 173))
Adding :LODSB to table - (NIL (172))
Adding :LOADALL286 to table - (NIL (15 5))
Adding :LOADALL to table - (NIL (15 7))
Adding :LMSW to table - ((r/m16) (15 1 /6))
Adding :LLDT to table - ((r/m16) (15 0 /2))
Adding :LIDT to table - ((mem) (15 1 /3))
Adding :LGDT to table - ((mem) (15 1 /2))
Adding :LFENCE to table - (NIL (15 174 /5))
Adding :LEAVE to table - (NIL (201))
Adding :LEA to table - ((reg32 mem) (o32 141 /r))
Adding :LEA to table - ((reg16 mem) (o16 141 /r))
Adding :LSS to table - ((reg32 mem) (o32 15 178 /r))
Adding :LSS to table - ((reg16 mem) (o16 15 178 /r))
Adding :LGS to table - ((reg32 mem) (o32 15 181 /r))
Adding :LGS to table - ((reg16 mem) (o16 15 181 /r))
Adding :LFS to table - ((reg32 mem) (o32 15 180 /r))
Adding :LFS to table - ((reg16 mem) (o16 15 180 /r))
Adding :LES to table - ((reg32 mem) (o32 196 /r))
Adding :LES to table - ((reg16 mem) (o16 196 /r))
Adding :LDS to table - ((reg32 mem) (o32 197 /r))
Adding :LDS to table - ((reg16 mem) (o16 197 /r))
Adding :LDMXCSR to table - ((mem32) (15 174 /2))
Adding :LAR to table - ((reg32 r/m32) (o32 15 2 /r))
Adding :LAR to table - ((reg16 r/m16) (o16 15 2 /r))
Adding :LAHF to table - (NIL (159))
Adding :JMP to table - ((r/m32) (o32 255 /4))
Adding :JMP to table - ((r/m16) (o16 255 /4))
Adding :JMP to table - ((mem32) (o32 255 /5))
Adding :JMP to table - ((mem) (o16 255 /5))
Adding :JMP to table - ((imm:imm32) (o32 234 id iw))
Adding :JMP to table - ((imm:imm16) (o16 234 iw iw))
Adding :JMP to table - ((imm) (235 rb))
Adding :JMP to table - ((imm) (233 rw/rd))
Adding :JECXZ to table - ((imm) (2610 227 rb))
Adding :JCXZ to table - ((imm) (2582 227 rb))
Adding :IRETD to table - (NIL (o32 207))
Adding :IRETW to table - (NIL (o16 207))
Adding :IRET to table - (NIL (207))
Adding :INVLPG to table - ((mem) (15 1 /7))
Adding :INVD to table - (NIL (15 8))
Adding :INTO to table - (NIL (206))
Adding :INT03 to table - (NIL (204))
Adding :INT3 to table - (NIL (204))
Adding :INT01 to table - (NIL (241))
Adding :ICEBP to table - (NIL (241))
Adding :INT1 to table - (NIL (241))
Adding :INT to table - ((imm8) (205 ib))
Adding :INSD to table - (NIL (o32 109))
Adding :INSW to table - (NIL (o16 109))
Adding :INSB to table - (NIL (108))
Adding :INC to table - ((r/m32) (o32 255 /0))
Adding :INC to table - ((r/m16) (o16 255 /0))
Adding :INC to table - ((r/m8) (254 /0))
Adding :INC to table - ((reg32) (o32 64 +r))
Adding :INC to table - ((reg16) (o16 64 +r))
Adding :IN to table - ((EAX DX) (o32 237))
Adding :IN to table - ((AX DX) (o16 237))
Adding :IN to table - ((AL DX) (236))
Adding :IN to table - ((EAX imm8) (o32 229 ib))
Adding :IN to table - ((AX imm8) (o16 229 ib))
Adding :IN to table - ((AL imm8) (228 ib))
Adding :IMUL to table - ((reg32 r/m32 imm32) (o32 105 /r id))
Adding :IMUL to table - ((reg32 r/m32 imm8) (o32 107 /r ib))
Adding :IMUL to table - ((reg16 r/m16 imm16) (o16 105 /r iw))
Adding :IMUL to table - ((reg16 r/m16 imm8) (o16 107 /r ib))
Adding :IMUL to table - ((reg32 imm32) (o32 105 /r id))
Adding :IMUL to table - ((reg32 imm8) (o32 107 /r ib))
Adding :IMUL to table - ((reg16 imm16) (o16 105 /r iw))
Adding :IMUL to table - ((reg16 imm8) (o16 107 /r ib))
Adding :IMUL to table - ((reg32 r/m32) (o32 15 175 /r))
Adding :IMUL to table - ((reg16 r/m16) (o16 15 175 /r))
Adding :IMUL to table - ((r/m32) (o32 247 /5))
Adding :IMUL to table - ((r/m16) (o16 247 /5))
Adding :IMUL to table - ((r/m8) (246 /5))
Adding :IDIV to table - ((r/m32) (o32 247 /7))
Adding :IDIV to table - ((r/m16) (o16 247 /7))
Adding :IDIV to table - ((r/m8) (246 /7))
Adding :IBTS to table - ((r/m32 reg32) (o32 15 167 /r))
Adding :IBTS to table - ((r/m16 reg16) (o16 15 167 /r))
Adding :HLT to table - (NIL (244))
Adding :FYL2XP1 to table - (NIL (217 249))
Adding :FYL2X to table - (NIL (217 241))
Adding :FXTRACT to table - (NIL (217 244))
Adding :FXSAVE to table - ((memory) (15 174 /0))
Adding :FXRSTOR to table - ((memory) (15 174 /1))
Adding :FXCH to table - ((ST0 fpureg) (217 200 +r))
Adding :FXCH to table - ((fpureg ST0) (217 200 +r))
Adding :FXCH to table - ((fpureg) (217 200 +r))
Adding :FXCH to table - (NIL (217 201))
Adding :FXAM to table - (NIL (217 229))
Adding :FUCOMIP to table - ((ST0 fpureg) (223 232 +r))
Adding :FUCOMIP to table - ((fpureg) (223 232 +r))
Adding :FUCOMI to table - ((ST0 fpureg) (219 232 +r))
Adding :FUCOMI to table - ((fpureg) (219 232 +r))
Adding :FUCOMPP to table - (NIL (218 233))
Adding :FUCOMP to table - ((ST0 fpureg) (221 232 +r))
Adding :FUCOMP to table - ((fpureg) (221 232 +r))
Adding :FUCOM to table - ((ST0 fpureg) (221 224 +r))
Adding :FUCOM to table - ((fpureg) (221 224 +r))
Adding :FTST to table - (NIL (217 228))
Adding :FSUBRP to table - ((fpureg ST0) (222 224 +r))
Adding :FSUBRP to table - ((fpureg) (222 224 +r))
Adding :FSUBP to table - ((fpureg ST0) (222 232 +r))
Adding :FSUBP to table - ((fpureg) (222 232 +r))
Adding :FSUBR to table - ((fpureg ST0) (220 224 +r))
Adding :FSUBR to table - ((fpureg) (220 224 +r))
Adding :FSUBR to table - ((ST0 fpureg) (216 232 +r))
Adding :FSUBR to table - ((fpureg) (216 232 +r))
Adding :FSUBR to table - ((mem64) (220 /5))
Adding :FSUBR to table - ((mem32) (216 /5))
Adding :FSUB to table - ((fpureg ST0) (220 232 +r))
Adding :FSUB to table - ((fpureg) (220 232 +r))
Adding :FSUB to table - ((ST0 fpureg) (216 224 +r))
Adding :FSUB to table - ((fpureg) (216 224 +r))
Adding :FSUB to table - ((mem64) (220 /4))
Adding :FSUB to table - ((mem32) (216 /4))
Adding :FNSTSW to table - ((AX) (223 224))
Adding :FNSTSW to table - ((mem16) (221 /7))
Adding :FSTSW to table - ((AX) (155 223 224))
Adding :FSTSW to table - ((mem16) (155 221 /7))
Adding :FNSTENV to table - ((mem) (217 /6))
Adding :FSTENV to table - ((mem) (155 217 /6))
Adding :FNSTCW to table - ((mem16) (217 /7))
Adding :FSTCW to table - ((mem16) (155 217 /7))
Adding :FSTP to table - ((fpureg) (221 216 +r))
Adding :FSTP to table - ((mem80) (219 /7))
Adding :FSTP to table - ((mem64) (221 /3))
Adding :FSTP to table - ((mem32) (217 /3))
Adding :FST to table - ((fpureg) (221 208 +r))
Adding :FST to table - ((mem64) (221 /2))
Adding :FST to table - ((mem32) (217 /2))
Adding :FSQRT to table - (NIL (217 250))
Adding :FSINCOS to table - (NIL (217 251))
Adding :FSIN to table - (NIL (217 254))
Adding :FSETPM to table - (NIL (219 228))
Adding :FSCALE to table - (NIL (217 253))
Adding :FRSTOR to table - ((mem) (221 /4))
Adding :FNSAVE to table - ((mem) (221 /6))
Adding :FSAVE to table - ((mem) (155 221 /6))
Adding :FRNDINT to table - (NIL (217 252))
Adding :FPREM1 to table - (NIL (217 245))
Adding :FPREM to table - (NIL (217 248))
Adding :FPTAN to table - (NIL (217 242))
Adding :FPATAN to table - (NIL (217 243))
Adding :FNOP to table - (NIL (217 208))
Adding :FMULP to table - ((fpureg ST0) (222 200 +r))
Adding :FMULP to table - ((fpureg) (222 200 +r))
Adding :FMUL to table - ((fpureg ST0) (220 200 +r))
Adding :FMUL to table - ((fpureg) (220 200 +r))
Adding :FMUL to table - ((ST0 fpureg) (216 200 +r))
Adding :FMUL to table - ((fpureg) (216 200 +r))
Adding :FMUL to table - ((mem64) (220 /1))
Adding :FMUL to table - ((mem32) (216 /1))
Adding :FLDENV to table - ((mem) (217 /4))
Adding :FLDCW to table - ((mem16) (217 /5))
Adding :FLDZ to table - (NIL (217 238))
Adding :FLDPI to table - (NIL (217 235))
Adding :FLDLN2 to table - (NIL (217 237))
Adding :FLDLG2 to table - (NIL (217 236))
Adding :FLDL2T to table - (NIL (217 233))
Adding :FLDL2E to table - (NIL (217 234))
Adding :FLD1 to table - (NIL (217 232))
Adding :FLD to table - ((fpureg) (217 192 +r))
Adding :FLD to table - ((mem80) (219 /5))
Adding :FLD to table - ((mem64) (221 /0))
Adding :FLD to table - ((mem32) (217 /0))
Adding :FISUBR to table - ((mem32) (218 /5))
Adding :FISUBR to table - ((mem16) (222 /5))
Adding :FISUB to table - ((mem32) (218 /4))
Adding :FISUB to table - ((mem16) (222 /4))
Adding :FNINIT to table - (NIL (219 227))
Adding :FINIT to table - (NIL (155 219 227))
Adding :FINCSTP to table - (NIL (217 247))
Adding :FIMUL to table - ((mem32) (218 /1))
Adding :FIMUL to table - ((mem16) (222 /1))
Adding :FISTP to table - ((mem64) (223 /7))
Adding :FISTP to table - ((mem32) (219 /3))
Adding :FISTP to table - ((mem16) (223 /3))
Adding :FIST to table - ((mem32) (219 /2))
Adding :FIST to table - ((mem16) (223 /2))
Adding :FILD to table - ((mem64) (223 /5))
Adding :FILD to table - ((mem32) (219 /0))
Adding :FILD to table - ((mem16) (223 /0))
Adding :FIDIVR to table - ((mem32) (218 /7))
Adding :FIDIVR to table - ((mem16) (222 /7))
Adding :FIDIV to table - ((mem32) (218 /6))
Adding :FIDIV to table - ((mem16) (222 /6))
Adding :FICOMP to table - ((mem32) (218 /3))
Adding :FICOMP to table - ((mem16) (222 /3))
Adding :FICOM to table - ((mem32) (218 /2))
Adding :FICOM to table - ((mem16) (222 /2))
Adding :FIADD to table - ((mem32) (218 /0))
Adding :FIADD to table - ((mem16) (222 /0))
Adding :FFREEP to table - ((fpureg) (223 192 +r))
Adding :FFREE to table - ((fpureg) (221 192 +r))
Adding :FEMMS to table - (NIL (15 14))
Adding :FDIVRP to table - ((fpureg ST0) (222 240 +r))
Adding :FDIVRP to table - ((fpureg) (222 240 +r))
Adding :FDIVP to table - ((fpureg ST0) (222 248 +r))
Adding :FDIVP to table - ((fpureg) (222 248 +r))
Adding :FDIVR to table - ((fpureg ST0) (220 240 +r))
Adding :FDIVR to table - ((fpureg) (220 240 +r))
Adding :FDIVR to table - ((ST0 fpureg) (216 248 +r))
Adding :FDIVR to table - ((fpureg) (216 248 +r))
Adding :FDIVR to table - ((mem64) (220 /0))
Adding :FDIVR to table - ((mem32) (216 /0))
Adding :FDIV to table - ((fpureg ST0) (220 248 +r))
Adding :FDIV to table - ((fpureg) (220 248 +r))
Adding :FDIV to table - ((ST0 fpureg) (216 240 +r))
Adding :FDIV to table - ((fpureg) (216 240 +r))
Adding :FDIV to table - ((mem64) (220 /6))
Adding :FDIV to table - ((mem32) (216 /6))
Adding :FNENI to table - (NIL (219 224))
Adding :FENI to table - (NIL (155 219 224))
Adding :FNDISI to table - (NIL (219 225))
Adding :FDISI to table - (NIL (155 219 225))
Adding :FDECSTP to table - (NIL (217 246))
Adding :FCOS to table - (NIL (217 255))
Adding :FCOMIP to table - ((ST0 fpureg) (223 240 +r))
Adding :FCOMIP to table - ((fpureg) (223 240 +r))
Adding :FCOMI to table - ((ST0 fpureg) (219 240 +r))
Adding :FCOMI to table - ((fpureg) (219 240 +r))
Adding :FCOMPP to table - (NIL (222 217))
Adding :FCOMP to table - ((ST0 fpureg) (216 216 +r))
Adding :FCOMP to table - ((fpureg) (216 216 +r))
Adding :FCOMP to table - ((mem64) (220 /3))
Adding :FCOMP to table - ((mem32) (216 /3))
Adding :FCOM to table - ((ST0 fpureg) (216 208 +r))
Adding :FCOM to table - ((fpureg) (216 208 +r))
Adding :FCOM to table - ((mem64) (220 /2))
Adding :FCOM to table - ((mem32) (216 /2))
Adding :FCMOVNU to table - ((ST0 fpureg) (219 216 +r))
Adding :FCMOVNU to table - ((fpureg) (219 216 +r))
Adding :FCMOVNBE to table - ((ST0 fpureg) (219 208 +r))
Adding :FCMOVNBE to table - ((fpureg) (219 208 +r))
Adding :FCMOVNE to table - ((ST0 fpureg) (219 200 +r))
Adding :FCMOVNE to table - ((fpureg) (219 200 +r))
Adding :FCMOVNB to table - ((ST0 fpureg) (219 192 +r))
Adding :FCMOVNB to table - ((fpureg) (219 192 +r))
Adding :FCMOVU to table - ((ST0 fpureg) (218 216 +r))
Adding :FCMOVU to table - ((fpureg) (218 216 +r))
Adding :FCMOVBE to table - ((ST0 fpureg) (218 208 +r))
Adding :FCMOVBE to table - ((fpureg) (218 208 +r))
Adding :FCMOVE to table - ((ST0 fpureg) (218 200 +r))
Adding :FCMOVE to table - ((fpureg) (218 200 +r))
Adding :FCMOVB to table - ((ST0 fpureg) (218 192 +r))
Adding :FCMOVB to table - ((fpureg) (218 192 +r))
Adding :FNCLEX to table - (NIL (219 226))
Adding :FCLEX to table - (NIL (155 219 226))
Adding :FCHS to table - (NIL (217 224))
Adding :FBSTP to table - ((mem80) (223 /6))
Adding :FBLD to table - ((mem80) (223 /4))
Adding :FADDP to table - ((fpureg ST0) (222 192 +r))
Adding :FADDP to table - ((fpureg) (222 192 +r))
Adding :FADD to table - ((fpureg ST0) (220 192 +r))
Adding :FADD to table - ((fpureg) (220 192 +r))
Adding :FADD to table - ((ST0 fpureg) (216 192 +r))
Adding :FADD to table - ((fpureg) (216 192 +r))
Adding :FADD to table - ((mem64) (220 /0))
Adding :FADD to table - ((mem32) (216 /0))
Adding :FABS to table - (NIL (217 225))
Adding :F2XM1 to table - (NIL (217 240))
Adding :ENTER to table - ((imm imm) (200 iw ib))
Adding :EMMS to table - (NIL (15 119))
Adding :DIVSS to table - ((xmm1 xmm2/mem32) (243 15 94 /r))
Adding :DIVSD to table - ((xmm1 xmm2/mem64) (242 15 94 /r))
Adding :DIVPS to table - ((xmm1 xmm2/mem128) (15 94 /r))
Adding :DIVPD to table - ((xmm1 xmm2/mem128) (102 15 94 /r))
Adding :DIV to table - ((r/m32) (o32 247 /6))
Adding :DIV to table - ((r/m16) (o16 247 /6))
Adding :DIV to table - ((r/m8) (246 /6))
Adding :DEC to table - ((r/m32) (o32 255 /1))
Adding :DEC to table - ((r/m16) (o16 255 /1))
Adding :DEC to table - ((r/m8) (254 /1))
Adding :DEC to table - ((reg32) (o32 72 +r))
Adding :DEC to table - ((reg16) (o16 72 +r))
Adding :DAS to table - (NIL (47))
Adding :DAA to table - (NIL (39))
Adding :CVTTSD2SI to table - ((reg32 xmm/mem32) (243 15 44 /r))
Adding :CVTTSD2SI to table - ((reg32 xmm/mem64) (242 15 44 /r))
Adding :CVTTPS2PI to table - ((mm xmm/mem64) (15 44 /r))
Adding :CVTTPS2DQ to table - ((xmm1 xmm2/mem128) (243 15 91 /r))
Adding :CVTTPD2PI to table - ((mm xmm/mem128) (102 15 44 /r))
Adding :CVTTPD2DQ to table - ((xmm1 xmm2/mem128) (102 15 230 /r))
Adding :CVTSS2SI to table - ((reg32 xmm/mem32) (243 15 45 /r))
Adding :CVTSS2SD to table - ((xmm1 xmm2/mem32) (243 15 90 /r))
Adding :CVTSI2SS to table - ((xmm r/m32) (243 15 42 /r))
Adding :CVTSI2SD to table - ((xmm r/m32) (242 15 42 /r))
Adding :CVTSD2SS to table - ((xmm1 xmm2/mem64) (242 15 90 /r))
Adding :CVTSD2SI to table - ((reg32 xmm/mem64) (242 15 45 /r))
Adding :CVTPS2PI to table - ((mm xmm/mem64) (15 45 /r))
Adding :CVTPS2PD to table - ((xmm1 xmm2/mem64) (15 90 /r))
Adding :CVTPS2DQ to table - ((xmm1 xmm2/mem128) (102 15 91 /r))
Adding :CVTPI2PS to table - ((xmm mm/mem64) (15 42 /r))
Adding :CVTPI2PD to table - ((xmm mm/mem64) (102 15 42 /r))
Adding :CVTPD2PS to table - ((xmm1 xmm2/mem128) (102 15 90 /r))
Adding :CVTPD2PI to table - ((mm xmm/mem128) (102 15 45 /r))
Adding :CVTPD2DQ to table - ((xmm1 xmm2/mem128) (242 15 230 /r))
Adding :CVTDQ2PS to table - ((xmm1 xmm2/mem128) (15 91 /r))
Adding :CVTDQ2PD to table - ((xmm1 xmm2/mem64) (243 15 230 /r))
Adding :CPUID to table - (NIL (15 162))
Adding :COMISS to table - ((xmm1 xmm2/mem32) (102 15 47 /r))
Adding :COMISD to table - ((xmm1 xmm2/mem64) (102 15 47 /r))
Adding :CMPXCHG8B to table - ((mem) (15 199 /1))
Adding :CMPXCHG486 to table - ((r/m32 reg32) (o32 15 167 /r))
Adding :CMPXCHG486 to table - ((r/m16 reg16) (o16 15 167 /r))
Adding :CMPXCHG486 to table - ((r/m8 reg8) (15 166 /r))
Adding :CMPXCHG to table - ((r/m32 reg32) (o32 15 177 /r))
Adding :CMPXCHG to table - ((r/m16 reg16) (o16 15 177 /r))
Adding :CMPXCHG to table - ((r/m8 reg8) (15 176 /r))
Adding :CMPORDSS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 7))
Adding :CMPNLESS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 6))
Adding :CMPNLTSS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 5))
Adding :CMPNEQSS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 4))
Adding :CMPUNORDSS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 3))
Adding :CMPLESS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 2))
Adding :CMPLTSS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 1))
Adding :CMPEQSS to table - ((xmm1 xmm2/mem32) (243 15 194 /r 0))
Adding :CMPSS to table - ((xmm1 xmm2/mem32 imm8) (243 15 194 /r ib))
Adding :CMPORDSD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 7))
Adding :CMPNLESD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 6))
Adding :CMPNLTSD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 5))
Adding :CMPNEQSD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 4))
Adding :CMPUNORDSD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 3))
Adding :CMPLESD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 2))
Adding :CMPLTSD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 1))
Adding :CMPEQSD to table - ((xmm1 xmm2/mem64) (242 15 194 /r 0))
Adding :CMPSD to table - ((xmm1 xmm2/mem64 imm8) (242 15 194 /r ib))
Adding :CMPSD to table - (NIL (o32 167))
Adding :CMPSW to table - (NIL (o16 167))
Adding :CMPSB to table - (NIL (166))
Adding :CMPORDPS to table - ((xmm1 xmm2/mem128) (15 194 /r 7))
Adding :CMPNLEPS to table - ((xmm1 xmm2/mem128) (15 194 /r 6))
Adding :CMPNLTPS to table - ((xmm1 xmm2/mem128) (15 194 /r 5))
Adding :CMPNEQPS to table - ((xmm1 xmm2/mem128) (15 194 /r 4))
Adding :CMPUNORDPS to table - ((xmm1 xmm2/mem128) (15 194 /r 3))
Adding :CMPLEPS to table - ((xmm1 xmm2/mem128) (15 194 /r 2))
Adding :CMPLTPS to table - ((xmm1 xmm2/mem128) (15 194 /r 1))
Adding :CMPEQPS to table - ((xmm1 xmm2/mem128) (15 194 /r 0))
Adding :CMPPS to table - ((xmm1 xmm2/mem128 imm8) (15 194 /r ib))
Adding :CMPORDPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 7))
Adding :CMPNLEPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 6))
Adding :CMPNLTPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 5))
Adding :CMPNEQPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 4))
Adding :CMPUNORDPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 3))
Adding :CMPLEPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 2))
Adding :CMPLTPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 1))
Adding :CMPEQPD to table - ((xmm1 xmm2/mem128) (102 15 194 /r 0))
Adding :CMPPD to table - ((xmm1 xmm2/mem128 imm8) (102 15 194 /r ib))
Adding :CMP to table - ((EAX imm32) (o32 61 id))
Adding :CMP to table - ((AX imm16) (o16 61 iw))
Adding :CMP to table - ((AL imm8) (60 ib))
Adding :CMP to table - ((r/m32 imm8) (o32 131 /0 ib))
Adding :CMP to table - ((r/m16 imm8) (o16 131 /0 ib))
Adding :CMP to table - ((r/m32 imm32) (o32 129 /0 id))
Adding :CMP to table - ((r/m16 imm16) (o16 129 /0 iw))
Adding :CMP to table - ((r/m8 imm8) (128 /0 ib))
Adding :CMP to table - ((reg32 r/m32) (o32 59 /r))
Adding :CMP to table - ((reg16 r/m16) (o16 59 /r))
Adding :CMP to table - ((reg8 r/m8) (58 /r))
Adding :CMP to table - ((r/m32 reg32) (o32 57 /r))
Adding :CMP to table - ((r/m16 reg16) (o16 57 /r))
Adding :CMP to table - ((r/m8 reg8) (56 /r))
Adding :CMC to table - (NIL (245))
Adding :CLFLUSH to table - ((mem) (15 174 /7))
Adding :CLTS to table - (NIL (15 6))
Adding :CLI to table - (NIL (250))
Adding :CLD to table - (NIL (252))
Adding :CLC to table - (NIL (248))
Adding :CDQ to table - (NIL (o32 153))
Adding :CWD to table - (NIL (o16 153))
Adding :CWDE to table - (NIL (o32 152))
Adding :CBW to table - (NIL (o16 152))
Adding :CALL to table - ((r/m32) (o32 255 /2))
Adding :CALL to table - ((r/m16) (o16 255 /2))
Adding :CALL to table - ((mem32) (o32 255 /3))
Adding :CALL to table - ((mem16) (o16 255 /3))
Adding :CALL to table - ((imm:imm32) (o32 154 id iw))
Adding :CALL to table - ((imm:imm16) (o16 154 iw iw))
Adding :CALL to table - ((imm) (232 rw/rd))
Adding :BTS to table - ((r/m32 imm) (o32 15 186 /5 ib))
Adding :BTS to table - ((r/m16 imm) (o16 15 186 /5 ib))
Adding :BTS to table - ((r/m32 reg32) (o32 15 171 /r))
Adding :BTS to table - ((r/m16 reg16) (o16 15 171 /r))
Adding :BTR to table - ((r/m32 imm8) (o32 15 186 /6 ib))
Adding :BTR to table - ((r/m16 imm8) (o16 15 186 /6 ib))
Adding :BTR to table - ((r/m32 reg32) (o32 15 179 /r))
Adding :BTR to table - ((r/m16 reg16) (o16 15 179 /r))
Adding :BTC to table - ((r/m32 imm8) (o32 15 186 /7 ib))
Adding :BTC to table - ((r/m16 imm8) (o16 15 186 /7 ib))
Adding :BTC to table - ((r/m32 reg32) (o32 15 187 /r))
Adding :BTC to table - ((r/m16 reg16) (o16 15 187 /r))
Adding :BT to table - ((r/m32 imm8) (o32 15 186 /4 ib))
Adding :BT to table - ((r/m16 imm8) (o16 15 186 /4 ib))
Adding :BT to table - ((r/m32 reg32) (o32 15 163 /r))
Adding :BT to table - ((r/m16 reg16) (o16 15 163 /r))
Adding :BSWAP to table - ((reg32) (o32 15 200 +r))
Adding :BSR to table - ((reg32 r/m32) (o32 15 189 /r))
Adding :BSR to table - ((reg16 r/m16) (o16 15 189 /r))
Adding :BSF to table - ((reg32 r/m32) (o32 15 188 /r))
Adding :BSF to table - ((reg16 r/m16) (o16 15 188 /r))
Adding :BOUND to table - ((reg32 mem) (o32 98 /r))
Adding :BOUND to table - ((reg16 mem) (o16 98 /r))
Adding :ARPL to table - ((r/m16 reg16) (99 /r))
Adding :ANDPS to table - ((xmm1 xmm2/mem128) (15 84 /r))
Adding :ANDPD to table - ((xmm1 xmm2/mem128) (102 15 84 /r))
Adding :ANDNPS to table - ((xmm1 xmm2/mem128) (15 85 /r))
Adding :ANDNPD to table - ((xmm1 xmm2/mem128) (102 15 85 /r))
Adding :AND to table - ((EAX imm32) (o32 37 id))
Adding :AND to table - ((AX imm16) (o16 37 iw))
Adding :AND to table - ((AL imm8) (36 ib))
Adding :AND to table - ((r/m32 imm8) (o32 131 /4 ib))
Adding :AND to table - ((r/m16 imm8) (o16 131 /4 ib))
Adding :AND to table - ((r/m32 imm32) (o32 129 /4 id))
Adding :AND to table - ((r/m16 imm16) (o16 129 /4 iw))
Adding :AND to table - ((r/m8 imm8) (128 /4 ib))
Adding :AND to table - ((reg32 r/m32) (o32 35 /r))
Adding :AND to table - ((reg16 r/m16) (o16 35 /r))
Adding :AND to table - ((reg8 r/m8) (34 /r))
Adding :AND to table - ((r/m32 reg32) (o32 33 /r))
Adding :AND to table - ((r/m16 reg16) (o16 33 /r))
Adding :AND to table - ((r/m8 reg8) (32 /r))
Adding :ADDSS to table - ((xmm1 xmm2/mem32) (243 15 88 /r))
Adding :ADDSD to table - ((xmm1 xmm2/mem64) (242 15 88 /r))
Adding :ADDPS to table - ((xmm1 xmm2/mem128) (15 88 /r))
Adding :ADDPD to table - ((xmm1 xmm2/mem128) (102 15 88 /r))
Adding :ADD to table - ((EAX imm32) (o32 5 id))
Adding :ADD to table - ((AX imm16) (o16 5 iw))
Adding :ADD to table - ((AL imm8) (4 ib))
Adding :ADD to table - ((r/m32 imm8) (o32 131 /0 ib))
Adding :ADD to table - ((r/m16 imm8) (o16 131 /0 ib))
Adding :ADD to table - ((r/m32 imm32) (o32 129 /0 id))
Adding :ADD to table - ((r/m16 imm16) (o16 129 /0 iw))
Adding :ADD to table - ((r/m8 imm8) (128 /0 ib))
Adding :ADD to table - ((reg32 r/m32) (o32 3 /r))
Adding :ADD to table - ((reg16 r/m16) (o16 3 /r))
Adding :ADD to table - ((reg8 r/m8) (2 /r))
Adding :ADD to table - ((r/m32 reg32) (o32 1 /r))
Adding :ADD to table - ((r/m16 reg16) (o16 1 /r))
Adding :ADD to table - ((r/m8 reg8) (0 /r))
Adding :ADC to table - ((EAX imm32) (o32 21 id))
Adding :ADC to table - ((AX imm16) (o16 21 iw))
Adding :ADC to table - ((AL imm8) (20 ib))
Adding :ADC to table - ((r/m32 imm8) (o32 131 /2 ib))
Adding :ADC to table - ((r/m16 imm8) (o16 131 /2 ib))
Adding :ADC to table - ((r/m32 imm32) (o32 129 /2 id))
Adding :ADC to table - ((r/m16 imm16) (o16 129 /2 iw))
Adding :ADC to table - ((r/m8 imm8) (128 /2 ib))
Adding :ADC to table - ((reg32 r/m32) (o32 19 /r))
Adding :ADC to table - ((reg16 r/m16) (o16 19 /r))
Adding :ADC to table - ((reg8 r/m8) (18 /r))
Adding :ADC to table - ((r/m32 reg32) (o32 17 /r))
Adding :ADC to table - ((r/m16 reg16) (o16 17 /r))
Adding :ADC to table - ((r/m8 reg8) (16 /r))
Adding :AAM to table - ((imm) (212 ib))
Adding :AAM to table - (NIL (212 10))
Adding :AAD to table - ((imm) (213 ib))
Adding :AAD to table - (NIL (213 10))
Adding :AAS to table - (NIL (63))
Adding :AAA to table - (NIL (55))
Adding :|J0 NEAR| to table - ((imm) (15 128 rw/rd))
Adding :|JNO NEAR| to table - ((imm) (15 129 rw/rd))
Adding :|JB NEAR| to table - ((imm) (15 130 rw/rd))
Adding :|JC NEAR| to table - ((imm) (15 130 rw/rd))
Adding :|JNAE NEAR| to table - ((imm) (15 130 rw/rd))
Adding :|JAE NEAR| to table - ((imm) (15 131 rw/rd))
Adding :|JNB NEAR| to table - ((imm) (15 131 rw/rd))
Adding :|JNC NEAR| to table - ((imm) (15 131 rw/rd))
Adding :|JE NEAR| to table - ((imm) (15 132 rw/rd))
Adding :|JZ NEAR| to table - ((imm) (15 132 rw/rd))
Adding :|JNE NEAR| to table - ((imm) (15 133 rw/rd))
Adding :|JNZ NEAR| to table - ((imm) (15 133 rw/rd))
Adding :|JBE NEAR| to table - ((imm) (15 134 rw/rd))
Adding :|JNA NEAR| to table - ((imm) (15 134 rw/rd))
Adding :|JA NEAR| to table - ((imm) (15 135 rw/rd))
Adding :|JNBE NEAR| to table - ((imm) (15 135 rw/rd))
Adding :|JS NEAR| to table - ((imm) (15 136 rw/rd))
Adding :|JNS NEAR| to table - ((imm) (15 137 rw/rd))
Adding :|JP NEAR| to table - ((imm) (15 138 rw/rd))
Adding :|JPE NEAR| to table - ((imm) (15 138 rw/rd))
Adding :|JNP NEAR| to table - ((imm) (15 139 rw/rd))
Adding :|JPO NEAR| to table - ((imm) (15 139 rw/rd))
Adding :|JL NEAR| to table - ((imm) (15 140 rw/rd))
Adding :|JNGE NEAR| to table - ((imm) (15 140 rw/rd))
Adding :|JGE NEAR| to table - ((imm) (15 141 rw/rd))
Adding :|JNL NEAR| to table - ((imm) (15 141 rw/rd))
Adding :|JLE NEAR| to table - ((imm) (15 142 rw/rd))
Adding :|JNG NEAR| to table - ((imm) (15 142 rw/rd))
Adding :|JG NEAR| to table - ((imm) (15 143 rw/rd))
Adding :|JNLE NEAR| to table - ((imm) (15 143 rw/rd))
Adding :J0 to table - ((imm) (112 rb))
Adding :JNO to table - ((imm) (113 rb))
Adding :JB to table - ((imm) (114 rb))
Adding :JC to table - ((imm) (114 rb))
Adding :JNAE to table - ((imm) (114 rb))
Adding :JAE to table - ((imm) (115 rb))
Adding :JNB to table - ((imm) (115 rb))
Adding :JNC to table - ((imm) (115 rb))
Adding :JE to table - ((imm) (116 rb))
Adding :JZ to table - ((imm) (116 rb))
Adding :JNE to table - ((imm) (117 rb))
Adding :JNZ to table - ((imm) (117 rb))
Adding :JBE to table - ((imm) (118 rb))
Adding :JNA to table - ((imm) (118 rb))
Adding :JA to table - ((imm) (119 rb))
Adding :JNBE to table - ((imm) (119 rb))
Adding :JS to table - ((imm) (120 rb))
Adding :JNS to table - ((imm) (121 rb))
Adding :JP to table - ((imm) (122 rb))
Adding :JPE to table - ((imm) (122 rb))
Adding :JNP to table - ((imm) (123 rb))
Adding :JPO to table - ((imm) (123 rb))
Adding :JL to table - ((imm) (124 rb))
Adding :JNGE to table - ((imm) (124 rb))
Adding :JGE to table - ((imm) (125 rb))
Adding :JNL to table - ((imm) (125 rb))
Adding :JLE to table - ((imm) (126 rb))
Adding :JNG to table - ((imm) (126 rb))
Adding :JG to table - ((imm) (127 rb))
Adding :JNLE to table - ((imm) (127 rb))
Adding :SET0 to table - ((r/m8) (15 144 /2))
Adding :SETNO to table - ((r/m8) (15 145 /2))
Adding :SETB to table - ((r/m8) (15 146 /2))
Adding :SETC to table - ((r/m8) (15 146 /2))
Adding :SETNAE to table - ((r/m8) (15 146 /2))
Adding :SETAE to table - ((r/m8) (15 147 /2))
Adding :SETNB to table - ((r/m8) (15 147 /2))
Adding :SETNC to table - ((r/m8) (15 147 /2))
Adding :SETE to table - ((r/m8) (15 148 /2))
Adding :SETZ to table - ((r/m8) (15 148 /2))
Adding :SETNE to table - ((r/m8) (15 149 /2))
Adding :SETNZ to table - ((r/m8) (15 149 /2))
Adding :SETBE to table - ((r/m8) (15 150 /2))
Adding :SETNA to table - ((r/m8) (15 150 /2))
Adding :SETA to table - ((r/m8) (15 151 /2))
Adding :SETNBE to table - ((r/m8) (15 151 /2))
Adding :SETS to table - ((r/m8) (15 152 /2))
Adding :SETNS to table - ((r/m8) (15 153 /2))
Adding :SETP to table - ((r/m8) (15 154 /2))
Adding :SETPE to table - ((r/m8) (15 154 /2))
Adding :SETNP to table - ((r/m8) (15 155 /2))
Adding :SETPO to table - ((r/m8) (15 155 /2))
Adding :SETL to table - ((r/m8) (15 156 /2))
Adding :SETNGE to table - ((r/m8) (15 156 /2))
Adding :SETGE to table - ((r/m8) (15 157 /2))
Adding :SETNL to table - ((r/m8) (15 157 /2))
Adding :SETLE to table - ((r/m8) (15 158 /2))
Adding :SETNG to table - ((r/m8) (15 158 /2))
Adding :SETG to table - ((r/m8) (15 159 /2))
Adding :SETNLE to table - ((r/m8) (15 159 /2))
Adding :CMOV0 to table - ((reg32 r/m32) (o32 15 64 /r))
Adding :CMOVNO to table - ((reg32 r/m32) (o32 15 65 /r))
Adding :CMOVB to table - ((reg32 r/m32) (o32 15 66 /r))
Adding :CMOVC to table - ((reg32 r/m32) (o32 15 66 /r))
Adding :CMOVNAE to table - ((reg32 r/m32) (o32 15 66 /r))
Adding :CMOVAE to table - ((reg32 r/m32) (o32 15 67 /r))
Adding :CMOVNB to table - ((reg32 r/m32) (o32 15 67 /r))
Adding :CMOVNC to table - ((reg32 r/m32) (o32 15 67 /r))
Adding :CMOVE to table - ((reg32 r/m32) (o32 15 68 /r))
Adding :CMOVZ to table - ((reg32 r/m32) (o32 15 68 /r))
Adding :CMOVNE to table - ((reg32 r/m32) (o32 15 69 /r))
Adding :CMOVNZ to table - ((reg32 r/m32) (o32 15 69 /r))
Adding :CMOVBE to table - ((reg32 r/m32) (o32 15 70 /r))
Adding :CMOVNA to table - ((reg32 r/m32) (o32 15 70 /r))
Adding :CMOVA to table - ((reg32 r/m32) (o32 15 71 /r))
Adding :CMOVNBE to table - ((reg32 r/m32) (o32 15 71 /r))
Adding :CMOVS to table - ((reg32 r/m32) (o32 15 72 /r))
Adding :CMOVNS to table - ((reg32 r/m32) (o32 15 73 /r))
Adding :CMOVP to table - ((reg32 r/m32) (o32 15 74 /r))
Adding :CMOVPE to table - ((reg32 r/m32) (o32 15 74 /r))
Adding :CMOVNP to table - ((reg32 r/m32) (o32 15 75 /r))
Adding :CMOVPO to table - ((reg32 r/m32) (o32 15 75 /r))
Adding :CMOVL to table - ((reg32 r/m32) (o32 15 76 /r))
Adding :CMOVNGE to table - ((reg32 r/m32) (o32 15 76 /r))
Adding :CMOVGE to table - ((reg32 r/m32) (o32 15 77 /r))
Adding :CMOVNL to table - ((reg32 r/m32) (o32 15 77 /r))
Adding :CMOVLE to table - ((reg32 r/m32) (o32 15 78 /r))
Adding :CMOVNG to table - ((reg32 r/m32) (o32 15 78 /r))
Adding :CMOVG to table - ((reg32 r/m32) (o32 15 79 /r))
Adding :CMOVNLE to table - ((reg32 r/m32) (o32 15 79 /r))
Adding :CMOV0 to table - ((reg16 r/m16) (o16 15 64 /r))
Adding :CMOVNO to table - ((reg16 r/m16) (o16 15 65 /r))
Adding :CMOVB to table - ((reg16 r/m16) (o16 15 66 /r))
Adding :CMOVC to table - ((reg16 r/m16) (o16 15 66 /r))
Adding :CMOVNAE to table - ((reg16 r/m16) (o16 15 66 /r))
Adding :CMOVAE to table - ((reg16 r/m16) (o16 15 67 /r))
Adding :CMOVNB to table - ((reg16 r/m16) (o16 15 67 /r))
Adding :CMOVNC to table - ((reg16 r/m16) (o16 15 67 /r))
Adding :CMOVE to table - ((reg16 r/m16) (o16 15 68 /r))
Adding :CMOVZ to table - ((reg16 r/m16) (o16 15 68 /r))
Adding :CMOVNE to table - ((reg16 r/m16) (o16 15 69 /r))
Adding :CMOVNZ to table - ((reg16 r/m16) (o16 15 69 /r))
Adding :CMOVBE to table - ((reg16 r/m16) (o16 15 70 /r))
Adding :CMOVNA to table - ((reg16 r/m16) (o16 15 70 /r))
Adding :CMOVA to table - ((reg16 r/m16) (o16 15 71 /r))
Adding :CMOVNBE to table - ((reg16 r/m16) (o16 15 71 /r))
Adding :CMOVS to table - ((reg16 r/m16) (o16 15 72 /r))
Adding :CMOVNS to table - ((reg16 r/m16) (o16 15 73 /r))
Adding :CMOVP to table - ((reg16 r/m16) (o16 15 74 /r))
Adding :CMOVPE to table - ((reg16 r/m16) (o16 15 74 /r))
Adding :CMOVNP to table - ((reg16 r/m16) (o16 15 75 /r))
Adding :CMOVPO to table - ((reg16 r/m16) (o16 15 75 /r))
Adding :CMOVL to table - ((reg16 r/m16) (o16 15 76 /r))
Adding :CMOVNGE to table - ((reg16 r/m16) (o16 15 76 /r))
Adding :CMOVGE to table - ((reg16 r/m16) (o16 15 77 /r))
Adding :CMOVNL to table - ((reg16 r/m16) (o16 15 77 /r))
Adding :CMOVLE to table - ((reg16 r/m16) (o16 15 78 /r))
Adding :CMOVNG to table - ((reg16 r/m16) (o16 15 78 /r))
Adding :CMOVG to table - ((reg16 r/m16) (o16 15 79 /r))
Adding :CMOVNLE to table - ((reg16 r/m16) (o16 15 79 /r))
NIL
CL-USER> (cl-x86-asm::make-segment "text" :segment-type 'data-segment :set-to-current t)
; Evaluation aborted
CL-USER> (cl-x86-asm::make-segment "text" :segment-type 'cl-x86-asm::data-segment :set-to-current t)
#
CL-USER> (cl-x86-asm::assemble-forms :AAD :RET)
Looking up instruction AAD
Found instruction AAD
Looking up instruction RET
Found instruction RET
(NIL NIL)
CL-USER>

meta-meta-programming

Strictly for laughs, and partly for performance: a bit of meta-meta-programming.



;; make #{ .. } notation become a short hand for (values ...)
(defun |#{-reader| (stream char arg)
(declare (ignore char arg))
`(values ,@(read-delimited-list #\} stream t)))

(set-dispatch-macro-character #\# #\{ #'|#{-reader|)
(set-macro-character #\} (get-macro-character #\) nil))

(defmacro make-tuple-struct (&key type-name tuple-type tuple-default-value elements)
"Create a structure in the form needed for tuple / packing
unpacking. All fields should have the same type and default value."
`(defstruct ,type-name
,@(loop
for element in elements
collect (list element tuple-default-value :type tuple-type))))

;; test code
(make-tuple-struct :type-name vector2d :tuple-type single-float :tuple-default-value 0.0 :elements (x y))
(make-tuple-struct :type-name vector3d :tuple-type single-float :tuple-default-value 0.0 :elements (x y z))
(make-tuple-struct :type-name vector4d :tuple-type single-float :tuple-default-value 0.0 :elements (x y z w))
(make-tuple-struct :type-name quaternion :tuple-type single-float :tuple-default-value 0.0 :elements (x y z w))
(make-tuple-struct :type-name color :tuple-type single-float :tuple-default-value 0.0 :elements (r g b a))


(defmacro with-gensyms (syms &body body)
`(let ,(mapcar #'(lambda (s) `(,s (gensym)))
syms)
,@body))

(defmacro make-tuple-unpacker (&key type-name elements)
"Create an unpacker function such as (vector? vector4d) that takes an instance
of a struct and unpacks it to tuples (aka multiple values)"
(labels
((make-macro-name (type-name)
(intern (concatenate 'string
(symbol-name type-name)
"?")))
(make-element-names (elements)
(mapcar #'(lambda (x)
(find-symbol
(concatenate 'string
(symbol-name type-name) "-"
(symbol-name x))))
elements)))
`(defmacro ,(make-macro-name type-name) (packed-tuple)
(let ((packed-tuple-sym (gensym)))
`(let
((,packed-tuple-sym ,packed-tuple))
(values ,@(loop
for element-name in (quote ,(make-element-names elements))
collect (list element-name packed-tuple-sym))))))))




(make-tuple-unpacker :type-name vector2d :elements (x y))
(make-tuple-unpacker :type-name vector3d :elements (x y z))
(make-tuple-unpacker :type-name vector4d :elements (x y z w))
(make-tuple-unpacker :type-name quaternion :elements (x y z w))
(make-tuple-unpacker :type-name color :elements (r g b a))

;; to do - not entirely sure if this is wise/neeed
;; is anything evaluated more than once? I lost track
(defmacro make-with-tuple (&key type-name)
"Create a macro that can be used to bind members of the tuples struct to symbols
to symbols e-g (with-vector thing-vec (x y z w) &body forms)"
(labels
((make-unpacker-name (type-name)
(intern (concatenate 'string
(symbol-name type-name)
"?")))
(make-macro-name (type-name)
(intern (concatenate 'string
"WITH-"
(symbol-name type-name)))))
`(defmacro ,(make-macro-name type-name) (tuple element-syms &body forms)
`(multiple-value-bind
,(loop
for element-sym in element-syms
collect element-sym)
(,',(make-unpacker-name type-name) ,tuple)
,@forms))))

(make-with-tuple :type-name vector2d)
(make-with-tuple :type-name vector3d)
(make-with-tuple :type-name vector4d)
(make-with-tuple :type-name quarternion)
(make-with-tuple :type-name color)

(defmacro make-tuple-packer (&key type-name elements)
"Create a tuple-name! macro for packing multiple values into
a tuple struct. eg (vector! up #{ 0.0 1.0 0.0 })"
(labels
((make-packer-name (type-name)
(intern (concatenate 'string
(symbol-name type-name)
"!")))
(make-element-names (elements)
(mapcar #'(lambda (x)
(find-symbol
(concatenate 'string
(symbol-name type-name) "-"
(symbol-name x))))
elements)))
`(defmacro ,(make-packer-name type-name) (target-sym tuple-values)
(let* ((element-name-list ',(make-element-names elements))
(varlist (mapcar #'(lambda (x) (gensym (symbol-name x))) element-name-list)))
`(multiple-value-bind
,(mapcar #'(lambda (x) x) varlist)
,tuple-values
(progn ,@(mapcar #'(lambda (p v) `(setf (,p ,target-sym) ,v)) element-name-list varlist)))))))

(make-tuple-packer :type-name vector2d :elements (x y))
(make-tuple-packer :type-name vector3d :elements (x y z))
(make-tuple-packer :type-name vector4d :elements (x y z w))
(make-tuple-packer :type-name quaternion :elements (x y z w))
(make-tuple-packer :type-name color :elements (r g b a))

(defparameter *blue* (make-color :b 1.0))
(defparameter *transparent-blue* (make-color :b 1.0 :a 0.5))
(defparameter *red* (make-color :r 1.0))
(defparameter *yellow* (make-color :r 1.0 :g 1.0))
(with-color *yellow* (yr yg yb ya) (format t "Yellow ~A ~A ~A ~A " yr yg yb ya))

;; change yellow to white
(color! *yellow* #{ 1.0 1.0 1.0 0.0 })

(with-color *yellow* (yr yg yb ya) (format t "Yellow ~A ~A ~A ~A " yr yg yb ya))

;; confirm change
(color? *yellow*)

(defmacro make-tuple-type (tuple-name &key tuple-element-type tuple-default-value elements)
"Create a tuple type in one swoosh with all the support macros for it"
`(progn
(make-tuple-struct :type-name ,tuple-name
:tuple-type ,tuple-element-type
:tuple-default-value ,tuple-default-value
:elements ,elements )
(make-tuple-unpacker :type-name ,tuple-name :elements ,elements)
(make-with-tuple :type-name ,tuple-name)
(make-tuple-packer :type-name ,tuple-name :elements ,elements)))

(make-tuple-type pixel :tuple-element-type (unsigned-byte 8) :tuple-default-value 0 :elements (b r g a))



make-tuple-type is a macro that invokes a set of macros that invoke macros. I hope to be able to build on this to get together a decent 3d-game/spatial-math collection of lisp code. Now I have to think about how exactly I want transforms to work. I'm tempted to code them as scale-rotate-translate rather than a straight matrix.