Paste: io.mmap and math.vectors.simd

Author: slava
Mode: factor
Date: Mon, 28 Sep 2009 08:22:46
Plain Text |
USING: kernel io.mmap math.vectors math.vectors.simd
sequences specialized-arrays ;
SIMD: float
SPECIALIZED-ARRAY: float-4

"mydata.dat" [
    float-4 <mapped-array>
    [ normalize ] change-each
] with-mapped-file

! Inner loop compile down to this machine IR:

! _branch 35
! _label 34
! ##shl-imm RBX RDX 4
! ##sar-imm RBX RBX 3
! ##unbox-any-c-ptr RSI RAX RBP
! ##add RBP RBX RSI
! ##alien-vector XMM0 RBP float-4-rep
! ##mul-vector XMM1 XMM0 XMM0 float-4-rep
! ##horizontal-add-vector XMM1 XMM1 float-4-rep
! ##single>double-float XMM1 XMM1
! ##sqrt XMM1 XMM1
! ##double>single-float XMM1 XMM1
! ##broadcast-vector XMM1 XMM1 float-4-rep
! ##div-vector XMM0 XMM0 XMM1 float-4-rep
! ##unbox-any-c-ptr RSI RAX RBP
! ##add RBX RBX RSI
! ##set-alien-vector RBX XMM0 float-4-rep
! ##add-imm RDX RDX 8
! _label 35
! _compare-branch 34 RDX RCX cc<

New Annotation

Summary:
Author:
Mode:
Body: