Paste: accel vec

Author: accel
Mode: factor
Date: Thu, 23 Dec 2010 00:12:47
Plain Text |
STRUCT: vec3
  { x c:double }
  { y c:double }
  { z c:double }
  ;
  
TYPED:: v+v ( v1: vec3  v2: vec3 -- c: vec3 )
  vec3 new 
    v1 x>> v2 x>> + >>x
    v1 y>> v2 y>> + >>y
    v1 z>> v2 z>> + >>z
  ; 

Annotation: accel vec

Author: accel
Mode: factor
Date: Thu, 23 Dec 2010 00:17:03
Plain Text |
( scratchpad ) \ v+v optimized.
[
    >R dup \ vec3 9 rot dup tag 7 eq? [
        1 slot 2dup 1 slot fixnum<=
        [ swap slot eq? ] [ 3drop f ] if
    ] [ 3drop f ] if
    [ ] [ \ vec3 \ v+v { vec3 vec3 } input-mismatch-error ] if
    2 slot R> dup \ vec3 9 rot dup tag 7 eq? [
        1 slot 2dup 1 slot fixnum<=
        [ swap slot eq? ] [ 3drop f ] if
    ] [ 3drop f ] if
    [ ] [ \ vec3 \ v+v { vec3 vec3 } input-mismatch-error ] if
    2 slot ( typed v+v ) {
        vec3
        1
        2
        tuple
        3547099654
        struct
        40345603621556724
        vec3
        127228056702
    } <tuple-boa>

Annotation: disasembly

Author: accel
Mode: factor
Date: Thu, 23 Dec 2010 00:25:24
Plain Text |
\ v+v disassemble
[Thread debugging using libthread_db enabled]
[New Thread 0x7f4e5a19f710 (LWP 20256)]
0x00007f4e7332df43 in epoll_wait () at ../sysdeps/unix/syscall-template.S:82
 in ../sysdeps/unix/syscall-template.S
Dump of assembler code from 0x7f4e5f8f9ce0 to 0x7f4e5f8f9f20:
   0x00007f4e5f8f9ce0: lea    -0x7(%rip),%r11        # 0x7f4e5f8f9ce0
   0x00007f4e5f8f9ce7: pushq  $0x20
   0x00007f4e5f8f9cec: push   %r11
   0x00007f4e5f8f9cee: sub    $0x8,%rsp
   0x00007f4e5f8f9cf2: add    $0x8,%r15
   0x00007f4e5f8f9cf6: add    $0x10,%r14
   0x00007f4e5f8f9cfa: mov    -0x10(%r14),%rax
   0x00007f4e5f8f9cfe: movabs $0x7f4e69144bbc,%rcx
   0x00007f4e5f8f9d08: movabs $0x9,%rdx
   0x00007f4e5f8f9d12: mov    -0x18(%r14),%rbx
   0x00007f4e5f8f9d16: mov    %rbx,%rbp
   0x00007f4e5f8f9d19: and    $0xf,%rbp
   0x00007f4e5f8f9d1d: cmp    $0x7,%rbp
   0x00007f4e5f8f9d21: jne    0x7f4e5f8f9d77
   0x00007f4e5f8f9d27: mov    0x1(%rbx),%rbp
   0x00007f4e5f8f9d2b: mov    0x6(%rbp),%rsi
   0x00007f4e5f8f9d2f: sar    $0x4,%rsi
   0x00007f4e5f8f9d33: cmp    %rsi,%rdx
   0x00007f4e5f8f9d36: jg     0x7f4e5f8f9d64
   0x00007f4e5f8f9d3c: sub    $0x10,%r14
   0x00007f4e5f8f9d40: mov    0x46(%rbp),%rbp
   0x00007f4e5f8f9d44: cmp    %rbp,%rcx
   0x00007f4e5f8f9d47: movabs $0x1,%rcx
   0x00007f4e5f8f9d51: movabs $0x7f4e6311529c,%rdx
   0x00007f4e5f8f9d5b: cmove  %rdx,%rcx
   0x00007f4e5f8f9d5f: jmpq   0x7f4e5f8f9d72
   0x00007f4e5f8f9d64: sub    $0x10,%r14
   0x00007f4e5f8f9d68: movabs $0x1,%rcx
   0x00007f4e5f8f9d72: jmpq   0x7f4e5f8f9d85
   0x00007f4e5f8f9d77: sub    $0x10,%r14
   0x00007f4e5f8f9d7b: movabs $0x1,%rcx
   0x00007f4e5f8f9d85: sub    $0x8,%r14
   0x00007f4e5f8f9d89: cmp    $0x1,%rcx
   0x00007f4e5f8f9d8d: je     0x7f4e5f8f9edb
   0x00007f4e5f8f9d93: sub    $0x8,%r15
   0x00007f4e5f8f9d97: add    $0x20,%r14
   0x00007f4e5f8f9d9b: mov    0x9(%rbx),%rbx
   0x00007f4e5f8f9d9f: movabs $0x7f4e69144bbc,%rcx
   0x00007f4e5f8f9da9: movabs $0x9,%rdx
   0x00007f4e5f8f9db3: mov    %rax,%rbp
   0x00007f4e5f8f9db6: and    $0xf,%rbp
   0x00007f4e5f8f9dba: cmp    $0x7,%rbp
   0x00007f4e5f8f9dbe: jne    0x7f4e5f8f9e14
   0x00007f4e5f8f9dc4: mov    0x1(%rax),%rbp
   0x00007f4e5f8f9dc8: mov    0x6(%rbp),%rsi
   0x00007f4e5f8f9dcc: sar    $0x4,%rsi
   0x00007f4e5f8f9dd0: cmp    %rsi,%rdx
   0x00007f4e5f8f9dd3: jg     0x7f4e5f8f9e01
   0x00007f4e5f8f9dd9: sub    $0x10,%r14
   0x00007f4e5f8f9ddd: mov    0x46(%rbp),%rbp
   0x00007f4e5f8f9de1: cmp    %rbp,%rcx
   0x00007f4e5f8f9de4: movabs $0x1,%rcx
   0x00007f4e5f8f9dee: movabs $0x7f4e6311529c,%rdx
   0x00007f4e5f8f9df8: cmove  %rdx,%rcx
   0x00007f4e5f8f9dfc: jmpq   0x7f4e5f8f9e0f
   0x00007f4e5f8f9e01: sub    $0x10,%r14
   0x00007f4e5f8f9e05: movabs $0x1,%rcx
   0x00007f4e5f8f9e0f: jmpq   0x7f4e5f8f9e22
   0x00007f4e5f8f9e14: sub    $0x10,%r14
   0x00007f4e5f8f9e18: movabs $0x1,%rcx
   0x00007f4e5f8f9e22: sub    $0x8,%r14
   0x00007f4e5f8f9e26: cmp    $0x1,%rcx
   0x00007f4e5f8f9e2a: je     0x7f4e5f8f9ea1
   0x00007f4e5f8f9e30: mov    %rbx,-0x8(%r14)
   0x00007f4e5f8f9e34: mov    0x9(%rax),%rax
   0x00007f4e5f8f9e38: mov    %rax,(%r14)
   0x00007f4e5f8f9e3b: callq  0x7f4e5f8fc270
   0x00007f4e5f8f9e40: lea    0x10(%r13),%rcx
   0x00007f4e5f8f9e44: mov    (%rcx),%rax
   0x00007f4e5f8f9e47: add    $0x20,%rax
   0x00007f4e5f8f9e4b: cmp    0x10(%rcx),%rax
   0x00007f4e5f8f9e4f: jle    0x7f4e5f8f9e6e
   0x00007f4e5f8f9e55: mov    0x0(%r13),%rax
   0x00007f4e5f8f9e59: lea    -0x8(%rsp),%rcx
   0x00007f4e5f8f9e5e: mov    %rcx,(%rax)
   0x00007f4e5f8f9e61: mov    %r14,0x10(%rax)
   0x00007f4e5f8f9e65: mov    %r15,0x18(%rax)
   0x00007f4e5f8f9e69: callq  0x7f4e5eb94120
   0x00007f4e5f8f9e6e: lea    0x10(%r13),%rax
   0x00007f4e5f8f9e72: mov    (%rax),%rcx
   0x00007f4e5f8f9e75: movq   $0x1c,(%rcx)
   0x00007f4e5f8f9e7c: or     $0x7,%rcx
   0x00007f4e5f8f9e80: addq   $0x20,(%rax)
   0x00007f4e5f8f9e84: movabs $0x7f4e69147a22,%rax
   0x00007f4e5f8f9e8e: mov    %rax,0x1(%rcx)
   0x00007f4e5f8f9e92: mov    (%r14),%rax
   0x00007f4e5f8f9e95: mov    %rax,0x9(%rcx)
   0x00007f4e5f8f9e99: mov    %rcx,(%r14)
   0x00007f4e5f8f9e9c: add    $0x18,%rsp
   0x00007f4e5f8f9ea0: retq   
   0x00007f4e5f8f9ea1: add    $0x18,%r14
   0x00007f4e5f8f9ea5: mov    %rbx,-0x20(%r14)
   0x00007f4e5f8f9ea9: mov    %rax,-0x18(%r14)
   0x00007f4e5f8f9ead: movabs $0x7f4e69144bbc,%rax
   0x00007f4e5f8f9eb7: mov    %rax,-0x10(%r14)
   0x00007f4e5f8f9ebb: movabs $0x7f4e69144adc,%rax
   0x00007f4e5f8f9ec5: mov    %rax,-0x8(%r14)
   0x00007f4e5f8f9ec9: movabs $0x7f4e69586972,%rax
   0x00007f4e5f8f9ed3: mov    %rax,(%r14)
   0x00007f4e5f8f9ed6: callq  0x7f4e5f670140
   0x00007f4e5f8f9edb: add    $0x18,%r14
   0x00007f4e5f8f9edf: mov    %rax,(%r15)
   0x00007f4e5f8f9ee2: movabs $0x7f4e69144bbc,%rax
   0x00007f4e5f8f9eec: mov    %rax,-0x10(%r14)
   0x00007f4e5f8f9ef0: movabs $0x7f4e69144adc,%rax
   0x00007f4e5f8f9efa: mov    %rax,-0x8(%r14)
   0x00007f4e5f8f9efe: movabs $0x7f4e69586972,%rax
   0x00007f4e5f8f9f08: mov    %rax,(%r14)
   0x00007f4e5f8f9f0b: callq  0x7f4e5f670140
   0x00007f4e5f8f9f10: add    %al,(%rax)
   0x00007f4e5f8f9f12: add    %al,(%rax)
   0x00007f4e5f8f9f14: add    %al,(%rax)
   0x00007f4e5f8f9f16: add    %al,(%rax)
   0x00007f4e5f8f9f18: add    %al,(%rax)
   0x00007f4e5f8f9f1a: add    %al,(%rax)
   0x00007f4e5f8f9f1c: add    %al,(%rax)
   0x00007f4e5f8f9f1e: add    %al,(%rax)

Annotation: typed-disasemble

Author: accel
Mode: factor
Date: Thu, 23 Dec 2010 00:34:24
Plain Text |
\ v+v "typed-word" word-prop disassemble
[Thread debugging using libthread_db enabled]
[New Thread 0x7f4e5a19f710 (LWP 20256)]
0x00007f4e7332df43 in epoll_wait () at ../sysdeps/unix/syscall-template.S:82
 in ../sysdeps/unix/syscall-template.S
Dump of assembler code from 0x7f4e5f8fc270 to 0x7f4e5f8fc330:
   0x00007f4e5f8fc270: sub    $0x8,%r14
   0x00007f4e5f8fc274: mov    (%r14),%rax
   0x00007f4e5f8fc277: xor    %rcx,%rcx
   0x00007f4e5f8fc27a: cmp    $0x1,%rax
   0x00007f4e5f8fc27e: je     0x7f4e5f8fc29d
   0x00007f4e5f8fc284: mov    %rax,%rcx
   0x00007f4e5f8fc287: and    $0xf,%rcx
   0x00007f4e5f8fc28b: cmp    $0x6,%rcx
   0x00007f4e5f8fc28f: lea    0x7(%rax),%rcx
   0x00007f4e5f8fc293: jne    0x7f4e5f8fc29d
   0x00007f4e5f8fc299: mov    0x1a(%rax),%rcx
   0x00007f4e5f8fc29d: rex.W movsd (%rcx),%xmm0
   0x00007f4e5f8fc2a2: mov    0x8(%r14),%rax
   0x00007f4e5f8fc2a6: xor    %rdx,%rdx
   0x00007f4e5f8fc2a9: cmp    $0x1,%rax
   0x00007f4e5f8fc2ad: je     0x7f4e5f8fc2cc
   0x00007f4e5f8fc2b3: mov    %rax,%rdx
   0x00007f4e5f8fc2b6: and    $0xf,%rdx
   0x00007f4e5f8fc2ba: cmp    $0x6,%rdx
   0x00007f4e5f8fc2be: lea    0x7(%rax),%rdx
   0x00007f4e5f8fc2c2: jne    0x7f4e5f8fc2cc
   0x00007f4e5f8fc2c8: mov    0x1a(%rax),%rdx
   0x00007f4e5f8fc2cc: rex.W movsd (%rdx),%xmm1
   0x00007f4e5f8fc2d1: xor    %rax,%rax
   0x00007f4e5f8fc2d4: addsd  %xmm1,%xmm0
   0x00007f4e5f8fc2d8: rex.W movsd %xmm0,(%rax)
   0x00007f4e5f8fc2dd: rex.W movsd 0x8(%rcx),%xmm0
   0x00007f4e5f8fc2e3: rex.W movsd 0x8(%rdx),%xmm1
   0x00007f4e5f8fc2e9: movabs $0x8,%rax
   0x00007f4e5f8fc2f3: addsd  %xmm1,%xmm0
   0x00007f4e5f8fc2f7: rex.W movsd %xmm0,(%rax)
   0x00007f4e5f8fc2fc: rex.W movsd 0x10(%rcx),%xmm0
   0x00007f4e5f8fc302: rex.W movsd 0x10(%rdx),%xmm1
   0x00007f4e5f8fc308: movabs $0x10,%rax
   0x00007f4e5f8fc312: addsd  %xmm1,%xmm0
   0x00007f4e5f8fc316: rex.W movsd %xmm0,(%rax)
   0x00007f4e5f8fc31b: movq   $0x1,(%r14)
   0x00007f4e5f8fc322: retq   
   0x00007f4e5f8fc323: add    %al,(%rax)
   0x00007f4e5f8fc325: add    %al,(%rax)
   0x00007f4e5f8fc327: add    %al,(%rax)
   0x00007f4e5f8fc329: add    %al,(%rax)
   0x00007f4e5f8fc32b: add    %al,(%rax)
   0x00007f4e5f8fc32d: add    %al,(%rax)

New Annotation

Summary:
Author:
Mode:
Body: