Skip to content

Instantly share code, notes, and snippets.

@stassats
Created March 25, 2019 11:02
Show Gist options
  • Save stassats/40c688ba2ed9c8a7813a829a9b05589b to your computer and use it in GitHub Desktop.
Save stassats/40c688ba2ed9c8a7813a829a9b05589b to your computer and use it in GitHub Desktop.
(sb-c:defknown simd-ref ((simple-array double-float (*)) sb-int:index)
(simd-pack double-float)
(sb-c:movable sb-c:flushable sb-c:always-translatable)
:overwrite-fndb-silently t)
(define-vop (simd-ref)
(:translate simd-example::simd-ref)
(:policy :fast-safe)
(:args (array :scs (descriptor-reg))
(index :scs (any-reg)))
(:arg-types * positive-fixnum)
(:results (value :scs (double-sse-reg)))
(:result-types simd-pack-double)
(:generator 5
(inst movapd value (make-ea-for-float-ref array index 0 16
:scale (ash 2 (- word-shift n-fixnum-tag-bits))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment