Skip to content

Include rsqrt function for Vec{4,Float32} #57

@non-Jedi

Description

@non-Jedi

llvm.x86.sse.rsqrt.ps calls the _mm_rsqrt_ps intrinsic which can greatly speed up calculations in some cases. It would be very convenient if this was included in SIMD.jl (see discussion here: JuliaPerf/BenchmarksGame.jl#44 (comment)). I see two barriers to this:

  1. rsqrt is not a function in Julia Base like the other functions defined in this package. To me, this seems like a non-issue, but it does expand the conceptual scope of this package.
  2. rsqrt could only be defined for Vec{4,Float32}. The current architecture of the package doesn't cleanly allow this. While llvmins could be defined for Float32 but not for Float64, there's no way of defining it for length 4 vectors but not for length 2. Perhaps this makes "(Also currently missing: Type conversions, reinterpretation that changes the vector size)" a prerequisite for including something like this.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions