bjwbell / gensimd

SIMD for Go
MIT License
161 stars 10 forks source link

SIMD signatures #4

Closed rw closed 7 years ago

rw commented 8 years ago

I like this library. It's easy to begin using it, and the numerical code I can write is faster than what I can do with basic Go.

I have a question about the SIMD functions: why is their result stored in a return value, instead of in a pointer argument? I would expect a signature like this:

func AddF32x4(x, y F32x4, dest *F32x4)

Or even:

func AddF32x4(x, y, dest *F32x4)

Instead of what we have now:

func AddF32x4(x, y F32x4) F32x4

Thanks.

bjwbell commented 8 years ago

Returning a pointer argument introduces indirection which costs performance, negating the gain from using SIMD instructions. If you want, I can get perf. numbers, this weekend.

Let me know if you have other suggestions or issues. The library is a WIP. I'm rewriting the code generation to use the new Go SSA backend.

On Wed, Apr 27, 2016 at 10:19 AM, Robert notifications@github.com wrote:

I like this library. It's easy to begin using it, and the numerical code I can write is faster than what I can do with basic Go.

I have a question about the SIMD functions: why is their result stored in a return value, instead of a pointer argument? I would expect a signature like this:

func AddF32x4(x, y F32x4, dest *F32x4)

Or even:

func AddF32x4(x, y, dest *F32x4)

Instead of what we have now:

func AddF32x4(x, y F32x4) F32x4

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/bjwbell/gensimd/issues/4

--Regards JW Bell 530-355-5145 (cell)/916-900-1534(voip)