├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.org ├── asd-generator-data.asd ├── benchmark ├── 43609fbb071c11f693ec0f026aaf456753d58d75.ccl.log ├── 43609fbb071c11f693ec0f026aaf456753d58d75.sbcl.log ├── 514576ed67a87450b4a1edb8ef921092c863ae51.ccl.log ├── 514576ed67a87450b4a1edb8ef921092c863ae51.sbcl.log ├── d26e222e796046931693686edd176a72bd62fa3d.ccl.log ├── d26e222e796046931693686edd176a72bd62fa3d.sbcl.log ├── run.ros └── run.sh ├── circle.yml ├── demo.cast ├── demo.lisp ├── example.lisp ├── legal ├── COPYING ├── COPYING.LESSER └── DCO1.1.txt ├── specialized-function.asd ├── specialized-function.test.asd ├── src ├── 0package.lisp ├── 1common.lisp └── 2find-lexical-variables.lisp ├── t └── package.lisp └── testscr.ros /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.fasl 3 | *.dx32fsl 4 | *.dx64fsl 5 | *.lx32fsl 6 | *.lx64fsl 7 | *.x86f 8 | *~ 9 | .#* 10 | *.backup 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: common-lisp 2 | sudo: false 3 | 4 | addons: 5 | apt: 6 | packages: 7 | - libc6-i386 8 | - clisp 9 | 10 | env: 11 | global: 12 | - PATH=~/.roswell/bin:$PATH 13 | - ROSWELL_INSTALL_DIR=$HOME/.roswell 14 | matrix: 15 | - LISP=sbcl-bin 16 | - LISP=sbcl-bin/2.0.11 17 | - LISP=sbcl-bin/1.5.9 18 | - LISP=ccl-bin 19 | - LISP=abcl 20 | - LISP=clisp 21 | - LISP=ecl 22 | - LISP=cmucl 23 | - LISP=alisp 24 | 25 | matrix: 26 | allow_failures: 27 | - env: LISP=clisp 28 | - env: LISP=abcl 29 | - env: LISP=ecl 30 | - env: LISP=cmucl 31 | - env: LISP=alisp 32 | 33 | install: 34 | - curl -L https://raw.githubusercontent.com/snmsts/roswell/release/scripts/install-for-ci.sh | sh 35 | 36 | cache: 37 | directories: 38 | - $HOME/.roswell 39 | - $HOME/.config/common-lisp 40 | 41 | script: 42 | - ./testscr.ros 43 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Developer's Certificate of Origin 2 | 3 | To handle the legal aspects of contribution, we ask each Pull Request submitter 4 | to sign the Developer's Certificate of Origin 1.1 (DCO) [1] that the Linux® 5 | Kernel community uses [2] to manage code contributions. 6 | 7 | [1] legal/DCO1.1.txt 8 | [2] https://elinux.org/Developer_Certificate_Of_Origin 9 | 10 | We simply ask that when submitting a patch for review, the developer must 11 | include a sign-off statement in the commit message. 12 | 13 | Here is an example Signed-off-by line, which indicates that the submitter 14 | accepts the DCO linked above: 15 | 16 | Signed-off-by: Your Name 17 | 18 | As of now, you need to add a sign-off message to every commit. To reduce the burden, 19 | we recommend squashing the commits in the PR as much as possible, or use the following: 20 | 21 | You can include this automatically when you commit a change to your local git 22 | repository using the following command: 23 | 24 | git commit -s 25 | 26 | Alternatively/in addition you can have a template for your commit text in a file 27 | like git-commit-template with the DCO above, and run `git config commit.template 28 | git-commit-template` once to have it as your default when running `git commit`. 29 | 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | legal/COPYING.LESSER -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please read the [guidelines for contribution](CONTRIBUTING.md) about signing off 2 | Developer's Certificate of Origin. 3 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | 2 | * Specialized-Function [[https://travis-ci.org/numcl/specialized-function][https://travis-ci.org/numcl/specialized-function.svg?branch=master]] 3 | 4 | This library is part of NUMCL. It provides a macro `SPECIALIZED` 5 | that performs a Julia-like dispatch on the arguments, lazily compiling a 6 | type-specific version of the function from the same code. 7 | *The main target of this macro is the speed.* 8 | 9 | It supports SBCL, CCL, and LispWorks (untested), and provides a limited support to other lisps. 10 | On other lisps, the code inside =specialized= is not able to read 11 | the variables that are not specified to be the dispatched arguments. 12 | This is because it relies on the implementation-specific interface to the 13 | environment object to collect the list of all lexical variables. 14 | 15 | [[https://asciinema.org/a/RW5a3mKqAYvOTvBp3i1x5yqoK][https://asciinema.org/a/RW5a3mKqAYvOTvBp3i1x5yqoK.svg]] 16 | 17 | *NEWS* (2019/09/28): lexical variables NOT specialized by the user are type-annotated inside specialized-function based on the information available from cltl2. 18 | 19 | ** Why? 20 | 21 | Suppose computing a vector dot: 22 | 23 | #+begin_src lisp 24 | (defun dot-original (a b c) 25 | (declare (optimize (speed 3) (safety 0) (debug 0))) 26 | (loop 27 | for ai across a 28 | for bi across b 29 | do (incf c (* ai bi))) 30 | c) 31 | #+end_src 32 | 33 | This function is untyped and thus slow due to the calls to =generic-*= and 34 | =generic-+=. While we could write a macro that automatically duplicates this 35 | code with some additional type declaration, notice that the number of types that 36 | this function accepts is large --- =a= could be a simple or non-simple array of 37 | 4 float types, 4 float complex types, and the integer subtypes for the 38 | specialized arrays, such as =(unsigned-byte 4)=. On SBCL x64, there are at 39 | least 56 variants -- 2*(4+4+12+7+1) -- and since there are 2 arguments, it 40 | should compile more than 2500 specialized variants. This wastes the compilation 41 | time because most combinations are not actually used in the user code. 42 | 43 | # 4 floats 44 | # 4 complex floats 45 | # unsigned-byte 1 2 3 4 7 8 15 16 31 32 63 64 -- 12 46 | # signed-byte 1 2 4 8 16 32 64 -- 7 47 | # fixnum 48 | 49 | Julia language has chosen a strategy that lazily compiles the typed variant of the function 50 | when the function was invoked with a new combination of types. 51 | Specialized-function provides this same functionality in Common Lisp --- 52 | lazy compilation of the type-specific variant of the same function. 53 | 54 | Note that this cannot be achieved by CLOS and the behavior is 55 | *orthogonal/complimentary* to the CLOS dispatch. One critical difference is 56 | that CLOS generally assumes that the *different code/algorithm* 57 | is used for implementing each method, 58 | while specialized-function assumes that 59 | *all specialized functions share the same code*. 60 | 61 | Another reason it cannot be achieved by CLOS is that CLOS in general cannot specify the 62 | array element types, which is critical in the high-performance code (while it is 63 | subject to a debate --- MOP can extend it to support array specifiers). 64 | 65 | Since they are orthogonal, you could also *combine CLOS and specialized-function* as follows: 66 | 67 | #+begin_src lisp 68 | 69 | (defmethod print-all ((obj array) (s stream)) 70 | (specialized (obj) () 71 | (loop for c across obj do (write-char c s)))) 72 | 73 | (defmethod print-all ((obj list) (s stream)) 74 | (loop for elem in obj do (write elem s))) 75 | #+end_src 76 | 77 | Note that the first =print-all= for an =array= could dispatch between the 78 | =base-string= (with =base-char= elements) and =string= (with =character= 79 | elements). 80 | 81 | 82 | 83 | ** How? 84 | 85 | We compile each dispatched branch lazily and store them in a tree of vectors (each node is called a /table/). 86 | The number of entries in each table depends on the implementation's type-upgrading rule 87 | and the number of supported specialized array element types. 88 | There is a =widetag= function containing a nested =etypecase= rule 89 | which takes an object, investigate its type and returns the corresponding index in the table. 90 | 91 | If the function is not available at the leaf node, it compiles 92 | a new version of the function. The overhead of performing a dispatch is 93 | : [simple-array access]x[number of arguments]+[single function call]. 94 | 95 | CCL does not obtain much speedup on the numerical code as it cannot infer the 96 | return type of =(aref A ...)= from the element-type declaration of =A=. 97 | 98 | On unsupported implementations, =SPECIALIZED= is +equivalent to =PROGN=.+ 99 | not able to pass values of lexical variables to the body inside =SPECIALIZED=. 100 | 101 | ** Caveats 102 | 103 | For array types, it dispatches based on the (upgraded) element 104 | type and the simpleness of the runtime array object. 105 | It *does not* dispatch based on the *rank* and the *dimensions*. 106 | Also, once each function is called/compiled for the arrays of a certain rank, 107 | *this rank information is fixed*. This is based on a heuristic that *the same code/algorithm 108 | does not work for an array of the different ranks*. For example, it is unreasonable to 109 | assume that a code for matrix multiplication can process a 1D vector or a 3D tensor. 110 | 111 | For integer types, all values that can be expressed within fixnum 112 | will dispatch to the fixnum-specialized branch. That is, entering a 113 | =(specialized (n) ...)= with =n= being =12= does not dispatch to =(unsinged-byte 4)= 114 | but simply to =fixnum=. 115 | 116 | =specialized= dispatches to the branches for =standard-object= and 117 | =structure-object=, but does not provide any dispatch for their subtypes. 118 | This should be handled by CLOS mainly because, as a heuristic, different 119 | classes would require the different code/algorithm. 120 | However, for specific purposes, we expose a function =register-base-type= 121 | which allows you to add a specific type to the tables. 122 | 123 | ** Author, License, Copyright 124 | 125 | Masataro Asai (guicho2.71828@gmail.com) 126 | 127 | Licensed under LGPL v3. 128 | 129 | Copyright (c) 2019 IBM Corporation 130 | -------------------------------------------------------------------------------- /asd-generator-data.asd: -------------------------------------------------------------------------------- 1 | #| 2 | This file is a part of specialized-function project. 3 | 4 | This is a [asd-generator](https://github.com/phoe/asd-generator/) config file. 5 | Run below for auto-regenerating the asd file: 6 | 7 | $ ros install phoe/asd-generator 8 | $ update-asdf 9 | 10 | Copyright (c) 2019 Masataro Asai (guicho2.71828@gmail.com) 11 | |# 12 | 13 | #| 14 | Provides a Julia-like function that automatically compiles a type-specific version of the function from the same code 15 | 16 | Author: Masataro Asai (guicho2.71828@gmail.com) 17 | |# 18 | 19 | 20 | ((:dir :src 21 | (:package) 22 | (:rest))) 23 | 24 | -------------------------------------------------------------------------------- /benchmark/43609fbb071c11f693ec0f026aaf456753d58d75.ccl.log: -------------------------------------------------------------------------------- 1 | 2 | x86_64 3 | Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz 4 | masataro-ThinkPad-T460 5 | Linux 6 | 4.4.0-150-generic 7 | Clozure Common Lisp 8 | Version 1.11.5/v1.11.5 (LinuxX8664) 9 | ;Compiler warnings : 10 | ; Clause (EXTENDED-CHAR 57) ignored in ETYPECASE form - shadowed by (BASE-CHAR 56) . 11 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 12 | took 697,991 microseconds (0.697991 seconds) to run. 13 | During that period, and with 4 available CPU cores, 14 | 696,000 microseconds (0.696000 seconds) were spent in user mode 15 | 0 microseconds (0.000000 seconds) were spent in system mode 16 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 17 | took 716,315 microseconds (0.716315 seconds) to run. 18 | During that period, and with 4 available CPU cores, 19 | 708,000 microseconds (0.708000 seconds) were spent in user mode 20 | 0 microseconds (0.000000 seconds) were spent in system mode 21 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 22 | took 677,139 microseconds (0.677139 seconds) to run. 23 | During that period, and with 4 available CPU cores, 24 | 676,000 microseconds (0.676000 seconds) were spent in user mode 25 | 0 microseconds (0.000000 seconds) were spent in system mode 26 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 27 | took 697,618 microseconds (0.697618 seconds) to run. 28 | During that period, and with 4 available CPU cores, 29 | 692,000 microseconds (0.692000 seconds) were spent in user mode 30 | 0 microseconds (0.000000 seconds) were spent in system mode 31 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 32 | took 657,235 microseconds (0.657235 seconds) to run. 33 | During that period, and with 4 available CPU cores, 34 | 652,000 microseconds (0.652000 seconds) were spent in user mode 35 | 0 microseconds (0.000000 seconds) were spent in system mode 36 | (recover-fn-from-rip) ; [7] 37 | (cmpl ($ 8) (% nargs)) ; [14] 38 | (jne L45) ; [17] 39 | (pushq (% rbp)) ; [19] 40 | (movq (% rsp) (% rbp)) ; [20] 41 | (pushq (% arg_z)) ; [23] 42 | (movl ($ 8) (% nargs)) ; [24] 43 | (movq (@ '# (% fn)) (% temp0)) ; [29] 44 | (leaveq) ; [36] 45 | (movq (% fn) (% temp1)) ; [37] 46 | (movq (% temp0) (% fn)) ; [40] 47 | (jmpq (% fn)) ; [43] 48 | L45 49 | (uuo-error-wrong-number-of-args) ; [52] 50 | -------------------------------------------------------------------------------- /benchmark/43609fbb071c11f693ec0f026aaf456753d58d75.sbcl.log: -------------------------------------------------------------------------------- 1 | 2 | X86-64 3 | Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz 4 | masataro-ThinkPad-T460 5 | Linux 6 | 4.4.0-150-generic 7 | SBCL 8 | 1.5.2 9 | Evaluation took: 10 | 0.459 seconds of real time 11 | 0.460000 seconds of total run time (0.460000 user, 0.000000 system) 12 | 100.22% CPU 13 | 1,145,892,420 processor cycles 14 | 0 bytes consed 15 | 16 | Evaluation took: 17 | 0.441 seconds of real time 18 | 0.436000 seconds of total run time (0.436000 user, 0.000000 system) 19 | 98.87% CPU 20 | 1,101,515,894 processor cycles 21 | 0 bytes consed 22 | 23 | Evaluation took: 24 | 0.438 seconds of real time 25 | 0.440000 seconds of total run time (0.440000 user, 0.000000 system) 26 | 100.46% CPU 27 | 1,092,570,314 processor cycles 28 | 0 bytes consed 29 | 30 | Evaluation took: 31 | 0.430 seconds of real time 32 | 0.428000 seconds of total run time (0.428000 user, 0.000000 system) 33 | 99.53% CPU 34 | 1,073,659,600 processor cycles 35 | 0 bytes consed 36 | 37 | Evaluation took: 38 | 0.434 seconds of real time 39 | 0.436000 seconds of total run time (0.436000 user, 0.000000 system) 40 | 100.46% CPU 41 | 1,083,020,786 processor cycles 42 | 0 bytes consed 43 | 44 | ; disassembly for SPECIALIZED-FUNCTION::WIDETAG 45 | ; Size: 1286 bytes. Origin: #x52DABB93 (segment 1 of 2) 46 | ; BB93: EB03 JMP L1 ; no-arg-parsing entry point 47 | ; BB95: L0: 8F4508 POP QWORD PTR [RBP+8] 48 | ; Origin #x52DABB98 (segment 2 of 2) 49 | ; BB98: L1: 418D40F1 LEA EAX, [R8-15] ; no-arg-parsing entry point 50 | ; BB9C: A80F TEST AL, 15 51 | ; BB9E: 0F85E6010000 JNE L27 52 | ; BBA4: 418B40F1 MOV EAX, [R8-15] 53 | ; BBA8: 2C85 SUB AL, -123 54 | ; BBAA: 3C60 CMP AL, 96 55 | ; BBAC: 0F87D8010000 JNBE L27 56 | ; BBB2: 418078F1D5 CMP BYTE PTR [R8-15], -43 57 | ; BBB7: 0F84C6010000 JEQ L26 58 | ; BBBD: 418078F185 CMP BYTE PTR [R8-15], -123 59 | ; BBC2: 0F84B1010000 JEQ L25 60 | ; BBC8: 418078F189 CMP BYTE PTR [R8-15], -119 61 | ; BBCD: 0F849C010000 JEQ L24 62 | ; BBD3: 418078F18D CMP BYTE PTR [R8-15], -115 63 | ; BBD8: 0F8487010000 JEQ L23 64 | ; BBDE: 418078F191 CMP BYTE PTR [R8-15], -111 65 | ; BBE3: 0F8472010000 JEQ L22 66 | ; BBE9: 418078F195 CMP BYTE PTR [R8-15], -107 67 | ; BBEE: 0F845D010000 JEQ L21 68 | ; BBF4: 418078F199 CMP BYTE PTR [R8-15], -103 69 | ; BBF9: 0F8448010000 JEQ L20 70 | ; BBFF: 418078F19D CMP BYTE PTR [R8-15], -99 71 | ; BC04: 0F8433010000 JEQ L19 72 | ; BC0A: 418078F1A1 CMP BYTE PTR [R8-15], -95 73 | ; BC0F: 0F841E010000 JEQ L18 74 | ; BC15: 418078F1A5 CMP BYTE PTR [R8-15], -91 75 | ; BC1A: 0F8409010000 JEQ L17 76 | ; BC20: 418078F1A9 CMP BYTE PTR [R8-15], -87 77 | ; BC25: 0F84F4000000 JEQ L16 78 | ; BC2B: 418078F1B1 CMP BYTE PTR [R8-15], -79 79 | ; BC30: 0F84E2000000 JEQ L15 80 | ; BC36: 418078F1B5 CMP BYTE PTR [R8-15], -75 81 | ; BC3B: 0F84D0000000 JEQ L14 82 | ; BC41: 418078F1B9 CMP BYTE PTR [R8-15], -71 83 | ; BC46: 0F84BE000000 JEQ L13 84 | ; BC4C: 418078F1BD CMP BYTE PTR [R8-15], -67 85 | ; BC51: 0F84AC000000 JEQ L12 86 | ; BC57: 418078F1AD CMP BYTE PTR [R8-15], -83 87 | ; BC5C: 0F849A000000 JEQ L11 88 | ; BC62: 418078F1C1 CMP BYTE PTR [R8-15], -63 89 | ; BC67: 0F8488000000 JEQ L10 90 | ; BC6D: 418078F1C5 CMP BYTE PTR [R8-15], -59 91 | ; BC72: 747A JEQ L9 92 | ; BC74: 418078F1C9 CMP BYTE PTR [R8-15], -55 93 | ; BC79: 746C JEQ L8 94 | ; BC7B: 418078F1CD CMP BYTE PTR [R8-15], -51 95 | ; BC80: 745E JEQ L7 96 | ; BC82: 418078F1D1 CMP BYTE PTR [R8-15], -47 97 | ; BC87: 7450 JEQ L6 98 | ; BC89: 418078F1E1 CMP BYTE PTR [R8-15], -31 99 | ; BC8E: 7442 JEQ L5 100 | ; BC90: 418078F1E5 CMP BYTE PTR [R8-15], -27 101 | ; BC95: 7434 JEQ L4 102 | ; BC97: 418078F1D9 CMP BYTE PTR [R8-15], -39 103 | ; BC9C: 750B JNE L3 104 | ; BC9E: BA2E000000 MOV EDX, 46 105 | ; BCA3: L2: 488BE5 MOV RSP, RBP 106 | ; BCA6: F8 CLC 107 | ; BCA7: 5D POP RBP 108 | ; BCA8: C3 RET 109 | ; BCA9: L3: 4883EC10 SUB RSP, 16 110 | ; BCAD: 498BD0 MOV RDX, R8 111 | ; BCB0: 488B3D49FEFFFF MOV RDI, [RIP-439] ; '((SIMPLE-ARRAY 112 | ; BIT 1) ..) 113 | ; BCB7: B904000000 MOV ECX, 4 114 | ; BCBC: 48892C24 MOV [RSP], RBP 115 | ; BCC0: 488BEC MOV RBP, RSP 116 | ; BCC3: B818FFAD52 MOV EAX, #x52ADFF18 ; # 117 | ; BCC8: FFD0 CALL RAX 118 | ; BCCA: 90 NOP 119 | ; BCCB: L4: BA2C000000 MOV EDX, 44 120 | ; BCD0: EBD1 JMP L2 121 | ; BCD2: L5: BA2A000000 MOV EDX, 42 122 | ; BCD7: EBCA JMP L2 123 | ; BCD9: L6: BA28000000 MOV EDX, 40 124 | ; BCDE: EBC3 JMP L2 125 | ; BCE0: L7: BA26000000 MOV EDX, 38 126 | ; BCE5: EBBC JMP L2 127 | ; BCE7: L8: BA24000000 MOV EDX, 36 128 | ; BCEC: EBB5 JMP L2 129 | ; BCEE: L9: BA22000000 MOV EDX, 34 130 | ; BCF3: EBAE JMP L2 131 | ; BCF5: L10: BA20000000 MOV EDX, 32 132 | ; BCFA: EBA7 JMP L2 133 | ; BCFC: L11: BA1E000000 MOV EDX, 30 134 | ; BD01: EBA0 JMP L2 135 | ; BD03: L12: BA1C000000 MOV EDX, 28 136 | ; BD08: EB99 JMP L2 137 | ; BD0A: L13: BA1A000000 MOV EDX, 26 138 | ; BD0F: EB92 JMP L2 139 | ; BD11: L14: BA18000000 MOV EDX, 24 140 | ; BD16: EB8B JMP L2 141 | ; BD18: L15: BA16000000 MOV EDX, 22 142 | ; BD1D: EB84 JMP L2 143 | ; BD1F: L16: BA14000000 MOV EDX, 20 144 | ; BD24: E97AFFFFFF JMP L2 145 | ; BD29: L17: BA12000000 MOV EDX, 18 146 | ; BD2E: E970FFFFFF JMP L2 147 | ; BD33: L18: BA10000000 MOV EDX, 16 148 | ; BD38: E966FFFFFF JMP L2 149 | ; BD3D: L19: BA0E000000 MOV EDX, 14 150 | ; BD42: E95CFFFFFF JMP L2 151 | ; BD47: L20: BA0C000000 MOV EDX, 12 152 | ; BD4C: E952FFFFFF JMP L2 153 | ; BD51: L21: BA0A000000 MOV EDX, 10 154 | ; BD56: E948FFFFFF JMP L2 155 | ; BD5B: L22: BA08000000 MOV EDX, #x8 ; is_lisp_thread 156 | ; BD60: E93EFFFFFF JMP L2 157 | ; BD65: L23: BA06000000 MOV EDX, 6 158 | ; BD6A: E934FFFFFF JMP L2 159 | ; BD6F: L24: BA04000000 MOV EDX, 4 160 | ; BD74: E92AFFFFFF JMP L2 161 | ; BD79: L25: BA02000000 MOV EDX, 2 162 | ; BD7E: E920FFFFFF JMP L2 163 | ; BD83: L26: 31D2 XOR EDX, EDX 164 | ; BD85: E919FFFFFF JMP L2 165 | ; BD8A: L27: 418D40F1 LEA EAX, [R8-15] 166 | ; BD8E: A80F TEST AL, 15 167 | ; BD90: 750E JNE L28 168 | ; BD92: 418B40F1 MOV EAX, [R8-15] 169 | ; BD96: 2C81 SUB AL, -127 170 | ; BD98: 3C64 CMP AL, 100 171 | ; BD9A: 0F86A3020000 JBE L60 172 | ; BDA0: L28: 418D40F1 LEA EAX, [R8-15] 173 | ; BDA4: A80F TEST AL, 15 174 | ; BDA6: 750B JNE L29 175 | ; BDA8: 418078F181 CMP BYTE PTR [R8-15], -127 176 | ; BDAD: 0F833C020000 JNB L58 177 | ; BDB3: L29: 41F6C001 TEST R8B, 1 178 | ; BDB7: 0F8428020000 JEQ L57 179 | ; BDBD: 418D40F1 LEA EAX, [R8-15] 180 | ; BDC1: A801 TEST AL, 1 181 | ; BDC3: 0F8501010000 JNE L41 182 | ; BDC9: 3C0A CMP AL, 10 183 | ; BDCB: 0F84F9000000 JEQ L41 184 | ; BDD1: A80F TEST AL, 15 185 | ; BDD3: 750B JNE L30 186 | ; BDD5: 418078F129 CMP BYTE PTR [R8-15], 41 187 | ; BDDA: 0F86EA000000 JBE L41 188 | ; BDE0: L30: 418D40B7 LEA EAX, [R8-73] 189 | ; BDE4: A9FF80FFFF TEST EAX, -32513 190 | ; BDE9: 0F84D1000000 JEQ L40 191 | ; BDEF: 4180F849 CMP R8B, 73 192 | ; BDF3: 750A JNE L31 193 | ; BDF5: BAA6000000 MOV EDX, 166 194 | ; BDFA: E9A4FEFFFF JMP L2 195 | ; BDFF: L31: 418D40F5 LEA EAX, [R8-11] 196 | ; BE03: A80F TEST AL, 15 197 | ; BE05: 0F84AB000000 JEQ L39 198 | ; BE0B: 4981F817001050 CMP R8, #x50100017 ; NIL 199 | ; BE12: 740C JEQ L32 200 | ; BE14: 418D40F9 LEA EAX, [R8-7] 201 | ; BE18: A80F TEST AL, 15 202 | ; BE1A: 0F848C000000 JEQ L38 203 | ; BE20: L32: 4981F817001050 CMP R8, #x50100017 ; NIL 204 | ; BE27: 7479 JEQ L37 205 | ; BE29: 418D40F1 LEA EAX, [R8-15] 206 | ; BE2D: A80F TEST AL, 15 207 | ; BE2F: 7507 JNE L33 208 | ; BE31: 418078F145 CMP BYTE PTR [R8-15], 69 209 | ; BE36: 746A JEQ L37 210 | ; BE38: L33: 418D40FD LEA EAX, [R8-3] 211 | ; BE3C: A80F TEST AL, 15 212 | ; BE3E: 751A JNE L35 213 | ; BE40: 418B4001 MOV EAX, [R8+1] 214 | ; BE44: 83780902 CMP DWORD PTR [RAX+9], 2 215 | ; BE48: 7E08 JLE L34 216 | ; BE4A: 488B4025 MOV RAX, [RAX+37] 217 | ; BE4E: 488B4009 MOV RAX, [RAX+9] 218 | ; BE52: L34: 483D83103050 CMP RAX, #x50301083 ; # 219 | ; BE58: 743C JEQ L36 220 | ; BE5A: L35: 4883EC10 SUB RSP, 16 221 | ; BE5E: 488B15B3FCFFFF MOV RDX, [RIP-845] ; # 222 | ; BE65: 498BF8 MOV RDI, R8 223 | ; BE68: B904000000 MOV ECX, 4 224 | ; BE6D: 48892C24 MOV [RSP], RBP 225 | ; BE71: 488BEC MOV RBP, RSP 226 | ; BE74: B8F806AE52 MOV EAX, #x52AE06F8 ; # 227 | ; BE79: FFD0 CALL RAX 228 | ; BE7B: 4881FA17001050 CMP RDX, #x50100017 ; NIL 229 | ; BE82: BAB0000000 MOV EDX, 176 230 | ; BE87: 41BBB2000000 MOV R11D, 178 231 | ; BE8D: 490F44D3 CMOVEQ RDX, R11 232 | ; BE91: E90DFEFFFF JMP L2 233 | ; BE96: L36: BAAE000000 MOV EDX, 174 234 | ; BE9B: E903FEFFFF JMP L2 235 | ; BEA0: EBB0 JMP L34 236 | ; BEA2: L37: BAAC000000 MOV EDX, 172 237 | ; BEA7: E9F7FDFFFF JMP L2 238 | ; BEAC: L38: BAAA000000 MOV EDX, 170 239 | ; BEB1: E9EDFDFFFF JMP L2 240 | ; BEB6: L39: BAA8000000 MOV EDX, 168 241 | ; BEBB: E9E3FDFFFF JMP L2 242 | ; BEC0: L40: BAA4000000 MOV EDX, 164 243 | ; BEC5: E9D9FDFFFF JMP L2 244 | ; BECA: L41: 418D40F1 LEA EAX, [R8-15] 245 | ; BECE: A801 TEST AL, 1 246 | ; BED0: 7567 JNE L46 247 | ; BED2: 3C0A CMP AL, 10 248 | ; BED4: 7463 JEQ L46 249 | ; BED6: A80F TEST AL, 15 250 | ; BED8: 7507 JNE L42 251 | ; BEDA: 418078F11D CMP BYTE PTR [R8-15], 29 252 | ; BEDF: 7658 JBE L46 253 | ; BEE1: L42: 418B40F1 MOV EAX, [R8-15] 254 | ; BEE5: 2C21 SUB AL, 33 255 | ; BEE7: 3C08 CMP AL, 8 256 | ; BEE9: 772C JNBE L45 257 | ; BEEB: 418078F125 CMP BYTE PTR [R8-15], 37 258 | ; BEF0: 741B JEQ L44 259 | ; BEF2: 418078F129 CMP BYTE PTR [R8-15], 41 260 | ; BEF7: 740A JEQ L43 261 | ; BEF9: BAA2000000 MOV EDX, 162 262 | ; BEFE: E9A0FDFFFF JMP L2 263 | ; BF03: L43: BAA0000000 MOV EDX, 160 264 | ; BF08: E996FDFFFF JMP L2 265 | ; BF0D: L44: BA9E000000 MOV EDX, 158 266 | ; BF12: E98CFDFFFF JMP L2 267 | ; BF17: L45: 4883EC10 SUB RSP, 16 268 | ; BF1B: 498BD0 MOV RDX, R8 269 | ; BF1E: 488B3D03FCFFFF MOV RDI, [RIP-1021] ; '(REAL COMPLEX) 270 | ; BF25: B904000000 MOV ECX, 4 271 | ; BF2A: 48892C24 MOV [RSP], RBP 272 | ; BF2E: 488BEC MOV RBP, RSP 273 | ; BF31: B818FFAD52 MOV EAX, #x52ADFF18 ; # 274 | ; BF36: FFD0 CALL RAX 275 | ; BF38: 90 NOP 276 | ; BF39: L46: 418D40F1 LEA EAX, [R8-15] 277 | ; BF3D: A801 TEST AL, 1 278 | ; BF3F: 7525 JNE L49 279 | ; BF41: A80F TEST AL, 15 280 | ; BF43: 7507 JNE L47 281 | ; BF45: 418078F115 CMP BYTE PTR [R8-15], 21 282 | ; BF4A: 761A JBE L49 283 | ; BF4C: L47: 4180F819 CMP R8B, 25 284 | ; BF50: 740A JEQ L48 285 | ; BF52: BA9C000000 MOV EDX, 156 286 | ; BF57: E947FDFFFF JMP L2 287 | ; BF5C: L48: BA9A000000 MOV EDX, 154 288 | ; BF61: E93DFDFFFF JMP L2 289 | ; BF66: L49: 418D40F1 LEA EAX, [R8-15] 290 | ; BF6A: A801 TEST AL, 1 291 | ; BF6C: 7511 JNE L50 292 | ; BF6E: 418078F111 CMP BYTE PTR [R8-15], 17 293 | ; BF73: 740A JEQ L50 294 | ; BF75: BA98000000 MOV EDX, 152 295 | ; BF7A: E924FDFFFF JMP L2 296 | ; BF7F: L50: 498BC0 MOV RAX, R8 297 | ; BF82: A801 TEST AL, 1 298 | ; BF84: 7426 JEQ L52 299 | ; BF86: 240F AND AL, 15 300 | ; BF88: 3C0F CMP AL, 15 301 | ; BF8A: 7525 JNE L53 302 | ; BF8C: 498B40F1 MOV RAX, [R8-15] 303 | ; BF90: 483D11010000 CMP RAX, 273 304 | ; BF96: 7410 JEQ L51 305 | ; BF98: 482D11020000 SUB RAX, 529 306 | ; BF9E: 7511 JNE L53 307 | ; BFA0: 49394001 CMP [R8+1], RAX 308 | ; BFA4: 7435 JEQ L56 309 | ; BFA6: EB09 JMP L53 310 | ; BFA8: L51: 498B40F9 MOV RAX, [R8-7] 311 | ; BFAC: L52: 4885C0 TEST RAX, RAX 312 | ; BFAF: 792A JNS L56 313 | ; BFB1: L53: 418D40F1 LEA EAX, [R8-15] 314 | ; BFB5: A801 TEST AL, 1 315 | ; BFB7: 7518 JNE L55 316 | ; BFB9: A80F TEST AL, 15 317 | ; BFBB: 750A JNE L54 318 | ; BFBD: 498178F111010000 CMP QWORD PTR [R8-15], 273 319 | ; BFC5: 740A JEQ L55 320 | ; BFC7: L54: BA96000000 MOV EDX, 150 321 | ; BFCC: E9D2FCFFFF JMP L2 322 | ; BFD1: L55: BA94000000 MOV EDX, 148 323 | ; BFD6: E9C8FCFFFF JMP L2 324 | ; BFDB: L56: BA92000000 MOV EDX, 146 325 | ; BFE0: E9BEFCFFFF JMP L2 326 | ; BFE5: L57: BA90000000 MOV EDX, 144 327 | ; BFEA: E9B4FCFFFF JMP L2 328 | ; BFEF: L58: 4883EC10 SUB RSP, 16 329 | ; BFF3: 498BD0 MOV RDX, R8 330 | ; BFF6: 31FF XOR EDI, EDI 331 | ; BFF8: BE17001050 MOV ESI, #x50100017 ; NIL 332 | ; BFFD: B906000000 MOV ECX, 6 333 | ; C002: 48892C24 MOV [RSP], RBP 334 | ; C006: 488BEC MOV RBP, RSP 335 | ; C009: B8F8E7AD52 MOV EAX, #x52ADE7F8 ; # 336 | ; C00E: FFD0 CALL RAX 337 | ; C010: 488BE3 MOV RSP, RBX 338 | ; C013: 4C8BC2 MOV R8, RDX 339 | ; C016: 4C8BCD MOV R9, RBP 340 | ; C019: 488D4424F0 LEA RAX, [RSP-16] 341 | ; C01E: 4883EC10 SUB RSP, 16 342 | ; C022: 4C8908 MOV [RAX], R9 343 | ; C025: 488BE8 MOV RBP, RAX 344 | ; C028: E868FBFFFF CALL L0 345 | ; C02D: 4883FA2E CMP RDX, 46 346 | ; C031: 7709 JNBE L59 347 | ; C033: 4883C230 ADD RDX, 48 348 | ; C037: E967FCFFFF JMP L2 349 | ; C03C: L59: 48D1FA SAR RDX, 1 350 | ; C03F: CC1B BREAK 27 ; OBJECT-NOT-TYPE-ERROR 351 | ; C041: 0A BYTE #X0A ; RDX 352 | ; C042: 2F BYTE #X2F ; '(MOD 24) 353 | ; C043: L60: 4883EC10 SUB RSP, 16 354 | ; C047: 498BD0 MOV RDX, R8 355 | ; C04A: 31FF XOR EDI, EDI 356 | ; C04C: BE17001050 MOV ESI, #x50100017 ; NIL 357 | ; C051: B906000000 MOV ECX, 6 358 | ; C056: 48892C24 MOV [RSP], RBP 359 | ; C05A: 488BEC MOV RBP, RSP 360 | ; C05D: B8F8E7AD52 MOV EAX, #x52ADE7F8 ; # 361 | ; C062: FFD0 CALL RAX 362 | ; C064: 488BE3 MOV RSP, RBX 363 | ; C067: 4C8BC2 MOV R8, RDX 364 | ; C06A: 4C8BCD MOV R9, RBP 365 | ; C06D: 488D4424F0 LEA RAX, [RSP-16] 366 | ; C072: 4883EC10 SUB RSP, 16 367 | ; C076: 4C8908 MOV [RAX], R9 368 | ; C079: 488BE8 MOV RBP, RAX 369 | ; C07C: E814FBFFFF CALL L0 370 | ; C081: 4883FA2E CMP RDX, 46 371 | ; C085: 7709 JNBE L61 372 | ; C087: 4883C230 ADD RDX, 48 373 | ; C08B: E913FCFFFF JMP L2 374 | ; C090: L61: 48D1FA SAR RDX, 1 375 | ; C093: CC1B BREAK 27 ; OBJECT-NOT-TYPE-ERROR 376 | ; C095: 0A BYTE #X0A ; RDX 377 | ; C096: 33 BYTE #X33 ; '(MOD 24) 378 | ; C097: CC0F BREAK 15 ; Invalid argument count trap 379 | -------------------------------------------------------------------------------- /benchmark/514576ed67a87450b4a1edb8ef921092c863ae51.ccl.log: -------------------------------------------------------------------------------- 1 | 2 | x86_64 3 | Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz 4 | masataro-ThinkPad-T460 5 | Linux 6 | 4.4.0-150-generic 7 | Clozure Common Lisp 8 | Version 1.11.5/v1.11.5 (LinuxX8664) 9 | ;Compiler warnings : 10 | ; Clause (EXTENDED-CHAR 57) ignored in ETYPECASE form - shadowed by (BASE-CHAR 56) . 11 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 12 | took 705,693 microseconds (0.705693 seconds) to run. 13 | During that period, and with 4 available CPU cores, 14 | 692,000 microseconds (0.692000 seconds) were spent in user mode 15 | 0 microseconds (0.000000 seconds) were spent in system mode 16 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 17 | took 720,703 microseconds (0.720703 seconds) to run. 18 | During that period, and with 4 available CPU cores, 19 | 708,000 microseconds (0.708000 seconds) were spent in user mode 20 | 0 microseconds (0.000000 seconds) were spent in system mode 21 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 22 | took 704,637 microseconds (0.704637 seconds) to run. 23 | During that period, and with 4 available CPU cores, 24 | 688,000 microseconds (0.688000 seconds) were spent in user mode 25 | 0 microseconds (0.000000 seconds) were spent in system mode 26 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 27 | took 718,694 microseconds (0.718694 seconds) to run. 28 | During that period, and with 4 available CPU cores, 29 | 700,000 microseconds (0.700000 seconds) were spent in user mode 30 | 4,000 microseconds (0.004000 seconds) were spent in system mode 31 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 32 | took 800,706 microseconds (0.800706 seconds) to run. 33 | During that period, and with 4 available CPU cores, 34 | 792,000 microseconds (0.792000 seconds) were spent in user mode 35 | 4,000 microseconds (0.004000 seconds) were spent in system mode 36 | (recover-fn-from-rip) ; [7] 37 | (cmpl ($ 8) (% nargs)) ; [14] 38 | (jne L2933) ; [17] 39 | (pushq (% rbp)) ; [23] 40 | (movq (% rsp) (% rbp)) ; [24] 41 | (pushq (% save0)) ; [27] 42 | (pushq (% save1)) ; [29] 43 | (pushq (% save2)) ; [31] 44 | (movq (@ 'CCL::ARRAY-%%TYPEP (% fn)) (% save1)) ; [33] 45 | (movq (% arg_z) (% save0)) ; [40] 46 | (movq (% save0) (% arg_y)) ; [43] 47 | (movq (@ '# (% fn)) (% arg_z)) ; [46] 48 | (movl ($ 16) (% nargs)) ; [53] 49 | (movq (% save1) (% temp0)) ; [58] 50 | (lisp-call (@ 10 (% temp0))) ; [65] 51 | (recover-fn-from-rip) ; [68] 52 | (cmpb ($ 11) (% arg_z.b)) ; [75] 53 | (je L638) ; [79] 54 | (movq (% save0) (% arg_z)) ; [85] 55 | (movl ($ 8) (% nargs)) ; [88] 56 | (movq (@ 'SIMPLE-BIT-VECTOR-P (% fn)) (% temp0)) ; [93] 57 | (lisp-call (@ 10 (% temp0))) ; [105] 58 | (recover-fn-from-rip) ; [108] 59 | (cmpb ($ 11) (% arg_z.b)) ; [115] 60 | (je L124) ; [119] 61 | (xorl (% arg_z.l) (% arg_z.l)) ; [121] 62 | L116 63 | (popq (% save2)) ; [123] 64 | (popq (% save1)) ; [125] 65 | (popq (% save0)) ; [127] 66 | (leaveq) ; [129] 67 | (retq) ; [130] 68 | L124 69 | (movl (% save0.l) (% imm0.l)) ; [131] 70 | (andl ($ 7) (% imm0.l)) ; [134] 71 | (cmpl ($ 5) (% imm0.l)) ; [137] 72 | (jne L140) ; [140] 73 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [142] 74 | L140 75 | (cmpb ($ #xE7) (% imm0.b)) ; [147] 76 | (jne L152) ; [150] 77 | (movl ($ 8) (% arg_z.l)) ; [152] 78 | (jmp L116) ; [157] 79 | L152 80 | (movl (% save0.l) (% imm0.l)) ; [159] 81 | (andl ($ 7) (% imm0.l)) ; [162] 82 | (cmpl ($ 5) (% imm0.l)) ; [165] 83 | (jne L168) ; [168] 84 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [170] 85 | L168 86 | (cmpb ($ #xB7) (% imm0.b)) ; [175] 87 | (jne L180) ; [178] 88 | (movl ($ 16) (% arg_z.l)) ; [180] 89 | (jmp L116) ; [185] 90 | L180 91 | (movl (% save0.l) (% imm0.l)) ; [187] 92 | (andl ($ 7) (% imm0.l)) ; [190] 93 | (cmpl ($ 5) (% imm0.l)) ; [193] 94 | (jne L196) ; [196] 95 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [198] 96 | L196 97 | (cmpb ($ #xE9) (% imm0.b)) ; [203] 98 | (jne L208) ; [206] 99 | (movl ($ 24) (% arg_z.l)) ; [208] 100 | (jmp L116) ; [213] 101 | L208 102 | (movl (% save0.l) (% imm0.l)) ; [215] 103 | (andl ($ 7) (% imm0.l)) ; [218] 104 | (cmpl ($ 5) (% imm0.l)) ; [221] 105 | (jne L224) ; [224] 106 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [226] 107 | L224 108 | (cmpb ($ #xEA) (% imm0.b)) ; [231] 109 | (jne L236) ; [234] 110 | (movl ($ 32) (% arg_z.l)) ; [236] 111 | (jmp L116) ; [241] 112 | L236 113 | (movl (% save0.l) (% imm0.l)) ; [243] 114 | (andl ($ 7) (% imm0.l)) ; [246] 115 | (cmpl ($ 5) (% imm0.l)) ; [249] 116 | (jne L252) ; [252] 117 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [254] 118 | L252 119 | (cmpb ($ #xD7) (% imm0.b)) ; [259] 120 | (jne L267) ; [262] 121 | (movl ($ 40) (% arg_z.l)) ; [264] 122 | (jmpq L116) ; [269] 123 | L267 124 | (movl (% save0.l) (% imm0.l)) ; [274] 125 | (andl ($ 7) (% imm0.l)) ; [277] 126 | (cmpl ($ 5) (% imm0.l)) ; [280] 127 | (jne L283) ; [283] 128 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [285] 129 | L283 130 | (cmpb ($ #xA7) (% imm0.b)) ; [290] 131 | (jne L298) ; [293] 132 | (movl ($ 48) (% arg_z.l)) ; [295] 133 | (jmpq L116) ; [300] 134 | L298 135 | (movl (% save0.l) (% imm0.l)) ; [305] 136 | (andl ($ 7) (% imm0.l)) ; [308] 137 | (cmpl ($ 5) (% imm0.l)) ; [311] 138 | (jne L314) ; [314] 139 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [316] 140 | L314 141 | (cmpb ($ #xD9) (% imm0.b)) ; [321] 142 | (jne L329) ; [324] 143 | (movl ($ 56) (% arg_z.l)) ; [326] 144 | (jmpq L116) ; [331] 145 | L329 146 | (movl (% save0.l) (% imm0.l)) ; [336] 147 | (andl ($ 7) (% imm0.l)) ; [339] 148 | (cmpl ($ 5) (% imm0.l)) ; [342] 149 | (jne L345) ; [345] 150 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [347] 151 | L345 152 | (cmpb ($ #xCA) (% imm0.b)) ; [352] 153 | (jne L360) ; [355] 154 | (movl ($ 64) (% arg_z.l)) ; [357] 155 | (jmpq L116) ; [362] 156 | L360 157 | (movl (% save0.l) (% imm0.l)) ; [367] 158 | (andl ($ 7) (% imm0.l)) ; [370] 159 | (cmpl ($ 5) (% imm0.l)) ; [373] 160 | (jne L376) ; [376] 161 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [378] 162 | L376 163 | (cmpb ($ #xDA) (% imm0.b)) ; [383] 164 | (jne L391) ; [386] 165 | (movl ($ 72) (% arg_z.l)) ; [388] 166 | (jmpq L116) ; [393] 167 | L391 168 | (movl (% save0.l) (% imm0.l)) ; [398] 169 | (andl ($ 7) (% imm0.l)) ; [401] 170 | (cmpl ($ 5) (% imm0.l)) ; [404] 171 | (jne L407) ; [407] 172 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [409] 173 | L407 174 | (cmpb ($ #xF9) (% imm0.b)) ; [414] 175 | (jne L422) ; [417] 176 | (movl ($ 80) (% arg_z.l)) ; [419] 177 | (jmpq L116) ; [424] 178 | L422 179 | (movl (% save0.l) (% imm0.l)) ; [429] 180 | (andl ($ 7) (% imm0.l)) ; [432] 181 | (cmpl ($ 5) (% imm0.l)) ; [435] 182 | (jne L438) ; [438] 183 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [440] 184 | L438 185 | (cmpb ($ #xFA) (% imm0.b)) ; [445] 186 | (jne L453) ; [448] 187 | (movl ($ 88) (% arg_z.l)) ; [450] 188 | (jmpq L116) ; [455] 189 | L453 190 | (movl (% save0.l) (% imm0.l)) ; [460] 191 | (andl ($ 7) (% imm0.l)) ; [463] 192 | (cmpl ($ 5) (% imm0.l)) ; [466] 193 | (jne L469) ; [469] 194 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [471] 195 | L469 196 | (cmpb ($ #xBA) (% imm0.b)) ; [476] 197 | (jne L484) ; [479] 198 | (movl ($ 96) (% arg_z.l)) ; [481] 199 | (jmpq L116) ; [486] 200 | L484 201 | (movl (% save0.l) (% imm0.l)) ; [491] 202 | (andl ($ 7) (% imm0.l)) ; [494] 203 | (cmpl ($ 5) (% imm0.l)) ; [497] 204 | (jne L500) ; [500] 205 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [502] 206 | L500 207 | (cmpb ($ #x97) (% imm0.b)) ; [507] 208 | (jne L515) ; [510] 209 | (movl ($ #x68) (% arg_z.l)) ; [512] 210 | (jmpq L116) ; [517] 211 | L515 212 | (movl (% save0.l) (% imm0.l)) ; [522] 213 | (andl ($ 7) (% imm0.l)) ; [525] 214 | (cmpl ($ 5) (% imm0.l)) ; [528] 215 | (jne L531) ; [531] 216 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [533] 217 | L531 218 | (cmpb ($ #xC9) (% imm0.b)) ; [538] 219 | (jne L546) ; [541] 220 | (movl ($ #x70) (% arg_z.l)) ; [543] 221 | (jmpq L116) ; [548] 222 | L546 223 | (movq (% save0) (% arg_z)) ; [553] 224 | (movl ($ 8) (% nargs)) ; [556] 225 | (movq (@ 'SIMPLE-VECTOR-P (% fn)) (% temp0)) ; [561] 226 | (lisp-call (@ 10 (% temp0))) ; [569] 227 | (recover-fn-from-rip) ; [572] 228 | (cmpb ($ 11) (% arg_z.b)) ; [579] 229 | (je L588) ; [583] 230 | (movl ($ #x78) (% arg_z.l)) ; [585] 231 | (jmpq L116) ; [590] 232 | L588 233 | (movl ($ #x4E8) (% arg_x.l)) ; [595] 234 | (movq (% save0) (% arg_y)) ; [601] 235 | (movq (@ '(OR (SIMPLE-ARRAY BIT 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 8) 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 32) 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 64) 1) (SIMPLE-ARRAY (SIGNED-BYTE 8) 1) (SIMPLE-ARRAY (SIGNED-BYTE 16) 1) (SIMPLE-ARRAY (SIGNED-BYTE 32) 1) (SIMPLE-ARRAY FIXNUM 1) (SIMPLE-ARRAY (SIGNED-BYTE 64) 1) (SIMPLE-ARRAY SINGLE-FLOAT 1) (SIMPLE-ARRAY DOUBLE-FLOAT 1) (SIMPLE-ARRAY (COMPLEX SINGLE-FLOAT) 1) (SIMPLE-ARRAY (COMPLEX DOUBLE-FLOAT) 1) (SIMPLE-ARRAY BASE-CHAR 1) (SIMPLE-ARRAY T 1)) (% fn)) (% arg_z)) ; [604] 236 | (movl ($ 24) (% nargs)) ; [611] 237 | (lisp-call (@ .SPKSIGNALERR)) ; [621] 238 | (recover-fn-from-rip) ; [628] 239 | (movl ($ #x1300B) (% arg_z.l)) ; [635] 240 | (jmpq L116) ; [640] 241 | L638 242 | (movq (% save0) (% arg_z)) ; [645] 243 | (movl ($ 8) (% nargs)) ; [648] 244 | (movq (@ 'CCL::SIMPLE-ARRAY-P (% fn)) (% temp0)) ; [653] 245 | (lisp-call (@ 10 (% temp0))) ; [665] 246 | (recover-fn-from-rip) ; [668] 247 | (cmpb ($ 11) (% arg_z.b)) ; [675] 248 | (je L1494) ; [679] 249 | (movq (% save0) (% arg_y)) ; [685] 250 | (movq (@ '# (% fn)) (% arg_z)) ; [688] 251 | (movl ($ 16) (% nargs)) ; [695] 252 | (movq (% save1) (% temp0)) ; [700] 253 | (lisp-call (@ 10 (% temp0))) ; [705] 254 | (recover-fn-from-rip) ; [708] 255 | (cmpb ($ 11) (% arg_z.b)) ; [715] 256 | (je L724) ; [719] 257 | (movl ($ #x80) (% arg_z.l)) ; [721] 258 | (jmpq L116) ; [726] 259 | L724 260 | (movq (% save0) (% arg_y)) ; [731] 261 | (movq (@ '# (% fn)) (% arg_z)) ; [734] 262 | (movl ($ 16) (% nargs)) ; [741] 263 | (movq (% save1) (% temp0)) ; [746] 264 | (lisp-call (@ 10 (% temp0))) ; [753] 265 | (recover-fn-from-rip) ; [756] 266 | (cmpb ($ 11) (% arg_z.b)) ; [763] 267 | (je L772) ; [767] 268 | (movl ($ #x88) (% arg_z.l)) ; [769] 269 | (jmpq L116) ; [774] 270 | L772 271 | (movq (% save0) (% arg_y)) ; [779] 272 | (movq (@ '# (% fn)) (% arg_z)) ; [782] 273 | (movl ($ 16) (% nargs)) ; [789] 274 | (movq (% save1) (% temp0)) ; [794] 275 | (lisp-call (@ 10 (% temp0))) ; [801] 276 | (recover-fn-from-rip) ; [804] 277 | (cmpb ($ 11) (% arg_z.b)) ; [811] 278 | (je L820) ; [815] 279 | (movl ($ #x90) (% arg_z.l)) ; [817] 280 | (jmpq L116) ; [822] 281 | L820 282 | (movq (% save0) (% arg_y)) ; [827] 283 | (movq (@ '# (% fn)) (% arg_z)) ; [830] 284 | (movl ($ 16) (% nargs)) ; [837] 285 | (movq (% save1) (% temp0)) ; [842] 286 | (lisp-call (@ 10 (% temp0))) ; [849] 287 | (recover-fn-from-rip) ; [852] 288 | (cmpb ($ 11) (% arg_z.b)) ; [859] 289 | (je L868) ; [863] 290 | (movl ($ #x98) (% arg_z.l)) ; [865] 291 | (jmpq L116) ; [870] 292 | L868 293 | (movq (% save0) (% arg_y)) ; [875] 294 | (movq (@ '# (% fn)) (% arg_z)) ; [878] 295 | (movl ($ 16) (% nargs)) ; [885] 296 | (movq (% save1) (% temp0)) ; [890] 297 | (lisp-call (@ 10 (% temp0))) ; [897] 298 | (recover-fn-from-rip) ; [900] 299 | (cmpb ($ 11) (% arg_z.b)) ; [907] 300 | (je L916) ; [911] 301 | (movl ($ #xA0) (% arg_z.l)) ; [913] 302 | (jmpq L116) ; [918] 303 | L916 304 | (movq (% save0) (% arg_y)) ; [923] 305 | (movq (@ '# (% fn)) (% arg_z)) ; [926] 306 | (movl ($ 16) (% nargs)) ; [933] 307 | (movq (% save1) (% temp0)) ; [938] 308 | (lisp-call (@ 10 (% temp0))) ; [945] 309 | (recover-fn-from-rip) ; [948] 310 | (cmpb ($ 11) (% arg_z.b)) ; [955] 311 | (je L964) ; [959] 312 | (movl ($ #xA8) (% arg_z.l)) ; [961] 313 | (jmpq L116) ; [966] 314 | L964 315 | (movq (% save0) (% arg_y)) ; [971] 316 | (movq (@ '# (% fn)) (% arg_z)) ; [974] 317 | (movl ($ 16) (% nargs)) ; [981] 318 | (movq (% save1) (% temp0)) ; [986] 319 | (lisp-call (@ 10 (% temp0))) ; [993] 320 | (recover-fn-from-rip) ; [996] 321 | (cmpb ($ 11) (% arg_z.b)) ; [1003] 322 | (je L1012) ; [1007] 323 | (movl ($ #xB0) (% arg_z.l)) ; [1009] 324 | (jmpq L116) ; [1014] 325 | L1012 326 | (movq (% save0) (% arg_y)) ; [1019] 327 | (movq (@ '# (% fn)) (% arg_z)) ; [1022] 328 | (movl ($ 16) (% nargs)) ; [1029] 329 | (movq (% save1) (% temp0)) ; [1034] 330 | (lisp-call (@ 10 (% temp0))) ; [1041] 331 | (recover-fn-from-rip) ; [1044] 332 | (cmpb ($ 11) (% arg_z.b)) ; [1051] 333 | (je L1060) ; [1055] 334 | (movl ($ #xB8) (% arg_z.l)) ; [1057] 335 | (jmpq L116) ; [1062] 336 | L1060 337 | (movq (% save0) (% arg_y)) ; [1067] 338 | (movq (@ '# (% fn)) (% arg_z)) ; [1070] 339 | (movl ($ 16) (% nargs)) ; [1077] 340 | (movq (% save1) (% temp0)) ; [1082] 341 | (lisp-call (@ 10 (% temp0))) ; [1089] 342 | (recover-fn-from-rip) ; [1092] 343 | (cmpb ($ 11) (% arg_z.b)) ; [1099] 344 | (je L1108) ; [1103] 345 | (movl ($ #xC0) (% arg_z.l)) ; [1105] 346 | (jmpq L116) ; [1110] 347 | L1108 348 | (movq (% save0) (% arg_y)) ; [1115] 349 | (movq (@ '# (% fn)) (% arg_z)) ; [1118] 350 | (movl ($ 16) (% nargs)) ; [1125] 351 | (movq (% save1) (% temp0)) ; [1130] 352 | (lisp-call (@ 10 (% temp0))) ; [1137] 353 | (recover-fn-from-rip) ; [1140] 354 | (cmpb ($ 11) (% arg_z.b)) ; [1147] 355 | (je L1156) ; [1151] 356 | (movl ($ #xC8) (% arg_z.l)) ; [1153] 357 | (jmpq L116) ; [1158] 358 | L1156 359 | (movq (% save0) (% arg_y)) ; [1163] 360 | (movq (@ '# (% fn)) (% arg_z)) ; [1166] 361 | (movl ($ 16) (% nargs)) ; [1173] 362 | (movq (% save1) (% temp0)) ; [1178] 363 | (lisp-call (@ 10 (% temp0))) ; [1185] 364 | (recover-fn-from-rip) ; [1188] 365 | (cmpb ($ 11) (% arg_z.b)) ; [1195] 366 | (je L1204) ; [1199] 367 | (movl ($ #xD0) (% arg_z.l)) ; [1201] 368 | (jmpq L116) ; [1206] 369 | L1204 370 | (movq (% save0) (% arg_y)) ; [1211] 371 | (movq (@ '# (% fn)) (% arg_z)) ; [1214] 372 | (movl ($ 16) (% nargs)) ; [1221] 373 | (movq (% save1) (% temp0)) ; [1226] 374 | (lisp-call (@ 10 (% temp0))) ; [1233] 375 | (recover-fn-from-rip) ; [1236] 376 | (cmpb ($ 11) (% arg_z.b)) ; [1243] 377 | (je L1252) ; [1247] 378 | (movl ($ #xD8) (% arg_z.l)) ; [1249] 379 | (jmpq L116) ; [1254] 380 | L1252 381 | (movq (% save0) (% arg_y)) ; [1259] 382 | (movq (@ '# (% fn)) (% arg_z)) ; [1262] 383 | (movl ($ 16) (% nargs)) ; [1269] 384 | (movq (% save1) (% temp0)) ; [1274] 385 | (lisp-call (@ 10 (% temp0))) ; [1281] 386 | (recover-fn-from-rip) ; [1284] 387 | (cmpb ($ 11) (% arg_z.b)) ; [1291] 388 | (je L1300) ; [1295] 389 | (movl ($ #xE0) (% arg_z.l)) ; [1297] 390 | (jmpq L116) ; [1302] 391 | L1300 392 | (movq (% save0) (% arg_y)) ; [1307] 393 | (movq (@ '# (% fn)) (% arg_z)) ; [1310] 394 | (movl ($ 16) (% nargs)) ; [1317] 395 | (movq (% save1) (% temp0)) ; [1322] 396 | (lisp-call (@ 10 (% temp0))) ; [1329] 397 | (recover-fn-from-rip) ; [1332] 398 | (cmpb ($ 11) (% arg_z.b)) ; [1339] 399 | (je L1348) ; [1343] 400 | (movl ($ #xE8) (% arg_z.l)) ; [1345] 401 | (jmpq L116) ; [1350] 402 | L1348 403 | (movq (% save0) (% arg_y)) ; [1355] 404 | (movq (@ '# (% fn)) (% arg_z)) ; [1358] 405 | (movl ($ 16) (% nargs)) ; [1365] 406 | (movq (% save1) (% temp0)) ; [1370] 407 | (lisp-call (@ 10 (% temp0))) ; [1377] 408 | (recover-fn-from-rip) ; [1380] 409 | (cmpb ($ 11) (% arg_z.b)) ; [1387] 410 | (je L1396) ; [1391] 411 | (movl ($ #xF0) (% arg_z.l)) ; [1393] 412 | (jmpq L116) ; [1398] 413 | L1396 414 | (movq (% save0) (% arg_y)) ; [1403] 415 | (movq (@ '# (% fn)) (% arg_z)) ; [1406] 416 | (movl ($ 16) (% nargs)) ; [1413] 417 | (movq (% save1) (% temp0)) ; [1418] 418 | (lisp-call (@ 10 (% temp0))) ; [1425] 419 | (recover-fn-from-rip) ; [1428] 420 | (cmpb ($ 11) (% arg_z.b)) ; [1435] 421 | (je L1444) ; [1439] 422 | (movl ($ #xF8) (% arg_z.l)) ; [1441] 423 | (jmpq L116) ; [1446] 424 | L1444 425 | (movl ($ #x4E8) (% arg_x.l)) ; [1451] 426 | (movq (% save0) (% arg_y)) ; [1457] 427 | (movq (@ '(OR (SIMPLE-ARRAY BIT) (SIMPLE-ARRAY (UNSIGNED-BYTE 8)) (SIMPLE-ARRAY (UNSIGNED-BYTE 16)) (SIMPLE-ARRAY (UNSIGNED-BYTE 32)) (SIMPLE-ARRAY (UNSIGNED-BYTE 64)) (SIMPLE-ARRAY (SIGNED-BYTE 8)) (SIMPLE-ARRAY (SIGNED-BYTE 16)) (SIMPLE-ARRAY (SIGNED-BYTE 32)) (SIMPLE-ARRAY FIXNUM) (SIMPLE-ARRAY (SIGNED-BYTE 64)) (SIMPLE-ARRAY SINGLE-FLOAT) (SIMPLE-ARRAY DOUBLE-FLOAT) (SIMPLE-ARRAY (COMPLEX SINGLE-FLOAT)) (SIMPLE-ARRAY (COMPLEX DOUBLE-FLOAT)) (SIMPLE-ARRAY BASE-CHAR) (SIMPLE-ARRAY T)) (% fn)) (% arg_z)) ; [1460] 428 | (movl ($ 24) (% nargs)) ; [1467] 429 | (lisp-call (@ .SPKSIGNALERR)) ; [1477] 430 | (recover-fn-from-rip) ; [1484] 431 | (movl ($ #x1300B) (% arg_z.l)) ; [1491] 432 | (jmpq L116) ; [1496] 433 | L1494 434 | (movl (% save0.l) (% imm0.l)) ; [1501] 435 | (andl ($ 7) (% imm0.l)) ; [1504] 436 | (cmpl ($ 5) (% imm0.l)) ; [1507] 437 | (jne L1510) ; [1510] 438 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [1512] 439 | L1510 440 | (imulq ($ 8) (% imm0) (% save2)) ; [1517] 441 | (movl (% save2.l) (% imm0.l)) ; [1521] 442 | (shrl ($ 3) (% imm0.l)) ; [1524] 443 | (andl ($ 15) (% imm0.l)) ; [1527] 444 | (movl ($ 96) (% nargs)) ; [1530] 445 | (btl (% imm0.l) (% nargs)) ; [1535] 446 | (movl ($ 0) (% nargs)) ; [1538] 447 | (movl (% save2.l) (% arg_z.l)) ; [1543] 448 | (cmovael (% nargs) (% arg_z.l)) ; [1546] 449 | (cmpq ($ #x528) (% arg_z)) ; [1549] 450 | (jge L1592) ; [1556] 451 | (movl (% save2.l) (% imm0.l)) ; [1558] 452 | (shrl ($ 3) (% imm0.l)) ; [1561] 453 | (andl ($ 15) (% imm0.l)) ; [1564] 454 | (movl ($ #x680) (% nargs)) ; [1567] 455 | (btl (% imm0.l) (% nargs)) ; [1572] 456 | (movl ($ 0) (% nargs)) ; [1575] 457 | (movl (% save2.l) (% arg_z.l)) ; [1580] 458 | (cmovael (% nargs) (% arg_z.l)) ; [1583] 459 | (cmpq ($ #x4B8) (% arg_z)) ; [1586] 460 | (jl L2406) ; [1593] 461 | L1592 462 | (movq (% save0) (% arg_y)) ; [1599] 463 | (movq (@ '# (% fn)) (% arg_z)) ; [1602] 464 | (movl ($ 16) (% nargs)) ; [1609] 465 | (movq (% save1) (% temp0)) ; [1614] 466 | (lisp-call (@ 10 (% temp0))) ; [1617] 467 | (recover-fn-from-rip) ; [1620] 468 | (cmpb ($ 11) (% arg_z.b)) ; [1627] 469 | (je L1636) ; [1631] 470 | (movl ($ #x100) (% arg_z.l)) ; [1633] 471 | (jmpq L116) ; [1638] 472 | L1636 473 | (movq (% save0) (% arg_y)) ; [1643] 474 | (movq (@ '# (% fn)) (% arg_z)) ; [1646] 475 | (movl ($ 16) (% nargs)) ; [1653] 476 | (movq (% save1) (% temp0)) ; [1658] 477 | (lisp-call (@ 10 (% temp0))) ; [1665] 478 | (recover-fn-from-rip) ; [1668] 479 | (cmpb ($ 11) (% arg_z.b)) ; [1675] 480 | (je L1684) ; [1679] 481 | (movl ($ #x108) (% arg_z.l)) ; [1681] 482 | (jmpq L116) ; [1686] 483 | L1684 484 | (movq (% save0) (% arg_y)) ; [1691] 485 | (movq (@ '# (% fn)) (% arg_z)) ; [1694] 486 | (movl ($ 16) (% nargs)) ; [1701] 487 | (movq (% save1) (% temp0)) ; [1706] 488 | (lisp-call (@ 10 (% temp0))) ; [1713] 489 | (recover-fn-from-rip) ; [1716] 490 | (cmpb ($ 11) (% arg_z.b)) ; [1723] 491 | (je L1732) ; [1727] 492 | (movl ($ #x110) (% arg_z.l)) ; [1729] 493 | (jmpq L116) ; [1734] 494 | L1732 495 | (movq (% save0) (% arg_y)) ; [1739] 496 | (movq (@ '# (% fn)) (% arg_z)) ; [1742] 497 | (movl ($ 16) (% nargs)) ; [1749] 498 | (movq (% save1) (% temp0)) ; [1754] 499 | (lisp-call (@ 10 (% temp0))) ; [1761] 500 | (recover-fn-from-rip) ; [1764] 501 | (cmpb ($ 11) (% arg_z.b)) ; [1771] 502 | (je L1780) ; [1775] 503 | (movl ($ #x118) (% arg_z.l)) ; [1777] 504 | (jmpq L116) ; [1782] 505 | L1780 506 | (movq (% save0) (% arg_y)) ; [1787] 507 | (movq (@ '# (% fn)) (% arg_z)) ; [1790] 508 | (movl ($ 16) (% nargs)) ; [1797] 509 | (movq (% save1) (% temp0)) ; [1802] 510 | (lisp-call (@ 10 (% temp0))) ; [1809] 511 | (recover-fn-from-rip) ; [1812] 512 | (cmpb ($ 11) (% arg_z.b)) ; [1819] 513 | (je L1828) ; [1823] 514 | (movl ($ #x120) (% arg_z.l)) ; [1825] 515 | (jmpq L116) ; [1830] 516 | L1828 517 | (movq (% save0) (% arg_y)) ; [1835] 518 | (movq (@ '# (% fn)) (% arg_z)) ; [1838] 519 | (movl ($ 16) (% nargs)) ; [1845] 520 | (movq (% save1) (% temp0)) ; [1850] 521 | (lisp-call (@ 10 (% temp0))) ; [1857] 522 | (recover-fn-from-rip) ; [1860] 523 | (cmpb ($ 11) (% arg_z.b)) ; [1867] 524 | (je L1876) ; [1871] 525 | (movl ($ #x128) (% arg_z.l)) ; [1873] 526 | (jmpq L116) ; [1878] 527 | L1876 528 | (movq (% save0) (% arg_y)) ; [1883] 529 | (movq (@ '# (% fn)) (% arg_z)) ; [1886] 530 | (movl ($ 16) (% nargs)) ; [1893] 531 | (movq (% save1) (% temp0)) ; [1898] 532 | (lisp-call (@ 10 (% temp0))) ; [1905] 533 | (recover-fn-from-rip) ; [1908] 534 | (cmpb ($ 11) (% arg_z.b)) ; [1915] 535 | (je L1924) ; [1919] 536 | (movl ($ #x130) (% arg_z.l)) ; [1921] 537 | (jmpq L116) ; [1926] 538 | L1924 539 | (movq (% save0) (% arg_y)) ; [1931] 540 | (movq (@ '# (% fn)) (% arg_z)) ; [1934] 541 | (movl ($ 16) (% nargs)) ; [1941] 542 | (movq (% save1) (% temp0)) ; [1946] 543 | (lisp-call (@ 10 (% temp0))) ; [1953] 544 | (recover-fn-from-rip) ; [1956] 545 | (cmpb ($ 11) (% arg_z.b)) ; [1963] 546 | (je L1972) ; [1967] 547 | (movl ($ #x138) (% arg_z.l)) ; [1969] 548 | (jmpq L116) ; [1974] 549 | L1972 550 | (movq (% save0) (% arg_y)) ; [1979] 551 | (movq (@ '# (% fn)) (% arg_z)) ; [1982] 552 | (movl ($ 16) (% nargs)) ; [1989] 553 | (movq (% save1) (% temp0)) ; [1994] 554 | (lisp-call (@ 10 (% temp0))) ; [2001] 555 | (recover-fn-from-rip) ; [2004] 556 | (cmpb ($ 11) (% arg_z.b)) ; [2011] 557 | (je L2020) ; [2015] 558 | (movl ($ #x140) (% arg_z.l)) ; [2017] 559 | (jmpq L116) ; [2022] 560 | L2020 561 | (movq (% save0) (% arg_y)) ; [2027] 562 | (movq (@ '# (% fn)) (% arg_z)) ; [2030] 563 | (movl ($ 16) (% nargs)) ; [2037] 564 | (movq (% save1) (% temp0)) ; [2042] 565 | (lisp-call (@ 10 (% temp0))) ; [2049] 566 | (recover-fn-from-rip) ; [2052] 567 | (cmpb ($ 11) (% arg_z.b)) ; [2059] 568 | (je L2068) ; [2063] 569 | (movl ($ #x148) (% arg_z.l)) ; [2065] 570 | (jmpq L116) ; [2070] 571 | L2068 572 | (movq (% save0) (% arg_y)) ; [2075] 573 | (movq (@ '# (% fn)) (% arg_z)) ; [2078] 574 | (movl ($ 16) (% nargs)) ; [2085] 575 | (movq (% save1) (% temp0)) ; [2090] 576 | (lisp-call (@ 10 (% temp0))) ; [2097] 577 | (recover-fn-from-rip) ; [2100] 578 | (cmpb ($ 11) (% arg_z.b)) ; [2107] 579 | (je L2116) ; [2111] 580 | (movl ($ #x150) (% arg_z.l)) ; [2113] 581 | (jmpq L116) ; [2118] 582 | L2116 583 | (movq (% save0) (% arg_y)) ; [2123] 584 | (movq (@ '# (% fn)) (% arg_z)) ; [2126] 585 | (movl ($ 16) (% nargs)) ; [2133] 586 | (movq (% save1) (% temp0)) ; [2138] 587 | (lisp-call (@ 10 (% temp0))) ; [2145] 588 | (recover-fn-from-rip) ; [2148] 589 | (cmpb ($ 11) (% arg_z.b)) ; [2155] 590 | (je L2164) ; [2159] 591 | (movl ($ #x158) (% arg_z.l)) ; [2161] 592 | (jmpq L116) ; [2166] 593 | L2164 594 | (movq (% save0) (% arg_y)) ; [2171] 595 | (movq (@ '# (% fn)) (% arg_z)) ; [2174] 596 | (movl ($ 16) (% nargs)) ; [2181] 597 | (movq (% save1) (% temp0)) ; [2186] 598 | (lisp-call (@ 10 (% temp0))) ; [2193] 599 | (recover-fn-from-rip) ; [2196] 600 | (cmpb ($ 11) (% arg_z.b)) ; [2203] 601 | (je L2212) ; [2207] 602 | (movl ($ #x160) (% arg_z.l)) ; [2209] 603 | (jmpq L116) ; [2214] 604 | L2212 605 | (movq (% save0) (% arg_y)) ; [2219] 606 | (movq (@ '# (% fn)) (% arg_z)) ; [2222] 607 | (movl ($ 16) (% nargs)) ; [2229] 608 | (movq (% save1) (% temp0)) ; [2234] 609 | (lisp-call (@ 10 (% temp0))) ; [2241] 610 | (recover-fn-from-rip) ; [2244] 611 | (cmpb ($ 11) (% arg_z.b)) ; [2251] 612 | (je L2260) ; [2255] 613 | (movl ($ #x168) (% arg_z.l)) ; [2257] 614 | (jmpq L116) ; [2262] 615 | L2260 616 | (movq (% save0) (% arg_y)) ; [2267] 617 | (movq (@ '# (% fn)) (% arg_z)) ; [2270] 618 | (movl ($ 16) (% nargs)) ; [2277] 619 | (movq (% save1) (% temp0)) ; [2282] 620 | (lisp-call (@ 10 (% temp0))) ; [2289] 621 | (recover-fn-from-rip) ; [2292] 622 | (cmpb ($ 11) (% arg_z.b)) ; [2299] 623 | (je L2308) ; [2303] 624 | (movl ($ #x170) (% arg_z.l)) ; [2305] 625 | (jmpq L116) ; [2310] 626 | L2308 627 | (movq (% save0) (% arg_y)) ; [2315] 628 | (movq (@ '# (% fn)) (% arg_z)) ; [2318] 629 | (movl ($ 16) (% nargs)) ; [2325] 630 | (movq (% save1) (% temp0)) ; [2330] 631 | (lisp-call (@ 10 (% temp0))) ; [2337] 632 | (recover-fn-from-rip) ; [2340] 633 | (cmpb ($ 11) (% arg_z.b)) ; [2347] 634 | (je L2356) ; [2351] 635 | (movl ($ #x178) (% arg_z.l)) ; [2353] 636 | (jmpq L116) ; [2358] 637 | L2356 638 | (movl ($ #x4E8) (% arg_x.l)) ; [2363] 639 | (movq (% save0) (% arg_y)) ; [2369] 640 | (movq (@ '(OR (ARRAY BIT) (ARRAY (UNSIGNED-BYTE 8)) (ARRAY (UNSIGNED-BYTE 16)) (ARRAY (UNSIGNED-BYTE 32)) (ARRAY (UNSIGNED-BYTE 64)) (ARRAY (SIGNED-BYTE 8)) (ARRAY (SIGNED-BYTE 16)) (ARRAY (SIGNED-BYTE 32)) (ARRAY FIXNUM) (ARRAY (SIGNED-BYTE 64)) (ARRAY SINGLE-FLOAT) (ARRAY DOUBLE-FLOAT) (ARRAY (COMPLEX SINGLE-FLOAT)) (ARRAY (COMPLEX DOUBLE-FLOAT)) (ARRAY BASE-CHAR) (ARRAY T)) (% fn)) (% arg_z)) ; [2372] 641 | (movl ($ 24) (% nargs)) ; [2379] 642 | (lisp-call (@ .SPKSIGNALERR)) ; [2389] 643 | (recover-fn-from-rip) ; [2396] 644 | (movl ($ #x1300B) (% arg_z.l)) ; [2403] 645 | (jmpq L116) ; [2408] 646 | L2406 647 | (testb ($ 7) (% save0.b)) ; [2413] 648 | (jne L2422) ; [2417] 649 | (movl ($ #x180) (% arg_z.l)) ; [2419] 650 | (jmpq L116) ; [2424] 651 | L2422 652 | (movl (% save0.l) (% imm0.l)) ; [2429] 653 | (andl ($ 7) (% imm0.l)) ; [2432] 654 | (cmpl ($ 5) (% imm0.l)) ; [2435] 655 | (jne L2438) ; [2438] 656 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2440] 657 | L2438 658 | (cmpb ($ 25) (% imm0.b)) ; [2445] 659 | (jne L2453) ; [2448] 660 | (movl ($ #x188) (% arg_z.l)) ; [2450] 661 | (jmpq L116) ; [2455] 662 | L2453 663 | (movl (% save0.l) (% imm0.l)) ; [2460] 664 | (andl ($ 7) (% imm0.l)) ; [2463] 665 | (cmpl ($ 5) (% imm0.l)) ; [2466] 666 | (jne L2469) ; [2469] 667 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2471] 668 | L2469 669 | (cmpb ($ 22) (% imm0.b)) ; [2476] 670 | (jne L2484) ; [2479] 671 | (movl ($ #x190) (% arg_z.l)) ; [2481] 672 | (jmpq L116) ; [2486] 673 | L2484 674 | (movl (% save0.l) (% imm0.l)) ; [2491] 675 | (andl ($ 15) (% imm0.l)) ; [2494] 676 | (cmpb ($ 1) (% imm0.b)) ; [2497] 677 | (jne L2505) ; [2500] 678 | (movl ($ #x198) (% arg_z.l)) ; [2502] 679 | (jmpq L116) ; [2507] 680 | L2505 681 | (movl (% save0.l) (% imm0.l)) ; [2512] 682 | (andl ($ 7) (% imm0.l)) ; [2515] 683 | (cmpl ($ 5) (% imm0.l)) ; [2518] 684 | (jne L2521) ; [2521] 685 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2523] 686 | L2521 687 | (cmpb ($ 41) (% imm0.b)) ; [2528] 688 | (jne L2536) ; [2531] 689 | (movl ($ #x1A0) (% arg_z.l)) ; [2533] 690 | (jmpq L116) ; [2538] 691 | L2536 692 | (movq (% save0) (% arg_y)) ; [2543] 693 | (movq (@ '# (% fn)) (% arg_z)) ; [2546] 694 | (movl ($ 16) (% nargs)) ; [2553] 695 | (movq (@ 'CCL::NUMERIC-%%TYPEP (% fn)) (% temp0)) ; [2558] 696 | (lisp-call (@ 10 (% temp0))) ; [2569] 697 | (recover-fn-from-rip) ; [2572] 698 | (cmpb ($ 11) (% arg_z.b)) ; [2579] 699 | (je L2588) ; [2583] 700 | (movl ($ #x1A8) (% arg_z.l)) ; [2585] 701 | (jmpq L116) ; [2590] 702 | L2588 703 | (movq (% save0) (% arg_y)) ; [2595] 704 | (movq (@ '# (% fn)) (% arg_z)) ; [2598] 705 | (movl ($ 16) (% nargs)) ; [2605] 706 | (movq (@ 'CCL::NUMERIC-%%TYPEP (% fn)) (% temp0)) ; [2610] 707 | (lisp-call (@ 10 (% temp0))) ; [2617] 708 | (recover-fn-from-rip) ; [2620] 709 | (cmpb ($ 11) (% arg_z.b)) ; [2627] 710 | (je L2636) ; [2631] 711 | (movl ($ #x1B0) (% arg_z.l)) ; [2633] 712 | (jmpq L116) ; [2638] 713 | L2636 714 | (movl (% save0.l) (% imm0.l)) ; [2643] 715 | (andl ($ 7) (% imm0.l)) ; [2646] 716 | (cmpl ($ 5) (% imm0.l)) ; [2649] 717 | (jne L2652) ; [2652] 718 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2654] 719 | L2652 720 | (imulq ($ 8) (% imm0) (% save2)) ; [2659] 721 | (cmpq ($ #x130) (% save2)) ; [2663] 722 | (je L2683) ; [2670] 723 | (cmpq ($ #x248) (% save2)) ; [2672] 724 | (je L2683) ; [2679] 725 | (cmpq ($ #x2C8) (% save2)) ; [2681] 726 | (jne L2693) ; [2688] 727 | L2683 728 | (movl ($ #x1B8) (% arg_z.l)) ; [2690] 729 | (jmpq L116) ; [2695] 730 | L2693 731 | (movzbl (% save0.b) (% imm0.l)) ; [2700] 732 | (cmpq ($ 2) (% imm0)) ; [2704] 733 | (jne L2713) ; [2708] 734 | (movl ($ #x1C0) (% arg_z.l)) ; [2710] 735 | (jmpq L116) ; [2715] 736 | L2713 737 | (movl (% save0.l) (% imm0.l)) ; [2720] 738 | (andl ($ 15) (% imm0.l)) ; [2723] 739 | (cmpb ($ 15) (% imm0.b)) ; [2726] 740 | (jne L2734) ; [2729] 741 | (movl ($ #x1D0) (% arg_z.l)) ; [2731] 742 | (jmpq L116) ; [2736] 743 | L2734 744 | (movl (% save0.l) (% imm0.l)) ; [2741] 745 | (andl ($ 15) (% imm0.l)) ; [2744] 746 | (cmpb ($ 3) (% imm0.b)) ; [2747] 747 | (jne L2755) ; [2750] 748 | (movl ($ #x1D8) (% arg_z.l)) ; [2752] 749 | (jmpq L116) ; [2757] 750 | L2755 751 | (cmpb ($ 11) (% save0.b)) ; [2762] 752 | (je L2774) ; [2766] 753 | (movl (% save0.l) (% imm0.l)) ; [2768] 754 | (andl ($ 15) (% imm0.l)) ; [2771] 755 | (cmpb ($ 14) (% imm0.b)) ; [2774] 756 | (je L2774) ; [2777] 757 | (jmp L2784) ; [2779] 758 | L2774 759 | (movl ($ #x1E0) (% arg_z.l)) ; [2781] 760 | (jmpq L116) ; [2786] 761 | L2784 762 | (movl (% save0.l) (% imm0.l)) ; [2791] 763 | (andl ($ 7) (% imm0.l)) ; [2794] 764 | (cmpl ($ 5) (% imm0.l)) ; [2797] 765 | (jne L2800) ; [2800] 766 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2802] 767 | L2800 768 | (cmpb ($ 54) (% imm0.b)) ; [2807] 769 | (jne L2815) ; [2810] 770 | (movl ($ #x1E8) (% arg_z.l)) ; [2812] 771 | (jmpq L116) ; [2817] 772 | L2815 773 | (movq (% save0) (% arg_y)) ; [2822] 774 | (movq (@ '# (% fn)) (% arg_z)) ; [2825] 775 | (movl ($ 16) (% nargs)) ; [2832] 776 | (movq (@ 'CCL::CLASS-CELL-TYPEP (% fn)) (% temp0)) ; [2837] 777 | (lisp-call (@ 10 (% temp0))) ; [2849] 778 | (recover-fn-from-rip) ; [2852] 779 | (cmpb ($ 11) (% arg_z.b)) ; [2859] 780 | (je L2868) ; [2863] 781 | (movl ($ #x1F0) (% arg_z.l)) ; [2865] 782 | (jmpq L116) ; [2870] 783 | L2868 784 | (movl ($ #x1F8) (% arg_z.l)) ; [2875] 785 | (jmpq L116) ; [2880] 786 | L2933 787 | (uuo-error-wrong-number-of-args) ; [2940] 788 | -------------------------------------------------------------------------------- /benchmark/d26e222e796046931693686edd176a72bd62fa3d.ccl.log: -------------------------------------------------------------------------------- 1 | 2 | x86_64 3 | Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz 4 | masataro-ThinkPad-T460 5 | Linux 6 | 4.4.0-150-generic 7 | Clozure Common Lisp 8 | Version 1.11.5/v1.11.5 (LinuxX8664) 9 | ;Compiler warnings : 10 | ; Clause (EXTENDED-CHAR 57) ignored in ETYPECASE form - shadowed by (BASE-CHAR 56) . 11 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 12 | took 696,356 microseconds (0.696356 seconds) to run. 13 | During that period, and with 4 available CPU cores, 14 | 684,000 microseconds (0.684000 seconds) were spent in user mode 15 | 0 microseconds (0.000000 seconds) were spent in system mode 16 | 2 minor page faults, 0 major page faults, 0 swaps. 17 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 18 | took 702,864 microseconds (0.702864 seconds) to run. 19 | During that period, and with 4 available CPU cores, 20 | 688,000 microseconds (0.688000 seconds) were spent in user mode 21 | 0 microseconds (0.000000 seconds) were spent in system mode 22 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 23 | took 728,504 microseconds (0.728504 seconds) to run. 24 | During that period, and with 4 available CPU cores, 25 | 716,000 microseconds (0.716000 seconds) were spent in user mode 26 | 0 microseconds (0.000000 seconds) were spent in system mode 27 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 28 | took 728,651 microseconds (0.728651 seconds) to run. 29 | During that period, and with 4 available CPU cores, 30 | 716,000 microseconds (0.716000 seconds) were spent in user mode 31 | 0 microseconds (0.000000 seconds) were spent in system mode 32 | (LOOP ITERATE:REPEAT 10000 DO (LOOP ITERATE:FOR SPECIALIZED-FUNCTION::E SPECIALIZED-FUNCTION::ACROSS ARRAY DO (SPECIALIZED-FUNCTION::WIDETAG SPECIALIZED-FUNCTION::E))) 33 | took 679,874 microseconds (0.679874 seconds) to run. 34 | During that period, and with 4 available CPU cores, 35 | 676,000 microseconds (0.676000 seconds) were spent in user mode 36 | 0 microseconds (0.000000 seconds) were spent in system mode 37 | (recover-fn-from-rip) ; [7] 38 | (cmpl ($ 8) (% nargs)) ; [14] 39 | (jne L2933) ; [17] 40 | (pushq (% rbp)) ; [23] 41 | (movq (% rsp) (% rbp)) ; [24] 42 | (pushq (% save0)) ; [27] 43 | (pushq (% save1)) ; [29] 44 | (pushq (% save2)) ; [31] 45 | (movq (@ 'CCL::ARRAY-%%TYPEP (% fn)) (% save1)) ; [33] 46 | (movq (% arg_z) (% save0)) ; [40] 47 | (movq (% save0) (% arg_y)) ; [43] 48 | (movq (@ '# (% fn)) (% arg_z)) ; [46] 49 | (movl ($ 16) (% nargs)) ; [53] 50 | (movq (% save1) (% temp0)) ; [58] 51 | (lisp-call (@ 10 (% temp0))) ; [65] 52 | (recover-fn-from-rip) ; [68] 53 | (cmpb ($ 11) (% arg_z.b)) ; [75] 54 | (je L638) ; [79] 55 | (movq (% save0) (% arg_z)) ; [85] 56 | (movl ($ 8) (% nargs)) ; [88] 57 | (movq (@ 'SIMPLE-BIT-VECTOR-P (% fn)) (% temp0)) ; [93] 58 | (lisp-call (@ 10 (% temp0))) ; [105] 59 | (recover-fn-from-rip) ; [108] 60 | (cmpb ($ 11) (% arg_z.b)) ; [115] 61 | (je L124) ; [119] 62 | (xorl (% arg_z.l) (% arg_z.l)) ; [121] 63 | L116 64 | (popq (% save2)) ; [123] 65 | (popq (% save1)) ; [125] 66 | (popq (% save0)) ; [127] 67 | (leaveq) ; [129] 68 | (retq) ; [130] 69 | L124 70 | (movl (% save0.l) (% imm0.l)) ; [131] 71 | (andl ($ 7) (% imm0.l)) ; [134] 72 | (cmpl ($ 5) (% imm0.l)) ; [137] 73 | (jne L140) ; [140] 74 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [142] 75 | L140 76 | (cmpb ($ #xE7) (% imm0.b)) ; [147] 77 | (jne L152) ; [150] 78 | (movl ($ 8) (% arg_z.l)) ; [152] 79 | (jmp L116) ; [157] 80 | L152 81 | (movl (% save0.l) (% imm0.l)) ; [159] 82 | (andl ($ 7) (% imm0.l)) ; [162] 83 | (cmpl ($ 5) (% imm0.l)) ; [165] 84 | (jne L168) ; [168] 85 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [170] 86 | L168 87 | (cmpb ($ #xB7) (% imm0.b)) ; [175] 88 | (jne L180) ; [178] 89 | (movl ($ 16) (% arg_z.l)) ; [180] 90 | (jmp L116) ; [185] 91 | L180 92 | (movl (% save0.l) (% imm0.l)) ; [187] 93 | (andl ($ 7) (% imm0.l)) ; [190] 94 | (cmpl ($ 5) (% imm0.l)) ; [193] 95 | (jne L196) ; [196] 96 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [198] 97 | L196 98 | (cmpb ($ #xE9) (% imm0.b)) ; [203] 99 | (jne L208) ; [206] 100 | (movl ($ 24) (% arg_z.l)) ; [208] 101 | (jmp L116) ; [213] 102 | L208 103 | (movl (% save0.l) (% imm0.l)) ; [215] 104 | (andl ($ 7) (% imm0.l)) ; [218] 105 | (cmpl ($ 5) (% imm0.l)) ; [221] 106 | (jne L224) ; [224] 107 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [226] 108 | L224 109 | (cmpb ($ #xEA) (% imm0.b)) ; [231] 110 | (jne L236) ; [234] 111 | (movl ($ 32) (% arg_z.l)) ; [236] 112 | (jmp L116) ; [241] 113 | L236 114 | (movl (% save0.l) (% imm0.l)) ; [243] 115 | (andl ($ 7) (% imm0.l)) ; [246] 116 | (cmpl ($ 5) (% imm0.l)) ; [249] 117 | (jne L252) ; [252] 118 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [254] 119 | L252 120 | (cmpb ($ #xD7) (% imm0.b)) ; [259] 121 | (jne L267) ; [262] 122 | (movl ($ 40) (% arg_z.l)) ; [264] 123 | (jmpq L116) ; [269] 124 | L267 125 | (movl (% save0.l) (% imm0.l)) ; [274] 126 | (andl ($ 7) (% imm0.l)) ; [277] 127 | (cmpl ($ 5) (% imm0.l)) ; [280] 128 | (jne L283) ; [283] 129 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [285] 130 | L283 131 | (cmpb ($ #xA7) (% imm0.b)) ; [290] 132 | (jne L298) ; [293] 133 | (movl ($ 48) (% arg_z.l)) ; [295] 134 | (jmpq L116) ; [300] 135 | L298 136 | (movl (% save0.l) (% imm0.l)) ; [305] 137 | (andl ($ 7) (% imm0.l)) ; [308] 138 | (cmpl ($ 5) (% imm0.l)) ; [311] 139 | (jne L314) ; [314] 140 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [316] 141 | L314 142 | (cmpb ($ #xD9) (% imm0.b)) ; [321] 143 | (jne L329) ; [324] 144 | (movl ($ 56) (% arg_z.l)) ; [326] 145 | (jmpq L116) ; [331] 146 | L329 147 | (movl (% save0.l) (% imm0.l)) ; [336] 148 | (andl ($ 7) (% imm0.l)) ; [339] 149 | (cmpl ($ 5) (% imm0.l)) ; [342] 150 | (jne L345) ; [345] 151 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [347] 152 | L345 153 | (cmpb ($ #xCA) (% imm0.b)) ; [352] 154 | (jne L360) ; [355] 155 | (movl ($ 64) (% arg_z.l)) ; [357] 156 | (jmpq L116) ; [362] 157 | L360 158 | (movl (% save0.l) (% imm0.l)) ; [367] 159 | (andl ($ 7) (% imm0.l)) ; [370] 160 | (cmpl ($ 5) (% imm0.l)) ; [373] 161 | (jne L376) ; [376] 162 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [378] 163 | L376 164 | (cmpb ($ #xDA) (% imm0.b)) ; [383] 165 | (jne L391) ; [386] 166 | (movl ($ 72) (% arg_z.l)) ; [388] 167 | (jmpq L116) ; [393] 168 | L391 169 | (movl (% save0.l) (% imm0.l)) ; [398] 170 | (andl ($ 7) (% imm0.l)) ; [401] 171 | (cmpl ($ 5) (% imm0.l)) ; [404] 172 | (jne L407) ; [407] 173 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [409] 174 | L407 175 | (cmpb ($ #xF9) (% imm0.b)) ; [414] 176 | (jne L422) ; [417] 177 | (movl ($ 80) (% arg_z.l)) ; [419] 178 | (jmpq L116) ; [424] 179 | L422 180 | (movl (% save0.l) (% imm0.l)) ; [429] 181 | (andl ($ 7) (% imm0.l)) ; [432] 182 | (cmpl ($ 5) (% imm0.l)) ; [435] 183 | (jne L438) ; [438] 184 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [440] 185 | L438 186 | (cmpb ($ #xFA) (% imm0.b)) ; [445] 187 | (jne L453) ; [448] 188 | (movl ($ 88) (% arg_z.l)) ; [450] 189 | (jmpq L116) ; [455] 190 | L453 191 | (movl (% save0.l) (% imm0.l)) ; [460] 192 | (andl ($ 7) (% imm0.l)) ; [463] 193 | (cmpl ($ 5) (% imm0.l)) ; [466] 194 | (jne L469) ; [469] 195 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [471] 196 | L469 197 | (cmpb ($ #xBA) (% imm0.b)) ; [476] 198 | (jne L484) ; [479] 199 | (movl ($ 96) (% arg_z.l)) ; [481] 200 | (jmpq L116) ; [486] 201 | L484 202 | (movl (% save0.l) (% imm0.l)) ; [491] 203 | (andl ($ 7) (% imm0.l)) ; [494] 204 | (cmpl ($ 5) (% imm0.l)) ; [497] 205 | (jne L500) ; [500] 206 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [502] 207 | L500 208 | (cmpb ($ #x97) (% imm0.b)) ; [507] 209 | (jne L515) ; [510] 210 | (movl ($ #x68) (% arg_z.l)) ; [512] 211 | (jmpq L116) ; [517] 212 | L515 213 | (movl (% save0.l) (% imm0.l)) ; [522] 214 | (andl ($ 7) (% imm0.l)) ; [525] 215 | (cmpl ($ 5) (% imm0.l)) ; [528] 216 | (jne L531) ; [531] 217 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [533] 218 | L531 219 | (cmpb ($ #xC9) (% imm0.b)) ; [538] 220 | (jne L546) ; [541] 221 | (movl ($ #x70) (% arg_z.l)) ; [543] 222 | (jmpq L116) ; [548] 223 | L546 224 | (movq (% save0) (% arg_z)) ; [553] 225 | (movl ($ 8) (% nargs)) ; [556] 226 | (movq (@ 'SIMPLE-VECTOR-P (% fn)) (% temp0)) ; [561] 227 | (lisp-call (@ 10 (% temp0))) ; [569] 228 | (recover-fn-from-rip) ; [572] 229 | (cmpb ($ 11) (% arg_z.b)) ; [579] 230 | (je L588) ; [583] 231 | (movl ($ #x78) (% arg_z.l)) ; [585] 232 | (jmpq L116) ; [590] 233 | L588 234 | (movl ($ #x4E8) (% arg_x.l)) ; [595] 235 | (movq (% save0) (% arg_y)) ; [601] 236 | (movq (@ '(OR (SIMPLE-ARRAY BIT 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 8) 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 32) 1) (SIMPLE-ARRAY (UNSIGNED-BYTE 64) 1) (SIMPLE-ARRAY (SIGNED-BYTE 8) 1) (SIMPLE-ARRAY (SIGNED-BYTE 16) 1) (SIMPLE-ARRAY (SIGNED-BYTE 32) 1) (SIMPLE-ARRAY FIXNUM 1) (SIMPLE-ARRAY (SIGNED-BYTE 64) 1) (SIMPLE-ARRAY SINGLE-FLOAT 1) (SIMPLE-ARRAY DOUBLE-FLOAT 1) (SIMPLE-ARRAY (COMPLEX SINGLE-FLOAT) 1) (SIMPLE-ARRAY (COMPLEX DOUBLE-FLOAT) 1) (SIMPLE-ARRAY BASE-CHAR 1) (SIMPLE-ARRAY T 1)) (% fn)) (% arg_z)) ; [604] 237 | (movl ($ 24) (% nargs)) ; [611] 238 | (lisp-call (@ .SPKSIGNALERR)) ; [621] 239 | (recover-fn-from-rip) ; [628] 240 | (movl ($ #x1300B) (% arg_z.l)) ; [635] 241 | (jmpq L116) ; [640] 242 | L638 243 | (movq (% save0) (% arg_z)) ; [645] 244 | (movl ($ 8) (% nargs)) ; [648] 245 | (movq (@ 'CCL::SIMPLE-ARRAY-P (% fn)) (% temp0)) ; [653] 246 | (lisp-call (@ 10 (% temp0))) ; [665] 247 | (recover-fn-from-rip) ; [668] 248 | (cmpb ($ 11) (% arg_z.b)) ; [675] 249 | (je L1494) ; [679] 250 | (movq (% save0) (% arg_y)) ; [685] 251 | (movq (@ '# (% fn)) (% arg_z)) ; [688] 252 | (movl ($ 16) (% nargs)) ; [695] 253 | (movq (% save1) (% temp0)) ; [700] 254 | (lisp-call (@ 10 (% temp0))) ; [705] 255 | (recover-fn-from-rip) ; [708] 256 | (cmpb ($ 11) (% arg_z.b)) ; [715] 257 | (je L724) ; [719] 258 | (movl ($ #x80) (% arg_z.l)) ; [721] 259 | (jmpq L116) ; [726] 260 | L724 261 | (movq (% save0) (% arg_y)) ; [731] 262 | (movq (@ '# (% fn)) (% arg_z)) ; [734] 263 | (movl ($ 16) (% nargs)) ; [741] 264 | (movq (% save1) (% temp0)) ; [746] 265 | (lisp-call (@ 10 (% temp0))) ; [753] 266 | (recover-fn-from-rip) ; [756] 267 | (cmpb ($ 11) (% arg_z.b)) ; [763] 268 | (je L772) ; [767] 269 | (movl ($ #x88) (% arg_z.l)) ; [769] 270 | (jmpq L116) ; [774] 271 | L772 272 | (movq (% save0) (% arg_y)) ; [779] 273 | (movq (@ '# (% fn)) (% arg_z)) ; [782] 274 | (movl ($ 16) (% nargs)) ; [789] 275 | (movq (% save1) (% temp0)) ; [794] 276 | (lisp-call (@ 10 (% temp0))) ; [801] 277 | (recover-fn-from-rip) ; [804] 278 | (cmpb ($ 11) (% arg_z.b)) ; [811] 279 | (je L820) ; [815] 280 | (movl ($ #x90) (% arg_z.l)) ; [817] 281 | (jmpq L116) ; [822] 282 | L820 283 | (movq (% save0) (% arg_y)) ; [827] 284 | (movq (@ '# (% fn)) (% arg_z)) ; [830] 285 | (movl ($ 16) (% nargs)) ; [837] 286 | (movq (% save1) (% temp0)) ; [842] 287 | (lisp-call (@ 10 (% temp0))) ; [849] 288 | (recover-fn-from-rip) ; [852] 289 | (cmpb ($ 11) (% arg_z.b)) ; [859] 290 | (je L868) ; [863] 291 | (movl ($ #x98) (% arg_z.l)) ; [865] 292 | (jmpq L116) ; [870] 293 | L868 294 | (movq (% save0) (% arg_y)) ; [875] 295 | (movq (@ '# (% fn)) (% arg_z)) ; [878] 296 | (movl ($ 16) (% nargs)) ; [885] 297 | (movq (% save1) (% temp0)) ; [890] 298 | (lisp-call (@ 10 (% temp0))) ; [897] 299 | (recover-fn-from-rip) ; [900] 300 | (cmpb ($ 11) (% arg_z.b)) ; [907] 301 | (je L916) ; [911] 302 | (movl ($ #xA0) (% arg_z.l)) ; [913] 303 | (jmpq L116) ; [918] 304 | L916 305 | (movq (% save0) (% arg_y)) ; [923] 306 | (movq (@ '# (% fn)) (% arg_z)) ; [926] 307 | (movl ($ 16) (% nargs)) ; [933] 308 | (movq (% save1) (% temp0)) ; [938] 309 | (lisp-call (@ 10 (% temp0))) ; [945] 310 | (recover-fn-from-rip) ; [948] 311 | (cmpb ($ 11) (% arg_z.b)) ; [955] 312 | (je L964) ; [959] 313 | (movl ($ #xA8) (% arg_z.l)) ; [961] 314 | (jmpq L116) ; [966] 315 | L964 316 | (movq (% save0) (% arg_y)) ; [971] 317 | (movq (@ '# (% fn)) (% arg_z)) ; [974] 318 | (movl ($ 16) (% nargs)) ; [981] 319 | (movq (% save1) (% temp0)) ; [986] 320 | (lisp-call (@ 10 (% temp0))) ; [993] 321 | (recover-fn-from-rip) ; [996] 322 | (cmpb ($ 11) (% arg_z.b)) ; [1003] 323 | (je L1012) ; [1007] 324 | (movl ($ #xB0) (% arg_z.l)) ; [1009] 325 | (jmpq L116) ; [1014] 326 | L1012 327 | (movq (% save0) (% arg_y)) ; [1019] 328 | (movq (@ '# (% fn)) (% arg_z)) ; [1022] 329 | (movl ($ 16) (% nargs)) ; [1029] 330 | (movq (% save1) (% temp0)) ; [1034] 331 | (lisp-call (@ 10 (% temp0))) ; [1041] 332 | (recover-fn-from-rip) ; [1044] 333 | (cmpb ($ 11) (% arg_z.b)) ; [1051] 334 | (je L1060) ; [1055] 335 | (movl ($ #xB8) (% arg_z.l)) ; [1057] 336 | (jmpq L116) ; [1062] 337 | L1060 338 | (movq (% save0) (% arg_y)) ; [1067] 339 | (movq (@ '# (% fn)) (% arg_z)) ; [1070] 340 | (movl ($ 16) (% nargs)) ; [1077] 341 | (movq (% save1) (% temp0)) ; [1082] 342 | (lisp-call (@ 10 (% temp0))) ; [1089] 343 | (recover-fn-from-rip) ; [1092] 344 | (cmpb ($ 11) (% arg_z.b)) ; [1099] 345 | (je L1108) ; [1103] 346 | (movl ($ #xC0) (% arg_z.l)) ; [1105] 347 | (jmpq L116) ; [1110] 348 | L1108 349 | (movq (% save0) (% arg_y)) ; [1115] 350 | (movq (@ '# (% fn)) (% arg_z)) ; [1118] 351 | (movl ($ 16) (% nargs)) ; [1125] 352 | (movq (% save1) (% temp0)) ; [1130] 353 | (lisp-call (@ 10 (% temp0))) ; [1137] 354 | (recover-fn-from-rip) ; [1140] 355 | (cmpb ($ 11) (% arg_z.b)) ; [1147] 356 | (je L1156) ; [1151] 357 | (movl ($ #xC8) (% arg_z.l)) ; [1153] 358 | (jmpq L116) ; [1158] 359 | L1156 360 | (movq (% save0) (% arg_y)) ; [1163] 361 | (movq (@ '# (% fn)) (% arg_z)) ; [1166] 362 | (movl ($ 16) (% nargs)) ; [1173] 363 | (movq (% save1) (% temp0)) ; [1178] 364 | (lisp-call (@ 10 (% temp0))) ; [1185] 365 | (recover-fn-from-rip) ; [1188] 366 | (cmpb ($ 11) (% arg_z.b)) ; [1195] 367 | (je L1204) ; [1199] 368 | (movl ($ #xD0) (% arg_z.l)) ; [1201] 369 | (jmpq L116) ; [1206] 370 | L1204 371 | (movq (% save0) (% arg_y)) ; [1211] 372 | (movq (@ '# (% fn)) (% arg_z)) ; [1214] 373 | (movl ($ 16) (% nargs)) ; [1221] 374 | (movq (% save1) (% temp0)) ; [1226] 375 | (lisp-call (@ 10 (% temp0))) ; [1233] 376 | (recover-fn-from-rip) ; [1236] 377 | (cmpb ($ 11) (% arg_z.b)) ; [1243] 378 | (je L1252) ; [1247] 379 | (movl ($ #xD8) (% arg_z.l)) ; [1249] 380 | (jmpq L116) ; [1254] 381 | L1252 382 | (movq (% save0) (% arg_y)) ; [1259] 383 | (movq (@ '# (% fn)) (% arg_z)) ; [1262] 384 | (movl ($ 16) (% nargs)) ; [1269] 385 | (movq (% save1) (% temp0)) ; [1274] 386 | (lisp-call (@ 10 (% temp0))) ; [1281] 387 | (recover-fn-from-rip) ; [1284] 388 | (cmpb ($ 11) (% arg_z.b)) ; [1291] 389 | (je L1300) ; [1295] 390 | (movl ($ #xE0) (% arg_z.l)) ; [1297] 391 | (jmpq L116) ; [1302] 392 | L1300 393 | (movq (% save0) (% arg_y)) ; [1307] 394 | (movq (@ '# (% fn)) (% arg_z)) ; [1310] 395 | (movl ($ 16) (% nargs)) ; [1317] 396 | (movq (% save1) (% temp0)) ; [1322] 397 | (lisp-call (@ 10 (% temp0))) ; [1329] 398 | (recover-fn-from-rip) ; [1332] 399 | (cmpb ($ 11) (% arg_z.b)) ; [1339] 400 | (je L1348) ; [1343] 401 | (movl ($ #xE8) (% arg_z.l)) ; [1345] 402 | (jmpq L116) ; [1350] 403 | L1348 404 | (movq (% save0) (% arg_y)) ; [1355] 405 | (movq (@ '# (% fn)) (% arg_z)) ; [1358] 406 | (movl ($ 16) (% nargs)) ; [1365] 407 | (movq (% save1) (% temp0)) ; [1370] 408 | (lisp-call (@ 10 (% temp0))) ; [1377] 409 | (recover-fn-from-rip) ; [1380] 410 | (cmpb ($ 11) (% arg_z.b)) ; [1387] 411 | (je L1396) ; [1391] 412 | (movl ($ #xF0) (% arg_z.l)) ; [1393] 413 | (jmpq L116) ; [1398] 414 | L1396 415 | (movq (% save0) (% arg_y)) ; [1403] 416 | (movq (@ '# (% fn)) (% arg_z)) ; [1406] 417 | (movl ($ 16) (% nargs)) ; [1413] 418 | (movq (% save1) (% temp0)) ; [1418] 419 | (lisp-call (@ 10 (% temp0))) ; [1425] 420 | (recover-fn-from-rip) ; [1428] 421 | (cmpb ($ 11) (% arg_z.b)) ; [1435] 422 | (je L1444) ; [1439] 423 | (movl ($ #xF8) (% arg_z.l)) ; [1441] 424 | (jmpq L116) ; [1446] 425 | L1444 426 | (movl ($ #x4E8) (% arg_x.l)) ; [1451] 427 | (movq (% save0) (% arg_y)) ; [1457] 428 | (movq (@ '(OR (SIMPLE-ARRAY BIT) (SIMPLE-ARRAY (UNSIGNED-BYTE 8)) (SIMPLE-ARRAY (UNSIGNED-BYTE 16)) (SIMPLE-ARRAY (UNSIGNED-BYTE 32)) (SIMPLE-ARRAY (UNSIGNED-BYTE 64)) (SIMPLE-ARRAY (SIGNED-BYTE 8)) (SIMPLE-ARRAY (SIGNED-BYTE 16)) (SIMPLE-ARRAY (SIGNED-BYTE 32)) (SIMPLE-ARRAY FIXNUM) (SIMPLE-ARRAY (SIGNED-BYTE 64)) (SIMPLE-ARRAY SINGLE-FLOAT) (SIMPLE-ARRAY DOUBLE-FLOAT) (SIMPLE-ARRAY (COMPLEX SINGLE-FLOAT)) (SIMPLE-ARRAY (COMPLEX DOUBLE-FLOAT)) (SIMPLE-ARRAY BASE-CHAR) (SIMPLE-ARRAY T)) (% fn)) (% arg_z)) ; [1460] 429 | (movl ($ 24) (% nargs)) ; [1467] 430 | (lisp-call (@ .SPKSIGNALERR)) ; [1477] 431 | (recover-fn-from-rip) ; [1484] 432 | (movl ($ #x1300B) (% arg_z.l)) ; [1491] 433 | (jmpq L116) ; [1496] 434 | L1494 435 | (movl (% save0.l) (% imm0.l)) ; [1501] 436 | (andl ($ 7) (% imm0.l)) ; [1504] 437 | (cmpl ($ 5) (% imm0.l)) ; [1507] 438 | (jne L1510) ; [1510] 439 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [1512] 440 | L1510 441 | (imulq ($ 8) (% imm0) (% save2)) ; [1517] 442 | (movl (% save2.l) (% imm0.l)) ; [1521] 443 | (shrl ($ 3) (% imm0.l)) ; [1524] 444 | (andl ($ 15) (% imm0.l)) ; [1527] 445 | (movl ($ 96) (% nargs)) ; [1530] 446 | (btl (% imm0.l) (% nargs)) ; [1535] 447 | (movl ($ 0) (% nargs)) ; [1538] 448 | (movl (% save2.l) (% arg_z.l)) ; [1543] 449 | (cmovael (% nargs) (% arg_z.l)) ; [1546] 450 | (cmpq ($ #x528) (% arg_z)) ; [1549] 451 | (jge L1592) ; [1556] 452 | (movl (% save2.l) (% imm0.l)) ; [1558] 453 | (shrl ($ 3) (% imm0.l)) ; [1561] 454 | (andl ($ 15) (% imm0.l)) ; [1564] 455 | (movl ($ #x680) (% nargs)) ; [1567] 456 | (btl (% imm0.l) (% nargs)) ; [1572] 457 | (movl ($ 0) (% nargs)) ; [1575] 458 | (movl (% save2.l) (% arg_z.l)) ; [1580] 459 | (cmovael (% nargs) (% arg_z.l)) ; [1583] 460 | (cmpq ($ #x4B8) (% arg_z)) ; [1586] 461 | (jl L2406) ; [1593] 462 | L1592 463 | (movq (% save0) (% arg_y)) ; [1599] 464 | (movq (@ '# (% fn)) (% arg_z)) ; [1602] 465 | (movl ($ 16) (% nargs)) ; [1609] 466 | (movq (% save1) (% temp0)) ; [1614] 467 | (lisp-call (@ 10 (% temp0))) ; [1617] 468 | (recover-fn-from-rip) ; [1620] 469 | (cmpb ($ 11) (% arg_z.b)) ; [1627] 470 | (je L1636) ; [1631] 471 | (movl ($ #x100) (% arg_z.l)) ; [1633] 472 | (jmpq L116) ; [1638] 473 | L1636 474 | (movq (% save0) (% arg_y)) ; [1643] 475 | (movq (@ '# (% fn)) (% arg_z)) ; [1646] 476 | (movl ($ 16) (% nargs)) ; [1653] 477 | (movq (% save1) (% temp0)) ; [1658] 478 | (lisp-call (@ 10 (% temp0))) ; [1665] 479 | (recover-fn-from-rip) ; [1668] 480 | (cmpb ($ 11) (% arg_z.b)) ; [1675] 481 | (je L1684) ; [1679] 482 | (movl ($ #x108) (% arg_z.l)) ; [1681] 483 | (jmpq L116) ; [1686] 484 | L1684 485 | (movq (% save0) (% arg_y)) ; [1691] 486 | (movq (@ '# (% fn)) (% arg_z)) ; [1694] 487 | (movl ($ 16) (% nargs)) ; [1701] 488 | (movq (% save1) (% temp0)) ; [1706] 489 | (lisp-call (@ 10 (% temp0))) ; [1713] 490 | (recover-fn-from-rip) ; [1716] 491 | (cmpb ($ 11) (% arg_z.b)) ; [1723] 492 | (je L1732) ; [1727] 493 | (movl ($ #x110) (% arg_z.l)) ; [1729] 494 | (jmpq L116) ; [1734] 495 | L1732 496 | (movq (% save0) (% arg_y)) ; [1739] 497 | (movq (@ '# (% fn)) (% arg_z)) ; [1742] 498 | (movl ($ 16) (% nargs)) ; [1749] 499 | (movq (% save1) (% temp0)) ; [1754] 500 | (lisp-call (@ 10 (% temp0))) ; [1761] 501 | (recover-fn-from-rip) ; [1764] 502 | (cmpb ($ 11) (% arg_z.b)) ; [1771] 503 | (je L1780) ; [1775] 504 | (movl ($ #x118) (% arg_z.l)) ; [1777] 505 | (jmpq L116) ; [1782] 506 | L1780 507 | (movq (% save0) (% arg_y)) ; [1787] 508 | (movq (@ '# (% fn)) (% arg_z)) ; [1790] 509 | (movl ($ 16) (% nargs)) ; [1797] 510 | (movq (% save1) (% temp0)) ; [1802] 511 | (lisp-call (@ 10 (% temp0))) ; [1809] 512 | (recover-fn-from-rip) ; [1812] 513 | (cmpb ($ 11) (% arg_z.b)) ; [1819] 514 | (je L1828) ; [1823] 515 | (movl ($ #x120) (% arg_z.l)) ; [1825] 516 | (jmpq L116) ; [1830] 517 | L1828 518 | (movq (% save0) (% arg_y)) ; [1835] 519 | (movq (@ '# (% fn)) (% arg_z)) ; [1838] 520 | (movl ($ 16) (% nargs)) ; [1845] 521 | (movq (% save1) (% temp0)) ; [1850] 522 | (lisp-call (@ 10 (% temp0))) ; [1857] 523 | (recover-fn-from-rip) ; [1860] 524 | (cmpb ($ 11) (% arg_z.b)) ; [1867] 525 | (je L1876) ; [1871] 526 | (movl ($ #x128) (% arg_z.l)) ; [1873] 527 | (jmpq L116) ; [1878] 528 | L1876 529 | (movq (% save0) (% arg_y)) ; [1883] 530 | (movq (@ '# (% fn)) (% arg_z)) ; [1886] 531 | (movl ($ 16) (% nargs)) ; [1893] 532 | (movq (% save1) (% temp0)) ; [1898] 533 | (lisp-call (@ 10 (% temp0))) ; [1905] 534 | (recover-fn-from-rip) ; [1908] 535 | (cmpb ($ 11) (% arg_z.b)) ; [1915] 536 | (je L1924) ; [1919] 537 | (movl ($ #x130) (% arg_z.l)) ; [1921] 538 | (jmpq L116) ; [1926] 539 | L1924 540 | (movq (% save0) (% arg_y)) ; [1931] 541 | (movq (@ '# (% fn)) (% arg_z)) ; [1934] 542 | (movl ($ 16) (% nargs)) ; [1941] 543 | (movq (% save1) (% temp0)) ; [1946] 544 | (lisp-call (@ 10 (% temp0))) ; [1953] 545 | (recover-fn-from-rip) ; [1956] 546 | (cmpb ($ 11) (% arg_z.b)) ; [1963] 547 | (je L1972) ; [1967] 548 | (movl ($ #x138) (% arg_z.l)) ; [1969] 549 | (jmpq L116) ; [1974] 550 | L1972 551 | (movq (% save0) (% arg_y)) ; [1979] 552 | (movq (@ '# (% fn)) (% arg_z)) ; [1982] 553 | (movl ($ 16) (% nargs)) ; [1989] 554 | (movq (% save1) (% temp0)) ; [1994] 555 | (lisp-call (@ 10 (% temp0))) ; [2001] 556 | (recover-fn-from-rip) ; [2004] 557 | (cmpb ($ 11) (% arg_z.b)) ; [2011] 558 | (je L2020) ; [2015] 559 | (movl ($ #x140) (% arg_z.l)) ; [2017] 560 | (jmpq L116) ; [2022] 561 | L2020 562 | (movq (% save0) (% arg_y)) ; [2027] 563 | (movq (@ '# (% fn)) (% arg_z)) ; [2030] 564 | (movl ($ 16) (% nargs)) ; [2037] 565 | (movq (% save1) (% temp0)) ; [2042] 566 | (lisp-call (@ 10 (% temp0))) ; [2049] 567 | (recover-fn-from-rip) ; [2052] 568 | (cmpb ($ 11) (% arg_z.b)) ; [2059] 569 | (je L2068) ; [2063] 570 | (movl ($ #x148) (% arg_z.l)) ; [2065] 571 | (jmpq L116) ; [2070] 572 | L2068 573 | (movq (% save0) (% arg_y)) ; [2075] 574 | (movq (@ '# (% fn)) (% arg_z)) ; [2078] 575 | (movl ($ 16) (% nargs)) ; [2085] 576 | (movq (% save1) (% temp0)) ; [2090] 577 | (lisp-call (@ 10 (% temp0))) ; [2097] 578 | (recover-fn-from-rip) ; [2100] 579 | (cmpb ($ 11) (% arg_z.b)) ; [2107] 580 | (je L2116) ; [2111] 581 | (movl ($ #x150) (% arg_z.l)) ; [2113] 582 | (jmpq L116) ; [2118] 583 | L2116 584 | (movq (% save0) (% arg_y)) ; [2123] 585 | (movq (@ '# (% fn)) (% arg_z)) ; [2126] 586 | (movl ($ 16) (% nargs)) ; [2133] 587 | (movq (% save1) (% temp0)) ; [2138] 588 | (lisp-call (@ 10 (% temp0))) ; [2145] 589 | (recover-fn-from-rip) ; [2148] 590 | (cmpb ($ 11) (% arg_z.b)) ; [2155] 591 | (je L2164) ; [2159] 592 | (movl ($ #x158) (% arg_z.l)) ; [2161] 593 | (jmpq L116) ; [2166] 594 | L2164 595 | (movq (% save0) (% arg_y)) ; [2171] 596 | (movq (@ '# (% fn)) (% arg_z)) ; [2174] 597 | (movl ($ 16) (% nargs)) ; [2181] 598 | (movq (% save1) (% temp0)) ; [2186] 599 | (lisp-call (@ 10 (% temp0))) ; [2193] 600 | (recover-fn-from-rip) ; [2196] 601 | (cmpb ($ 11) (% arg_z.b)) ; [2203] 602 | (je L2212) ; [2207] 603 | (movl ($ #x160) (% arg_z.l)) ; [2209] 604 | (jmpq L116) ; [2214] 605 | L2212 606 | (movq (% save0) (% arg_y)) ; [2219] 607 | (movq (@ '# (% fn)) (% arg_z)) ; [2222] 608 | (movl ($ 16) (% nargs)) ; [2229] 609 | (movq (% save1) (% temp0)) ; [2234] 610 | (lisp-call (@ 10 (% temp0))) ; [2241] 611 | (recover-fn-from-rip) ; [2244] 612 | (cmpb ($ 11) (% arg_z.b)) ; [2251] 613 | (je L2260) ; [2255] 614 | (movl ($ #x168) (% arg_z.l)) ; [2257] 615 | (jmpq L116) ; [2262] 616 | L2260 617 | (movq (% save0) (% arg_y)) ; [2267] 618 | (movq (@ '# (% fn)) (% arg_z)) ; [2270] 619 | (movl ($ 16) (% nargs)) ; [2277] 620 | (movq (% save1) (% temp0)) ; [2282] 621 | (lisp-call (@ 10 (% temp0))) ; [2289] 622 | (recover-fn-from-rip) ; [2292] 623 | (cmpb ($ 11) (% arg_z.b)) ; [2299] 624 | (je L2308) ; [2303] 625 | (movl ($ #x170) (% arg_z.l)) ; [2305] 626 | (jmpq L116) ; [2310] 627 | L2308 628 | (movq (% save0) (% arg_y)) ; [2315] 629 | (movq (@ '# (% fn)) (% arg_z)) ; [2318] 630 | (movl ($ 16) (% nargs)) ; [2325] 631 | (movq (% save1) (% temp0)) ; [2330] 632 | (lisp-call (@ 10 (% temp0))) ; [2337] 633 | (recover-fn-from-rip) ; [2340] 634 | (cmpb ($ 11) (% arg_z.b)) ; [2347] 635 | (je L2356) ; [2351] 636 | (movl ($ #x178) (% arg_z.l)) ; [2353] 637 | (jmpq L116) ; [2358] 638 | L2356 639 | (movl ($ #x4E8) (% arg_x.l)) ; [2363] 640 | (movq (% save0) (% arg_y)) ; [2369] 641 | (movq (@ '(OR (ARRAY BIT) (ARRAY (UNSIGNED-BYTE 8)) (ARRAY (UNSIGNED-BYTE 16)) (ARRAY (UNSIGNED-BYTE 32)) (ARRAY (UNSIGNED-BYTE 64)) (ARRAY (SIGNED-BYTE 8)) (ARRAY (SIGNED-BYTE 16)) (ARRAY (SIGNED-BYTE 32)) (ARRAY FIXNUM) (ARRAY (SIGNED-BYTE 64)) (ARRAY SINGLE-FLOAT) (ARRAY DOUBLE-FLOAT) (ARRAY (COMPLEX SINGLE-FLOAT)) (ARRAY (COMPLEX DOUBLE-FLOAT)) (ARRAY BASE-CHAR) (ARRAY T)) (% fn)) (% arg_z)) ; [2372] 642 | (movl ($ 24) (% nargs)) ; [2379] 643 | (lisp-call (@ .SPKSIGNALERR)) ; [2389] 644 | (recover-fn-from-rip) ; [2396] 645 | (movl ($ #x1300B) (% arg_z.l)) ; [2403] 646 | (jmpq L116) ; [2408] 647 | L2406 648 | (testb ($ 7) (% save0.b)) ; [2413] 649 | (jne L2422) ; [2417] 650 | (movl ($ #x180) (% arg_z.l)) ; [2419] 651 | (jmpq L116) ; [2424] 652 | L2422 653 | (movl (% save0.l) (% imm0.l)) ; [2429] 654 | (andl ($ 7) (% imm0.l)) ; [2432] 655 | (cmpl ($ 5) (% imm0.l)) ; [2435] 656 | (jne L2438) ; [2438] 657 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2440] 658 | L2438 659 | (cmpb ($ 25) (% imm0.b)) ; [2445] 660 | (jne L2453) ; [2448] 661 | (movl ($ #x188) (% arg_z.l)) ; [2450] 662 | (jmpq L116) ; [2455] 663 | L2453 664 | (movl (% save0.l) (% imm0.l)) ; [2460] 665 | (andl ($ 7) (% imm0.l)) ; [2463] 666 | (cmpl ($ 5) (% imm0.l)) ; [2466] 667 | (jne L2469) ; [2469] 668 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2471] 669 | L2469 670 | (cmpb ($ 22) (% imm0.b)) ; [2476] 671 | (jne L2484) ; [2479] 672 | (movl ($ #x190) (% arg_z.l)) ; [2481] 673 | (jmpq L116) ; [2486] 674 | L2484 675 | (movl (% save0.l) (% imm0.l)) ; [2491] 676 | (andl ($ 15) (% imm0.l)) ; [2494] 677 | (cmpb ($ 1) (% imm0.b)) ; [2497] 678 | (jne L2505) ; [2500] 679 | (movl ($ #x198) (% arg_z.l)) ; [2502] 680 | (jmpq L116) ; [2507] 681 | L2505 682 | (movl (% save0.l) (% imm0.l)) ; [2512] 683 | (andl ($ 7) (% imm0.l)) ; [2515] 684 | (cmpl ($ 5) (% imm0.l)) ; [2518] 685 | (jne L2521) ; [2521] 686 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2523] 687 | L2521 688 | (cmpb ($ 41) (% imm0.b)) ; [2528] 689 | (jne L2536) ; [2531] 690 | (movl ($ #x1A0) (% arg_z.l)) ; [2533] 691 | (jmpq L116) ; [2538] 692 | L2536 693 | (movq (% save0) (% arg_y)) ; [2543] 694 | (movq (@ '# (% fn)) (% arg_z)) ; [2546] 695 | (movl ($ 16) (% nargs)) ; [2553] 696 | (movq (@ 'CCL::NUMERIC-%%TYPEP (% fn)) (% temp0)) ; [2558] 697 | (lisp-call (@ 10 (% temp0))) ; [2569] 698 | (recover-fn-from-rip) ; [2572] 699 | (cmpb ($ 11) (% arg_z.b)) ; [2579] 700 | (je L2588) ; [2583] 701 | (movl ($ #x1A8) (% arg_z.l)) ; [2585] 702 | (jmpq L116) ; [2590] 703 | L2588 704 | (movq (% save0) (% arg_y)) ; [2595] 705 | (movq (@ '# (% fn)) (% arg_z)) ; [2598] 706 | (movl ($ 16) (% nargs)) ; [2605] 707 | (movq (@ 'CCL::NUMERIC-%%TYPEP (% fn)) (% temp0)) ; [2610] 708 | (lisp-call (@ 10 (% temp0))) ; [2617] 709 | (recover-fn-from-rip) ; [2620] 710 | (cmpb ($ 11) (% arg_z.b)) ; [2627] 711 | (je L2636) ; [2631] 712 | (movl ($ #x1B0) (% arg_z.l)) ; [2633] 713 | (jmpq L116) ; [2638] 714 | L2636 715 | (movl (% save0.l) (% imm0.l)) ; [2643] 716 | (andl ($ 7) (% imm0.l)) ; [2646] 717 | (cmpl ($ 5) (% imm0.l)) ; [2649] 718 | (jne L2652) ; [2652] 719 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2654] 720 | L2652 721 | (imulq ($ 8) (% imm0) (% save2)) ; [2659] 722 | (cmpq ($ #x130) (% save2)) ; [2663] 723 | (je L2683) ; [2670] 724 | (cmpq ($ #x248) (% save2)) ; [2672] 725 | (je L2683) ; [2679] 726 | (cmpq ($ #x2C8) (% save2)) ; [2681] 727 | (jne L2693) ; [2688] 728 | L2683 729 | (movl ($ #x1B8) (% arg_z.l)) ; [2690] 730 | (jmpq L116) ; [2695] 731 | L2693 732 | (movzbl (% save0.b) (% imm0.l)) ; [2700] 733 | (cmpq ($ 2) (% imm0)) ; [2704] 734 | (jne L2713) ; [2708] 735 | (movl ($ #x1C0) (% arg_z.l)) ; [2710] 736 | (jmpq L116) ; [2715] 737 | L2713 738 | (movl (% save0.l) (% imm0.l)) ; [2720] 739 | (andl ($ 15) (% imm0.l)) ; [2723] 740 | (cmpb ($ 15) (% imm0.b)) ; [2726] 741 | (jne L2734) ; [2729] 742 | (movl ($ #x1D0) (% arg_z.l)) ; [2731] 743 | (jmpq L116) ; [2736] 744 | L2734 745 | (movl (% save0.l) (% imm0.l)) ; [2741] 746 | (andl ($ 15) (% imm0.l)) ; [2744] 747 | (cmpb ($ 3) (% imm0.b)) ; [2747] 748 | (jne L2755) ; [2750] 749 | (movl ($ #x1D8) (% arg_z.l)) ; [2752] 750 | (jmpq L116) ; [2757] 751 | L2755 752 | (cmpb ($ 11) (% save0.b)) ; [2762] 753 | (je L2774) ; [2766] 754 | (movl (% save0.l) (% imm0.l)) ; [2768] 755 | (andl ($ 15) (% imm0.l)) ; [2771] 756 | (cmpb ($ 14) (% imm0.b)) ; [2774] 757 | (je L2774) ; [2777] 758 | (jmp L2784) ; [2779] 759 | L2774 760 | (movl ($ #x1E0) (% arg_z.l)) ; [2781] 761 | (jmpq L116) ; [2786] 762 | L2784 763 | (movl (% save0.l) (% imm0.l)) ; [2791] 764 | (andl ($ 7) (% imm0.l)) ; [2794] 765 | (cmpl ($ 5) (% imm0.l)) ; [2797] 766 | (jne L2800) ; [2800] 767 | (movzbl (@ -13 (% save0)) (% imm0.l)) ; [2802] 768 | L2800 769 | (cmpb ($ 54) (% imm0.b)) ; [2807] 770 | (jne L2815) ; [2810] 771 | (movl ($ #x1E8) (% arg_z.l)) ; [2812] 772 | (jmpq L116) ; [2817] 773 | L2815 774 | (movq (% save0) (% arg_y)) ; [2822] 775 | (movq (@ '# (% fn)) (% arg_z)) ; [2825] 776 | (movl ($ 16) (% nargs)) ; [2832] 777 | (movq (@ 'CCL::CLASS-CELL-TYPEP (% fn)) (% temp0)) ; [2837] 778 | (lisp-call (@ 10 (% temp0))) ; [2849] 779 | (recover-fn-from-rip) ; [2852] 780 | (cmpb ($ 11) (% arg_z.b)) ; [2859] 781 | (je L2868) ; [2863] 782 | (movl ($ #x1F0) (% arg_z.l)) ; [2865] 783 | (jmpq L116) ; [2870] 784 | L2868 785 | (movl ($ #x1F8) (% arg_z.l)) ; [2875] 786 | (jmpq L116) ; [2880] 787 | L2933 788 | (uuo-error-wrong-number-of-args) ; [2940] 789 | -------------------------------------------------------------------------------- /benchmark/run.ros: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #|-*- mode:lisp -*-|# 3 | #| 4 | exec ros -Q -- $0 "$@" 5 | |# 6 | (progn ;;init forms 7 | (ros:ensure-asdf) 8 | #+quicklisp(ql:quickload '(specialized-function) :silent t) 9 | ) 10 | 11 | (defpackage :ros.script.run.3769305419 12 | (:use :cl)) 13 | (in-package :ros.script.run.3769305419) 14 | 15 | (defun main (&rest argv) 16 | (declare (ignorable argv)) 17 | (format t "~%~@{~a~^~%~}" 18 | (machine-type) 19 | (machine-version) 20 | (machine-instance) 21 | (software-type) 22 | (software-version) 23 | (lisp-implementation-type) 24 | (lisp-implementation-version)) 25 | (specialized-function::benchmark) 26 | (disassemble #'specialized-function::widetag)) 27 | ;;; vim: set ft=lisp lisp: 28 | -------------------------------------------------------------------------------- /benchmark/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "note: SBCL does x100 more loops" 4 | 5 | ros -L sbcl run.ros &> $(git rev-parse HEAD).sbcl.log & 6 | ros -L ccl-bin run.ros &> $(git rev-parse HEAD).ccl.log & 7 | wait 8 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | environment: 3 | PATH: ~/.roswell/bin:$PATH 4 | 5 | dependencies: 6 | pre: 7 | - curl -L https://raw.githubusercontent.com/snmsts/roswell/master/scripts/install-for-ci.sh | sh 8 | - ros install ccl-bin 9 | cache_directories: 10 | - ~/.roswell/ 11 | 12 | test: 13 | override: 14 | - ros -L sbcl-bin testscr.ros 15 | - ros -L ccl-bin testscr.ros 16 | -------------------------------------------------------------------------------- /demo.lisp: -------------------------------------------------------------------------------- 1 | 2 | (in-package :specialized-function) 3 | 4 | (declaim (inline dot-original dot-specialized dot-handtuned)) 5 | 6 | ;; untyped version 7 | (defun dot-original (a b c) 8 | (declare (optimize (speed 3) (safety 0) (debug 0))) 9 | (loop 10 | for ai across a 11 | for bi across b 12 | for i fixnum from 0 13 | do (incf c (* ai bi))) 14 | c) 15 | 16 | ;; specialized-function 17 | (defun dot-specialized (a b c) 18 | (specializing (a b c) (:verbose t) 19 | (declare (optimize (speed 3) (safety 0) (debug 0))) 20 | (loop 21 | for ai across a 22 | for bi across b 23 | for i fixnum from 0 24 | do (incf c (* ai bi))) 25 | c)) 26 | 27 | ;; hand-tuned : does not have the dispatch overhead 28 | (defun dot-handtuned (a b c) 29 | (declare (optimize (speed 3) (safety 0) (debug 0)) 30 | ((simple-array single-float 1) a b) 31 | (single-float c)) 32 | (loop 33 | for ai across a 34 | for bi across b 35 | for i fixnum from 0 36 | do (incf c (* ai bi))) 37 | c) 38 | 39 | (defun gc () 40 | #+sbcl 41 | (sb-ext:gc) 42 | #+ccl 43 | (ccl:gc) 44 | #+ecl 45 | (si:gc)) 46 | 47 | (defun benchmark () 48 | (let ((a (make-array 100000 :element-type 'single-float :initial-element 2.0)) 49 | (b (make-array 100000 :element-type 'single-float :initial-element 2.0))) 50 | ;; iterate over 10000 element arrays 51 | (format t "~%~@{~a~^~%~}" 52 | (machine-type) 53 | (machine-version) 54 | (machine-instance) 55 | (software-type) 56 | (software-version) 57 | (lisp-implementation-type) 58 | (lisp-implementation-version)) 59 | (gc) 60 | (time (dot-original a b 0.0)) 61 | (gc) 62 | (time (loop repeat 1000 do (dot-original a b 0.0))) 63 | (format t ";; Super slow!!! untyped version") 64 | (format t "~%;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;") 65 | (gc) 66 | (time (dot-specialized a b 0.0)) 67 | (format t ";; ^^^^^^^^^^^ The first invocation is slow due to compilation~%") 68 | (gc) 69 | (time (dot-specialized a b 0.0)) 70 | (format t ";; ^^^^^^^^^^^ The second+ invocations are fast~%") 71 | (gc) 72 | ;; dispatch happens 1000 times 73 | (time (loop repeat 1000 do (dot-specialized a b 0.0))) 74 | (format t "~%;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;") 75 | (gc) 76 | (time (dot-handtuned a b 0.0)) 77 | (gc) 78 | (time (loop repeat 1000 do (dot-handtuned a b 0.0))) 79 | (format t "~%;; ^^^^^^^^^^^ The difference is negligeble --- dispatch overhead is small enough!~%"))) 80 | 81 | (benchmark) 82 | 83 | 84 | (format t "~%;; can see the last function that was compiled") 85 | (disassemble 'last-specialized-function) 86 | ;; Size: 192 bytes 87 | 88 | (format t "~%;; The code is almost identical, achieving the same performance") 89 | (disassemble 'dot-handtuned) 90 | ;; Size: 196 bytes 91 | 92 | -------------------------------------------------------------------------------- /example.lisp: -------------------------------------------------------------------------------- 1 | 2 | (in-package :specialized-function) 3 | 4 | (defun *2 (x) 5 | (specializing (x) (:verbose t) 6 | (* 2 x))) 7 | 8 | (print (*2 5)) 9 | (print (*2 5)) 10 | (print (*2 5.0)) 11 | (print (*2 5.0d0)) 12 | 13 | 14 | (defun add (x y) 15 | (specializing (x y) (:verbose t) 16 | (+ x y))) 17 | 18 | (print (add 2 5)) 19 | (print (add 2 5.0)) 20 | (print (add 2.0 5.0)) 21 | (print (add 2.0d0 5.0)) 22 | (print (add 2.0d0 5.0d0)) 23 | 24 | (defun addp (a x y) 25 | (specializing (x y) (:verbose t) 26 | (print a) 27 | (+ x y))) 28 | 29 | (print (addp "a" 2 5)) 30 | (print (addp "a" 2 5.0)) 31 | (print (addp "a" 2.0 5.0)) 32 | (print (addp "a" 2.0d0 5.0)) 33 | (print (addp "a" 2.0d0 5.0d0)) 34 | 35 | ;; bad example, sum could be out of fixnum range for fixnum, ended up calling generic-+ 36 | (defun sum (a) 37 | (specializing (a) (:verbose t) 38 | (declare (optimize (speed 3))) 39 | (let ((sum (aref a 0))) 40 | (loop for i from 1 below (length a) 41 | do (incf sum (aref a i))) 42 | sum))) 43 | 44 | ;; (disassemble #'last-specialized-function) 45 | 46 | ;; better example, sum is specialized; when sum gets out of fixnum range, 47 | ;; it becomes a runtime error 48 | (defun sum (a) 49 | (let ((sum (aref a 0))) 50 | (specializing (a sum) (:verbose t) 51 | (declare (optimize (speed 3))) 52 | (loop for i from 1 below (length a) 53 | do (incf sum (aref a i))) 54 | sum))) 55 | 56 | ;; (disassemble #'last-specialized-function) 57 | 58 | ;; There is no way to tell the compiler that the type of SUM is same as the type of the array! 59 | ;; To truly solve this issue, you need the ability to derive the type of a variable from another variable. 60 | ;; This is not available within common lisp, but if you hack LET/LET* it is possible. 61 | ;; See https://github.com/numcl/numcl/blob/master/src/0specialops.lisp 62 | 63 | (print (sum #(1 1 1))) 64 | (print (sum (make-array 1000 :element-type 'fixnum :initial-element 1))) 65 | (print (sum (make-array 1000 :element-type 'single-float :initial-element 1.0))) 66 | (print (sum (make-array 1000 :element-type 'double-float :initial-element 1.0d0))) 67 | 68 | ;; (disassemble #'last-specialized-function) 69 | 70 | (defun dot-original (a b c) 71 | (declare (optimize (speed 3) (safety 0) (debug 0))) 72 | (loop 73 | for ai across a 74 | for bi across b 75 | for i fixnum from 0 76 | do (incf c (* ai bi))) 77 | c) 78 | 79 | (defun dot-specialized (a b c) 80 | (specializing (a b c) (:verbose t) 81 | (declare (optimize (speed 3) (safety 0) (debug 0))) 82 | (loop 83 | for ai across a 84 | for bi across b 85 | for i fixnum from 0 86 | do (incf c (* ai bi))) 87 | c)) 88 | 89 | ;; does not have the dispatch overhead 90 | (defun dot-handtuned (a b c) 91 | (declare (optimize (speed 3) (safety 0) (debug 0)) 92 | ((simple-array single-float 1) a b) 93 | (single-float c)) 94 | (loop 95 | for ai across a 96 | for bi across b 97 | for i fixnum from 0 98 | do (incf c (* ai bi))) 99 | c) 100 | 101 | (defun gc () 102 | #+sbcl 103 | (sb-ext:gc) 104 | #+ccl 105 | (ccl:gc)) 106 | 107 | (defun benchmark () 108 | (let ((a (make-array 100000 :element-type 'single-float :initial-element 2.0)) 109 | (b (make-array 100000 :element-type 'single-float :initial-element 2.0))) 110 | (format t "~%~@{~a~^~%~}" 111 | (machine-type) 112 | (machine-version) 113 | (machine-instance) 114 | (software-type) 115 | (software-version) 116 | (lisp-implementation-type) 117 | (lisp-implementation-version)) 118 | (gc) 119 | (time (dot-original a b 0.0)) 120 | (gc) 121 | (time (dot-original a b 0.0)) 122 | (gc) 123 | (time (loop repeat 1000 do (dot-original a b 0.0))) 124 | (format t ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;") 125 | (gc) 126 | (time (dot-specialized a b 0.0)) 127 | (gc) 128 | (time (dot-specialized a b 0.0)) 129 | (gc) 130 | (time (loop repeat 1000 do (dot-specialized a b 0.0))) 131 | (format t ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;") 132 | (gc) 133 | (time (dot-handtuned a b 0.0)) 134 | (gc) 135 | (time (dot-handtuned a b 0.0)) 136 | (gc) 137 | (time (loop repeat 1000 do (dot-handtuned a b 0.0))))) 138 | 139 | (benchmark) 140 | 141 | #| 142 | Example statistics on: 143 | 144 | X86-64 145 | Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz 146 | masataro-ThinkPad-T460 147 | Linux 148 | 4.4.0-146-generic 149 | SBCL 150 | 1.5.2 151 | 152 | Evaluation took: 153 | 0.003 seconds of real time 154 | 0.000000 seconds of total run time (0.000000 user, 0.000000 system) 155 | 0.00% CPU 156 | 6,966,642 processor cycles 157 | 0 bytes consed 158 | 159 | Evaluation took: 160 | 0.003 seconds of real time 161 | 0.004000 seconds of total run time (0.004000 user, 0.000000 system) 162 | 133.33% CPU 163 | 5,979,642 processor cycles 164 | 0 bytes consed 165 | 166 | Evaluation took: 167 | 1.832 seconds of real time 168 | 1.832000 seconds of total run time (1.832000 user, 0.000000 system) 169 | 100.00% CPU 170 | 4,574,515,126 processor cycles 171 | 0 bytes consed 172 | 173 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 174 | ; Specializing (A B C) to (SIMPLE-ARRAY SINGLE-FLOAT 1) (SIMPLE-ARRAY 175 | ; SINGLE-FLOAT 176 | ; 1) SHORT-FLOAT 177 | Evaluation took: 178 | 0.003 seconds of real time 179 | 0.004000 seconds of total run time (0.004000 user, 0.000000 system) 180 | 133.33% CPU 181 | 21 lambdas converted 182 | 7,954,610 processor cycles 183 | 654,304 bytes consed 184 | 185 | Evaluation took: 186 | 0.000 seconds of real time 187 | 0.000000 seconds of total run time (0.000000 user, 0.000000 system) 188 | 100.00% CPU 189 | 529,310 processor cycles 190 | 0 bytes consed 191 | 192 | Evaluation took: 193 | 0.208 seconds of real time 194 | 0.212000 seconds of total run time (0.212000 user, 0.000000 system) 195 | 101.92% CPU 196 | 518,996,152 processor cycles 197 | 0 bytes consed 198 | 199 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 200 | Evaluation took: 201 | 0.000 seconds of real time 202 | 0.000000 seconds of total run time (0.000000 user, 0.000000 system) 203 | 100.00% CPU 204 | 435,056 processor cycles 205 | 0 bytes consed 206 | 207 | Evaluation took: 208 | 0.000 seconds of real time 209 | 0.000000 seconds of total run time (0.000000 user, 0.000000 system) 210 | 100.00% CPU 211 | 575,544 processor cycles 212 | 0 bytes consed 213 | 214 | Evaluation took: 215 | 0.205 seconds of real time 216 | 0.204000 seconds of total run time (0.204000 user, 0.000000 system) 217 | 99.51% CPU 218 | 511,326,866 processor cycles 219 | 0 bytes consed 220 | 221 | |# 222 | 223 | ;; Example : type information outside specializing macro is propagated appropriately 224 | 225 | (defun test-lexical-typedecl () 226 | (let ((c -1) 227 | (a (make-array 15 :element-type 'fixnum))) 228 | (declare (fixnum c)) 229 | (specializing (a) () 230 | (dotimes (i 15) 231 | (setf (aref a i) (incf c)))) 232 | a)) 233 | 234 | (print (test-lexical-typedecl)) 235 | 236 | (disassemble #'last-specialized-function) 237 | 238 | ;; before adding the lexical information : 239 | 240 | ; disassembly for (LAMBDA (A C)) 241 | ; Size: 98 bytes. Origin: #x5331CCBE ; (LAMBDA (A C)) 242 | ; CBE: 498B5D10 MOV RBX, [R13+16] ; thread.binding-stack-pointer 243 | ; CC2: 48895DF8 MOV [RBP-8], RBX 244 | ; CC6: 31DB XOR EBX, EBX 245 | ; CC8: EB3B JMP L1 246 | ; CCA: 660F1F440000 NOP 247 | ; CD0: L0: 48895DE8 MOV [RBP-24], RBX 248 | ; CD4: BF02000000 MOV EDI, 2 249 | ; CD9: 488BD6 MOV RDX, RSI 250 | ; CDC: FF1425B0001052 CALL QWORD PTR [#x521000B0] ; GENERIC-+ 251 | ; CE3: 488B5DE8 MOV RBX, [RBP-24] 252 | ; CE7: 4C8B4DF0 MOV R9, [RBP-16] 253 | ; CEB: 488BF2 MOV RSI, RDX 254 | ; CEE: F6C201 TEST DL, 1 255 | ; CF1: 7523 JNE L2 256 | ; CF3: 4D8B41F9 MOV R8, [R9-7] 257 | ; CF7: 4939D8 CMP R8, RBX 258 | ; CFA: 761F JBE L3 259 | ; CFC: 4989549901 MOV [R9+RBX*4+1], RDX 260 | ; D01: 4883C302 ADD RBX, 2 261 | ; D05: L1: 4883FB1E CMP RBX, 30 262 | ; D09: 7CC5 JL L0 263 | ; D0B: BA17001050 MOV EDX, #x50100017 ; NIL 264 | ; D10: 488BE5 MOV RSP, RBP 265 | ; D13: F8 CLC 266 | ; D14: 5D POP RBP 267 | ; D15: C3 RET 268 | ; D16: L2: CC47 BREAK 71 ; OBJECT-NOT-FIXNUM-ERROR 269 | ; D18: 08 BYTE #X08 ; RDX 270 | ; D19: CC0F BREAK 15 ; Invalid argument count trap 271 | ; D1B: L3: CC1E BREAK 30 ; INVALID-ARRAY-INDEX-ERROR 272 | ; D1D: 24 BYTE #X24 ; R9 273 | ; D1E: 21 BYTE #X21 ; R8 274 | ; D1F: 0D BYTE #X0D ; RBX 275 | 276 | ;; after adding the lexical information : 277 | 278 | ; disassembly for (LAMBDA (A C)) 279 | ; Size: 82 bytes. Origin: #x53315252 ; (LAMBDA (A C)) 280 | ; 52: 498B4510 MOV RAX, [R13+16] ; thread.binding-stack-pointer 281 | ; 56: 488945F8 MOV [RBP-8], RAX 282 | ; 5A: 31DB XOR EBX, EBX 283 | ; 5C: EB2B JMP L1 284 | ; 5E: 6690 NOP 285 | ; 60: L0: 498BF1 MOV RSI, R9 286 | ; 63: 48D1FE SAR RSI, 1 287 | ; 66: 48FFC6 INC RSI 288 | ; 69: 488BC6 MOV RAX, RSI 289 | ; 6C: 48D1E0 SHL RAX, 1 290 | ; 6F: 7029 JO L2 291 | ; 71: 48D1E6 SHL RSI, 1 292 | ; 74: 4C8BCE MOV R9, RSI 293 | ; 77: 498B40F9 MOV RAX, [R8-7] 294 | ; 7B: 4839D8 CMP RAX, RBX 295 | ; 7E: 761F JBE L3 296 | ; 80: 4989749801 MOV [R8+RBX*4+1], RSI 297 | ; 85: 4883C302 ADD RBX, 2 298 | ; 89: L1: 4883FB1E CMP RBX, 30 299 | ; 8D: 7CD1 JL L0 300 | ; 8F: BA17001050 MOV EDX, #x50100017 ; NIL 301 | ; 94: 488BE5 MOV RSP, RBP 302 | ; 97: F8 CLC 303 | ; 98: 5D POP RBP 304 | ; 99: C3 RET 305 | ; 9A: L2: CC47 BREAK 71 ; OBJECT-NOT-FIXNUM-ERROR 306 | ; 9C: 1A BYTE #X1A ; RSI 307 | ; 9D: CC0F BREAK 15 ; Invalid argument count trap 308 | ; 9F: L3: CC1E BREAK 30 ; INVALID-ARRAY-INDEX-ERROR 309 | ; A1: 20 BYTE #X20 ; R8 310 | ; A2: 01 BYTE #X01 ; RAX 311 | ; A3: 0D BYTE #X0D ; RBX 312 | -------------------------------------------------------------------------------- /legal/COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /legal/COPYING.LESSER: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /legal/DCO1.1.txt: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /specialized-function.asd: -------------------------------------------------------------------------------- 1 | 2 | (defsystem specialized-function 3 | :version "0.1" 4 | :author "Masataro Asai" 5 | :mailto "guicho2.71828@gmail.com" 6 | :license "LGPL" 7 | :defsystem-depends-on () 8 | :depends-on (:trivia :alexandria :iterate :lisp-namespace :type-r :trivial-cltl2) 9 | :pathname "src" 10 | :components ((:file "0package") 11 | (:file "1common") 12 | (:file "2find-lexical-variables")) 13 | :description "Provides a Julia-like function that automatically compiles a type-specific version of the function from the same code" 14 | :in-order-to ((test-op (test-op :specialized-function.test))) 15 | ;; :defsystem-depends-on (:trivial-package-manager) 16 | ;; :perform 17 | #+(or) 18 | (load-op :before (op c) 19 | (uiop:symbol-call :trivial-package-manager 20 | :ensure-program 21 | "minisat" 22 | :apt "minisat" 23 | :dnf "minisat2" 24 | :yum "minisat2" 25 | :packman "" 26 | :yaourt "" 27 | :brew "minisat" 28 | :choco "" 29 | :from-source (format nil "make -C ~a" 30 | (asdf:system-source-directory :specialized-function))) 31 | (uiop:symbol-call :trivial-package-manager 32 | :ensure-library 33 | "libfixposix" 34 | :apt "libfixposix0" 35 | :dnf "" 36 | :yum "" 37 | :packman "" 38 | :yaourt "" 39 | :brew "libfixposix" 40 | :choco "" 41 | :from-source (format nil "make -C ~a" 42 | (asdf:system-source-directory :specialized-function))))) 43 | -------------------------------------------------------------------------------- /specialized-function.test.asd: -------------------------------------------------------------------------------- 1 | #| 2 | This file is a part of specialized-function project. 3 | Copyright (c) 2019 Masataro Asai (guicho2.71828@gmail.com) 4 | |# 5 | 6 | 7 | (in-package :cl-user) 8 | (defpackage specialized-function.test-asd 9 | (:use :cl :asdf)) 10 | (in-package :specialized-function.test-asd) 11 | 12 | 13 | (defsystem specialized-function.test 14 | :author "Masataro Asai" 15 | :mailto "guicho2.71828@gmail.com" 16 | :description "Test system of specialized-function" 17 | :license "LGPL" 18 | :depends-on (:specialized-function 19 | :fiveam) 20 | :components ((:module "t" 21 | :components 22 | ((:file "package")))) 23 | :perform (test-op :after (op c) (eval (read-from-string "(5am:run! :specialized-function)")) 24 | )) 25 | -------------------------------------------------------------------------------- /src/0package.lisp: -------------------------------------------------------------------------------- 1 | #| 2 | 3 | This file is a part of NUMCL project. 4 | Copyright (c) 2019 IBM Corporation 5 | SPDX-License-Identifier: LGPL-3.0-or-later 6 | 7 | NUMCL is free software: you can redistribute it and/or modify it under the terms 8 | of the GNU General Public License as published by the Free Software 9 | Foundation,either version 3 of the License, or (at your option) any 10 | later version. 11 | 12 | NUMCL is distributed in the hope that it will be useful, but WITHOUT ANY 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along with 17 | NUMCL. If not, see . 18 | 19 | |# 20 | 21 | (in-package :cl-user) 22 | (defpackage specialized-function 23 | ;; (:shadow :defun) 24 | ;; (:export :defun) 25 | (:use :cl :trivia :alexandria :iterate :lisp-namespace :type-r) 26 | (:export 27 | #:specializing 28 | #:register-base-type 29 | #:last-specialized-function)) 30 | 31 | -------------------------------------------------------------------------------- /src/1common.lisp: -------------------------------------------------------------------------------- 1 | #| 2 | 3 | This file is a part of NUMCL project. 4 | Copyright (c) 2019 IBM Corporation 5 | SPDX-License-Identifier: LGPL-3.0-or-later 6 | 7 | NUMCL is free software: you can redistribute it and/or modify it under the terms 8 | of the GNU General Public License as published by the Free Software 9 | Foundation,either version 3 of the License, or (at your option) any 10 | later version. 11 | 12 | NUMCL is distributed in the hope that it will be useful, but WITHOUT ANY 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along with 17 | NUMCL. If not, see . 18 | 19 | |# 20 | 21 | (in-package :specialized-function) 22 | 23 | (setf (documentation 'last-specialized-function 'function) 24 | "The symbol is fbound to the last function that was compiled by SPECILIZING1 macro, for debugging/tuning purpose.") 25 | 26 | 27 | (defparameter +table-size+ 0 "the size of the table.") 28 | (defparameter *base-types* (make-array 64 :adjustable t :fill-pointer 0)) 29 | 30 | (defun array-element-types () 31 | (stable-sort (remove-duplicates 32 | (mapcar #'upgraded-array-element-type 33 | (concatenate 34 | 'list 35 | (map-product #'list 36 | '(unsigned-byte signed-byte) 37 | (iota 128 :start 1)) 38 | *base-types*)) 39 | :test #'type=) 40 | #'subtypep)) 41 | 42 | ;; this is commented out because it increases the compilation time significantly 43 | #+(or) 44 | (declaim (inline widetag)) 45 | (defvar *rebuild-widetag* nil) 46 | (defun rebuild-widetag () (eval (widetag-lambda))) 47 | (defun register-base-type (type &optional (*rebuild-widetag* *rebuild-widetag*)) 48 | (unless (find type *base-types* :test 'alexandria:type=) 49 | (vector-push-extend type *base-types* (max 1 (length *base-types*)))) 50 | (when *rebuild-widetag* 51 | (rebuild-widetag))) 52 | 53 | (defun widetag-lambda () 54 | (let ((count -1) 55 | (array-count (length (array-element-types)))) 56 | (values 57 | `(progn 58 | (defun widetag (x) 59 | "This function returns an integer based on the type of the object." 60 | (declare (optimize (speed 2) (debug 0))) 61 | (labels ((rec (x) 62 | (etypecase x 63 | ,@(mapcar (lambda (type) `((simple-array ,type) ,(incf count))) 64 | (array-element-types)) 65 | (array 66 | ;; access the underlying 1D simple array. 67 | ;; purpose: to reduce the function size. 68 | #+sbcl 69 | ,(progn 70 | (incf count array-count) 71 | `(+ ,array-count (the (integer 0 (,array-count)) 72 | (sb-kernel:with-array-data ((v x) (s) (e)) 73 | (declare (ignore s e)) 74 | (rec v))))) 75 | #-sbcl 76 | (etypecase x 77 | ,@(mapcar (lambda (type) `((array ,type) ,(incf count))) 78 | (array-element-types)))) 79 | 80 | ;; initial implementation: just enumerate typecase 81 | #+(or) 82 | ,@(map 'list (lambda (type) `(,type ,(incf count))) 83 | *base-types*) 84 | 85 | ;; second implementation: optimize for widetags 86 | ;; #+(or) 87 | ,@`((fixnum 88 | ;; fixnum tends to be detected by lowtags: both sbcl and ccl. 89 | ;; so let's detect it first. 90 | ,(incf count)) 91 | (number 92 | ;; on sbcl, widetags for the similar types are grouped 93 | ;; together and can be tested in one check. I expect the 94 | ;; same for CCL. 95 | (etypecase x 96 | (real 97 | (etypecase x 98 | (rational 99 | (etypecase x 100 | (integer 101 | (etypecase x 102 | ,@(map 'list (lambda (type) `(,type ,(incf count))) 103 | (remove 'fixnum (remove-if-not #'integer-subtype-p *base-types*))))) 104 | (ratio ,(incf count)))) 105 | (float 106 | (etypecase x 107 | ,@(map 'list (lambda (type) `(,type ,(incf count))) 108 | (remove-if-not #'float-subtype-p *base-types*)))))) 109 | (complex 110 | (etypecase x 111 | ,@(map 'list (lambda (type) `(,type ,(incf count))) 112 | (remove-if-not #'complex-type-p *base-types*)))))) 113 | ,@(map 'list (lambda (type) `(,type ,(incf count))) 114 | (remove-if #'number-subtype-p *base-types*)))))) 115 | (rec x))) 116 | (defparameter +table-size+ ,(incf count)))))) 117 | 118 | ;; benchmark 119 | 120 | (defparameter *benchmark-size* 121 | #+sbcl 1000000 122 | #+ccl 10000 123 | #-(or sbcl ccl) 10000) 124 | 125 | (defun benchmark () 126 | (rebuild-widetag) 127 | (let ((array 128 | (vector 100 129 | (1+ most-positive-fixnum) 130 | 1/2 131 | 0.0s0 132 | 0.0f0 133 | 0.0d0 134 | 0.0l0 135 | #C(0.0s0 0.0s0) 136 | #C(0.0f0 0.0f0) 137 | #C(0.0d0 0.0d0) 138 | #C(0.0l0 0.0l0) 139 | #C(1 1) 140 | #C(1/2 1/2) 141 | #\c 142 | 'a 143 | nil 144 | (cons 1 2) 145 | (lambda (x) x) 146 | (make-array 1 :element-type t) 147 | (make-array 1 :element-type 'fixnum) 148 | (make-array 1 :element-type 'single-float) 149 | (make-array 1 :element-type 'double-float) 150 | (make-array 1 :element-type 'bit) 151 | (make-array 1 :element-type 'character) 152 | (make-array 1 :element-type t :displaced-to (make-array 1 :element-type t)) 153 | (make-array 1 :element-type 'fixnum :displaced-to (make-array 1 :element-type 'fixnum)) 154 | (make-array 1 :element-type 'single-float :displaced-to (make-array 1 :element-type 'single-float)) 155 | (make-array 1 :element-type 'double-float :displaced-to (make-array 1 :element-type 'double-float)) 156 | (make-array 1 :element-type 'bit :displaced-to (make-array 1 :element-type 'bit)) 157 | (make-array 1 :element-type 'character :displaced-to (make-array 1 :element-type 'character)) 158 | (make-array '(2 2) :element-type t) 159 | (make-array '(2 2) :element-type 'fixnum) 160 | (make-array '(2 2) :element-type 'single-float) 161 | (make-array '(2 2) :element-type 'double-float) 162 | (make-array '(2 2) :element-type 'bit) 163 | (make-array '(2 2) :element-type 'character) 164 | (make-array '(2 2) :element-type t :displaced-to (make-array '(2 2) :element-type t)) 165 | (make-array '(2 2) :element-type 'fixnum :displaced-to (make-array '(2 2) :element-type 'fixnum)) 166 | (make-array '(2 2) :element-type 'single-float :displaced-to (make-array '(2 2) :element-type 'single-float)) 167 | (make-array '(2 2) :element-type 'double-float :displaced-to (make-array '(2 2) :element-type 'double-float)) 168 | (make-array '(2 2) :element-type 'bit :displaced-to (make-array '(2 2) :element-type 'bit)) 169 | (make-array '(2 2) :element-type 'character :displaced-to (make-array '(2 2) :element-type 'character))))) 170 | (loop repeat 5 171 | do 172 | (time 173 | (loop repeat (the fixnum *benchmark-size*) do 174 | (loop for e across array do 175 | (widetag e))))))) 176 | 177 | 178 | (setf *rebuild-widetag* nil) 179 | ;; base number types 180 | (register-base-type 'fixnum) 181 | #+64-bit 182 | (register-base-type '(unsigned-byte 64)) 183 | #+32-bit 184 | (register-base-type '(unsigned-byte 32)) 185 | #+64-bit 186 | (register-base-type '(signed-byte 64)) 187 | #+32-bit 188 | (register-base-type '(signed-byte 32)) 189 | (register-base-type 'bignum) 190 | (register-base-type 'ratio) 191 | (register-base-type 'short-float) 192 | (register-base-type 'single-float) 193 | (register-base-type 'double-float) 194 | (register-base-type 'long-float) 195 | 196 | ;; due to the bug in sbcl, below are not the realistic set of types 197 | ;; (register-base-type `(complex ,(upgraded-complex-part-type 'fixnum))) ; could be (complex t) 198 | ;; (register-base-type `(complex ,(upgraded-complex-part-type '(unsigned-byte 64)))) 199 | ;; (register-base-type `(complex ,(upgraded-complex-part-type '(unsigned-byte 32)))) 200 | ;; (register-base-type `(complex ,(upgraded-complex-part-type '(signed-byte 64)))) 201 | ;; (register-base-type `(complex ,(upgraded-complex-part-type '(signed-byte 32)))) 202 | ;; (register-base-type `(complex ,(upgraded-complex-part-type 'bignum))) 203 | ;; (register-base-type `(complex ,(upgraded-complex-part-type 'ratio))) 204 | (register-base-type `(complex ,(upgraded-complex-part-type 'short-float))) 205 | (register-base-type `(complex ,(upgraded-complex-part-type 'single-float))) 206 | (register-base-type `(complex ,(upgraded-complex-part-type 'double-float))) 207 | (register-base-type `(complex ,(upgraded-complex-part-type 'long-float))) 208 | (register-base-type `(complex ,(upgraded-complex-part-type 'real))) 209 | 210 | (register-base-type 'base-char) 211 | (register-base-type 'extended-char) 212 | (register-base-type 'function) 213 | (register-base-type 'cons) 214 | (register-base-type 'symbol) 215 | (register-base-type 'structure-object) 216 | (register-base-type 'standard-object) 217 | (register-base-type t 218 | t) ;rebuild widetags 219 | (setf *rebuild-widetag* t) 220 | 221 | (declaim (inline upgraded-object-type)) 222 | (defun upgraded-object-type (x) 223 | "Takes an object and returns a reasonable type declaration for the object. 224 | Analogous to upgraded-array-element-type, but works on an object." 225 | (etypecase x 226 | ;; aggregate all numbers within fixnum range. 227 | ;; For example, (type-of 5) may return any valid supertype e.g. FIXNUM, (integer 5 5), (integer 0 5). 228 | ;; Same goes with bignums. 229 | (fixnum 'fixnum) 230 | #+64-bit 231 | ((unsigned-byte 64) '(unsigned-byte 64)) 232 | #+32-bit 233 | ((unsigned-byte 32) '(unsigned-byte 32)) 234 | #+64-bit 235 | ((signed-byte 64) '(signed-byte 64)) 236 | #+32-bit 237 | ((signed-byte 32) '(signed-byte 32)) 238 | (bignum 'bignum) 239 | (ratio 'ratio) 240 | (short-float 'short-float) 241 | (single-float 'single-float) 242 | (double-float 'double-float) 243 | (long-float 'long-float) 244 | 245 | ((complex fixnum) '(complex fixnum)) 246 | ((complex bignum) '(complex bignum)) 247 | ((complex ratio) '(complex ratio)) 248 | ((complex short-float) '(complex short-float)) 249 | ((complex single-float) '(complex single-float)) 250 | ((complex double-float) '(complex double-float)) 251 | ((complex long-float) '(complex long-float)) 252 | (complex 'complex) 253 | 254 | (base-char 'base-char) 255 | (extended-char 'extended-char) 256 | 257 | ;; Arrays: Ignore dimensions, but keep the rank. 258 | ;; Rationale: 259 | ;; It is common to feed arrays of the different element types to the same algorithm. 260 | ;; It needs to be recompiled for each element type, though. 261 | ;; 262 | ;; It is also common to feed arrays of the different sizes to the same algorithm. 263 | ;; It does not need to be recompiled, as it only reduces the termination check. 264 | ;; 265 | ;; It is uncommon to feed arrays of the different ranks to the same algorithm. 266 | ;; If it really happens, the number of loops should be altered. 267 | (simple-array 268 | `(simple-array ,(array-element-type x) 269 | ,(array-rank x))) 270 | (array 271 | `(array ,(array-element-type x) 272 | ,(array-rank x))) 273 | ;; Aggregate all structure/standard/funcallable object classes. 274 | ;; don't specialize on classes; no use, and also could be potentially wrong. 275 | ;; for example, the specific instance given in the first invocation could be a subclass. 276 | (structure-object 'structure-object) 277 | (standard-object 'standard-object) 278 | (function 'function) 279 | ;; Aggregate all subtypes of symbols: keyword, null 280 | (symbol 'symbol) 281 | ;; Aggregate all subtypes of cons: (cons fixnum fixnum) etc. 282 | (cons 'cons) 283 | (t (error "cannot confidently aggregate the type from the instance ~a! 284 | type-of says ~a but there could be supertypes that are compatible to this function" 285 | x 286 | (type-of x))))) 287 | 288 | 289 | (defun specialized-function-form (vars lexvars lexvars-types decl-and-body vals) 290 | (multiple-value-bind (body decls) (parse-body decl-and-body) 291 | `(lambda (,@vars ,@lexvars) 292 | (declare (ignorable ,@lexvars)) 293 | ,@(mapcar (lambda (var val) 294 | `(declare (type ,(upgraded-object-type val) ,var))) 295 | vars 296 | vals) 297 | ,@(mappend (lambda (var type) 298 | (when type 299 | `((declare (type ,(cdr type) ,var))))) 300 | lexvars 301 | lexvars-types) 302 | ,@decls 303 | #-sbcl 304 | ,@(mapcar (lambda (var val) 305 | `(check-type ,var ,(upgraded-object-type val))) 306 | vars 307 | vals) 308 | ,@body))) 309 | 310 | #+(or) 311 | (print (specialized-function-form 'x nil '((* 2 X)) 5)) 312 | 313 | ;; debug macro 314 | (defmacro in-compile-time ((&optional env) &body body) 315 | "macro for debugging" 316 | (with-gensyms (macro) 317 | `(macrolet ((,macro (&environment ,env) 318 | ,@body)) 319 | (,macro)))) 320 | 321 | 322 | 323 | (declaim (inline table)) 324 | (defun table (size) 325 | (make-array size 326 | :element-type '(or null function) 327 | :initial-element nil)) 328 | 329 | (deftype table (size) `(simple-array t (,size))) 330 | 331 | (defmacro specializing (args (&key verbose time) &body decl-and-body &environment env) 332 | (assert (every #'symbolp args)) 333 | (assert (typep verbose 'boolean)) 334 | (with-gensyms (table) 335 | 336 | (let* ((lexvars (set-difference (find-lexical-variables env) args)) 337 | (lexvars-types (mapcar (lambda (var) (assoc 'type (nth-value 2 (cltl2:variable-information var env)))) 338 | lexvars)) 339 | (widetags (make-gensym-list (length args)))) 340 | 341 | `(let ((,table (load-time-value (table ,+table-size+))) 342 | ,@(mapcar (lambda (var arg) 343 | `(,var (widetag ,arg))) 344 | widetags 345 | args)) 346 | (declare (optimize (speed 3) (debug 0) (safety 0))) 347 | 348 | ,@(iter (for (v . rest) on widetags) 349 | (for compile-and-set = 350 | `(setf (symbol-function 'last-specialized-function) 351 | (compile nil 352 | (specialized-function-form 353 | ',args ',lexvars ',lexvars-types ',decl-and-body (list ,@args))))) 354 | (for default = 355 | (cond 356 | (rest `(table ,+table-size+)) 357 | (verbose 358 | `(locally 359 | (declare (optimize (debug 1) (speed 1) (safety 1))) 360 | (format t "~&~<; ~@;Specializing ~a to ~{~a~^ ~}~:>" 361 | (list ',args (mapcar #'upgraded-object-type (list ,@args)))) 362 | ,compile-and-set)) 363 | (t 364 | compile-and-set))) 365 | 366 | (collecting 367 | `(setf ,table 368 | (or (aref (the (table ,+table-size+) ,table) ,v) 369 | (setf (aref (the (table ,+table-size+) ,table) ,v) 370 | ,default))))) 371 | (,(if time 'time 'progn) 372 | (funcall (the 373 | (function ,(mapcar (constantly t) (append args lexvars)) *) 374 | ,table) 375 | ,@args 376 | ,@lexvars)))))) 377 | -------------------------------------------------------------------------------- /src/2find-lexical-variables.lisp: -------------------------------------------------------------------------------- 1 | #| 2 | 3 | This file is a part of NUMCL project. 4 | Copyright (c) 2019 IBM Corporation 5 | SPDX-License-Identifier: LGPL-3.0-or-later 6 | 7 | NUMCL is free software: you can redistribute it and/or modify it under the terms 8 | of the GNU General Public License as published by the Free Software 9 | Foundation,either version 3 of the License, or (at your option) any 10 | later version. 11 | 12 | NUMCL is distributed in the hope that it will be useful, but WITHOUT ANY 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along with 17 | NUMCL. If not, see . 18 | 19 | |# 20 | 21 | 22 | (in-package :specialized-function) 23 | 24 | #+sbcl 25 | (defun find-lexical-variables (env) 26 | (remove-if 27 | (lambda (v) 28 | (multiple-value-match (trivial-cltl2:variable-information v env) 29 | (((not :lexical) _ _) 30 | t) 31 | ((_ _ (alist ('ignore . var))) 32 | var))) 33 | (remove-duplicates 34 | (mapcar #'car 35 | (sb-c::lexenv-vars 36 | (sb-c::coerce-to-lexenv env)))))) 37 | 38 | 39 | ;; see ccl:variable-information for details 40 | 41 | #+ccl 42 | (defun find-lexical-variables (env) 43 | (labels ((rec (env) 44 | (let ((vars (ccl::lexenv.variables env))) 45 | (when (listp vars) 46 | (union (iter (for v in vars) 47 | (for bits = (ccl::var-bits v)) 48 | (when (and (typep bits 'integer) 49 | (not (logbitp ccl::$vbittemporary bits)) 50 | ;; (not (logbitp ccl::$vbitignoreunuused bits)) 51 | (not (logbitp ccl::$vbitignore bits)) 52 | (not (logbitp ccl::$vbitspecial bits)) 53 | ) 54 | (collect (ccl::var-name v)))) 55 | (rec (ccl::lexenv.parent-env env))))))) 56 | (remove-duplicates (rec env)))) 57 | 58 | #+(or) 59 | (defun fn (x y) 60 | (declare (fixnum x)) 61 | (in-compile-time (env) 62 | (print (find-lexical-variables env)) 63 | nil) 64 | (print x) 65 | (print y)) 66 | 67 | #+lispworks 68 | (defun find-lexical-variables (env) 69 | (let ((list nil)) 70 | (sys:map-environment env :variable 71 | #'(lambda (name kind info) 72 | (declare (ignore info)) 73 | (when (eq kind :lexical) 74 | (push name list)))) 75 | (delete-duplicates (nreverse list)))) 76 | 77 | #-(or sbcl ccl lispworks) 78 | (defun find-lexical-variables (env) 79 | nil) 80 | -------------------------------------------------------------------------------- /t/package.lisp: -------------------------------------------------------------------------------- 1 | #| 2 | This file is a part of specialized-function project. 3 | Copyright (c) 2019 Masataro Asai (guicho2.71828@gmail.com) 4 | |# 5 | 6 | (in-package :cl-user) 7 | (defpackage :specialized-function.test 8 | (:use :cl 9 | :specialized-function 10 | :fiveam 11 | :trivia :alexandria :iterate :lisp-namespace)) 12 | (in-package :specialized-function.test) 13 | 14 | 15 | 16 | (def-suite :specialized-function) 17 | (in-suite :specialized-function) 18 | 19 | ;; run test with (run! test-name) 20 | 21 | (defparameter *a* (make-array 5 :element-type 'fixnum)) 22 | (defparameter *b* (make-array '(5 5) :element-type 'fixnum)) 23 | (defparameter *a1* (make-array 5 :element-type 'fixnum :displaced-to *a*)) 24 | (defparameter *b1* (make-array 25 :element-type 'fixnum :displaced-to *b*)) 25 | (defparameter *b2* (make-array '(5 5) :element-type 'fixnum :displaced-to *b*)) 26 | 27 | (defparameter *c* (make-array 5 :element-type 'single-float)) 28 | (defparameter *d* (make-array '(5 5) :element-type 'single-float)) 29 | (defparameter *c1* (make-array 5 :element-type 'single-float :displaced-to *c*)) 30 | (defparameter *d1* (make-array 25 :element-type 'single-float :displaced-to *d*)) 31 | (defparameter *d2* (make-array '(5 5) :element-type 'single-float :displaced-to *d*)) 32 | 33 | ;; *a* and *b* don't need to be distinguished due to the rank difference 34 | ;; same for *c* and *d* 35 | 36 | (test (specialized-function :compile-at :run-time) 37 | (defun fn (a b) 38 | (print (specialized-function::widetag a)) 39 | (print (specialized-function::widetag b)) 40 | (unwind-protect-case () 41 | (specializing (a b) () 42 | (declare (optimize)) 43 | (print (type-of a)) 44 | (print (type-of b))) 45 | (:normal 46 | (print :ok)) 47 | (:abort 48 | (print :ng)))) 49 | 50 | ;; base case 51 | (finishes 52 | (fn *a* *a*)) 53 | (signals error 54 | (fn *a* *b*)) 55 | (signals error 56 | (fn *b* *b*)) 57 | (signals error 58 | (fn *b* *a*)) 59 | 60 | (finishes 61 | (fn *a* *c*)) ; should dispatch to the different 62 | ; functions because rank is same but 63 | ; element-type is different 64 | (finishes 65 | (fn *a* *c*)) 66 | (finishes 67 | (fn *c* *c*)) 68 | (finishes 69 | (fn *c* *a*)) 70 | 71 | (finishes (fn *a* *a1*)) ; both should pass because they have the same rank 72 | (finishes (fn *a* *b1*)) ; (could be dispatched to different functions due to 73 | ; displacement 74 | 75 | (signals error 76 | (fn *a* *d*)) ; should error due to rank difference 77 | (signals error 78 | (fn *d* *d*)) 79 | (signals error 80 | (fn *d* *a*)) 81 | 82 | (finishes ; should dispatch to different function 83 | (fn *a* *c1*)) ; (fixnum/single-float arrays, same rank) 84 | (finishes 85 | (fn *c1* *c1*)) 86 | (finishes 87 | (fn *c1* *a*)) 88 | (finishes 89 | (fn *d1* *c1*)) 90 | (finishes 91 | (fn *c1* *c1*)) 92 | (finishes 93 | (fn *c1* *d1*)) 94 | (finishes 95 | (fn *d1* *d1*))) 96 | 97 | (define-condition compiled () ()) 98 | 99 | (test (lowtag-dispatch :compile-at :run-time) 100 | (defun fn (a b) 101 | (let ((flag nil)) 102 | (handler-bind ((compiled 103 | (lambda (c) 104 | (setf flag t)))) 105 | (specializing (a b) () 106 | (macrolet ((m () 107 | (signal 'compiled))) 108 | (m)) 109 | :ok)) 110 | flag)) 111 | 112 | ;; base case 113 | (is-true (fn 0 0) "the first call should cause compilation") 114 | (iter (repeat 10) 115 | (for a = (random most-positive-fixnum)) 116 | (for b = (random most-positive-fixnum)) 117 | (is-false (fn a b) "the later calls should not cause compilation. args:~%~A~%~A" a b)) 118 | 119 | (is-true (fn nil nil) 120 | "the first call should cause compilation") 121 | (is-false (fn nil nil) 122 | "the later calls should not cause compilation") 123 | (iter (repeat 10) 124 | (for a = (cons (random most-positive-fixnum) 125 | (random most-positive-fixnum))) 126 | (for b = (cons (random most-positive-fixnum) 127 | (random most-positive-fixnum))) 128 | (for c = (cons (random most-positive-fixnum) 129 | (random most-positive-fixnum))) 130 | (for d = (cons (random most-positive-fixnum) 131 | (random most-positive-fixnum))) 132 | (if (first-iteration-p) 133 | (progn 134 | (is-true (fn a nil) "the first call should cause compilation") 135 | (is-true (fn nil b) "the first call should cause compilation") 136 | (is-true (fn c d) "the first call should cause compilation")) 137 | (progn 138 | (is-false (fn a nil) "the later calls should not cause compilation. args:~%~A~%~A" a nil) 139 | (is-false (fn nil b) "the later calls should not cause compilation. args:~%~A~%~A" nil b) 140 | (is-false (fn c d) "the later calls should not cause compilation. args:~%~A~%~A" c d))))) 141 | 142 | 143 | 144 | 145 | 146 | #+sbcl 147 | (flet ((pair (name) 148 | (when-let ((s (find-symbol name :sb-vm))) 149 | (when (boundp s) 150 | (cons (symbol-value s) s))))) 151 | (defparameter *widetags* 152 | (iter (for name in 153 | '("BIGNUM-WIDETAG" 154 | "CHARACTER-WIDETAG" 155 | "CLOSURE-WIDETAG" 156 | "CODE-HEADER-WIDETAG" 157 | "COMPLEX-ARRAY-WIDETAG" ; this is an array 158 | "COMPLEX-BASE-STRING-WIDETAG" ; this is an array 159 | "COMPLEX-BIT-VECTOR-WIDETAG" ; this is an array 160 | "COMPLEX-CHARACTER-STRING-WIDETAG" ; this is an array 161 | "COMPLEX-DOUBLE-FLOAT-WIDETAG" ; this is a complex number 162 | "COMPLEX-SINGLE-FLOAT-WIDETAG" ; this is a complex number 163 | "COMPLEX-VECTOR-NIL-WIDETAG" ; this is an array 2021/05/30 removed in sbcl-2.0.10 https://github.com/sbcl/sbcl/commit/8a2df46b46e3feb201c7f19096018a3f4b1c7d8a 164 | "COMPLEX-VECTOR-WIDETAG" ; this is an array 165 | "COMPLEX-WIDETAG" ; this is a complex number 166 | "DOUBLE-FLOAT-WIDETAG" 167 | "FDEFN-WIDETAG" 168 | "FILLER-WIDETAG" 169 | "FUNCALLABLE-INSTANCE-WIDETAG" 170 | "INSTANCE-WIDETAG" 171 | "N-WIDETAG-BITS" 172 | "NO-TLS-VALUE-MARKER-WIDETAG" 173 | "RATIO-WIDETAG" 174 | "SAP-WIDETAG" 175 | "SIMD-PACK-256-WIDETAG" 176 | "SIMD-PACK-WIDETAG" 177 | "SIMPLE-ARRAY-COMPLEX-DOUBLE-FLOAT-WIDETAG" 178 | "SIMPLE-ARRAY-COMPLEX-SINGLE-FLOAT-WIDETAG" 179 | "SIMPLE-ARRAY-DOUBLE-FLOAT-WIDETAG" 180 | "SIMPLE-ARRAY-FIXNUM-WIDETAG" 181 | "SIMPLE-ARRAY-NIL-WIDETAG" 182 | "SIMPLE-ARRAY-SIGNED-BYTE-16-WIDETAG" 183 | "SIMPLE-ARRAY-SIGNED-BYTE-32-WIDETAG" 184 | "SIMPLE-ARRAY-SIGNED-BYTE-64-WIDETAG" 185 | "SIMPLE-ARRAY-SIGNED-BYTE-8-WIDETAG" 186 | "SIMPLE-ARRAY-SINGLE-FLOAT-WIDETAG" 187 | "SIMPLE-ARRAY-UNSIGNED-BYTE-15-WIDETAG" 188 | "SIMPLE-ARRAY-UNSIGNED-BYTE-16-WIDETAG" 189 | "SIMPLE-ARRAY-UNSIGNED-BYTE-2-WIDETAG" 190 | "SIMPLE-ARRAY-UNSIGNED-BYTE-31-WIDETAG" 191 | "SIMPLE-ARRAY-UNSIGNED-BYTE-32-WIDETAG" 192 | "SIMPLE-ARRAY-UNSIGNED-BYTE-4-WIDETAG" 193 | "SIMPLE-ARRAY-UNSIGNED-BYTE-63-WIDETAG" 194 | "SIMPLE-ARRAY-UNSIGNED-BYTE-64-WIDETAG" 195 | "SIMPLE-ARRAY-UNSIGNED-BYTE-7-WIDETAG" 196 | "SIMPLE-ARRAY-UNSIGNED-BYTE-8-WIDETAG" 197 | "SIMPLE-ARRAY-UNSIGNED-FIXNUM-WIDETAG" 198 | "SIMPLE-ARRAY-WIDETAG" 199 | "SIMPLE-BASE-STRING-WIDETAG" 200 | "SIMPLE-BIT-VECTOR-WIDETAG" 201 | "SIMPLE-CHARACTER-STRING-WIDETAG" 202 | "SIMPLE-FUN-WIDETAG" 203 | "SIMPLE-VECTOR-WIDETAG" 204 | "SINGLE-FLOAT-WIDETAG" 205 | "SYMBOL-WIDETAG" 206 | "UNBOUND-MARKER-WIDETAG" 207 | "VALUE-CELL-WIDETAG" 208 | "WEAK-POINTER-WIDETAG")) 209 | (for pair = (pair name)) 210 | (when pair 211 | (collecting pair into pairs)) 212 | (finally 213 | (return (sort pairs #'< :key #'car))))) 214 | (format t "~{~a~%~}" *widetags*)) 215 | 216 | #+sbcl 217 | (progn 218 | (format t "~&~4a : ~4a ~35a ~4a ~35a ~4a" 219 | 'arg 220 | 'tag 221 | 'name 222 | 'saet 223 | 'name 224 | 'specialized-tag) 225 | (dolist (a `(*a* *b* *a1* *b1* *b2* 226 | *c* *d* *c1* *d1* *d2*)) 227 | (let ((v (symbol-value a))) 228 | (format t "~&~4a : ~4a ~35a ~4a ~35a ~4a" 229 | a 230 | (sb-kernel:widetag-of v) 231 | (cdr (assoc (sb-kernel:widetag-of v) *widetags*)) 232 | (sb-kernel:array-underlying-widetag v) 233 | (cdr (assoc (sb-kernel:array-underlying-widetag v) *widetags*)) 234 | (specialized-function::widetag v))))) 235 | -------------------------------------------------------------------------------- /testscr.ros: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #|-*- mode:lisp -*-|# 3 | #| 4 | exec ros -Q -- $0 "$@" 5 | |# 6 | 7 | (defun main (&rest argv) 8 | (declare (ignorable argv)) 9 | (uiop:quit (if (handler-case 10 | (progn 11 | (ql:quickload :specialized-function.test) 12 | (eval (read-from-string "(5am:run! :specialized-function)")) 13 | ) 14 | (serious-condition (c) 15 | (describe c) 16 | (uiop:quit 2))) 17 | 0 1))) 18 | --------------------------------------------------------------------------------