Jump to page: 1 2
Thread overview
[Issue 16550] Generic SIMD shuffle for Mir
Sep 27, 2016
Walter Bright
Sep 27, 2016
Walter Bright
Oct 08, 2016
Walter Bright
Nov 16, 2016
Walter Bright
Nov 16, 2016
Walter Bright
Nov 16, 2016
Iain Buclaw
Nov 16, 2016
Walter Bright
Nov 20, 2016
Manu
Nov 26, 2016
Iain Buclaw
Dec 17, 2022
Iain Buclaw
September 27, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
Could you please add some example code that should compile and what it should do?

--
September 27, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |SIMD

--
September 27, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

--- Comment #2 from Илья Ярошенко <ilyayaroshenko@gmail.com> ---
__vector(float[8]) a; // re0 im0 re1 im1 re2 im2 re3 im3
__vector(float[8]) b; // re4 im4 re5 im5 re6 im6 re7 im7

// Packing
__vector(float[8]) re = extractRe(a, b); // re0 re1 re2 re3 re4 re5 re6 re7
__vector(float[8]) im = extractIm(a, b); // im0 im1 im2 im3 im4 im5 im6 im7

// Unpacking
__vector(float[8]) c = mix0(re, im); //re0 im0 re1 im1 re2 im2 re3 im3
__vector(float[8]) d = mix1(re, im); //re4 im4 re5 im5 re6 im6 re7 im7


assert(c == a);
assert(d == b);

--
October 08, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |performance

--
November 16, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
The example does not compile with gdc.

--
November 16, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
I also cannot find any documentation on extractRe() and extractIm(). I googled
for "ldc extractre extractim" and there were no results.

--
November 16, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #5 from Iain Buclaw <ibuclaw@gdcproject.org> ---
I can only think of movshdup/movsldup for extract(), but that doesn't quite do
what is being asked.

---
import gcc.builtins;

float4 a = [1,2,3,4];
auto b = __builtin_ia32_movshdup(a);  // [1,1,3,3]
auto c = __builtin_ia32_movshdup(a);  // [2,2,4,4]
---

Maybe you should provide assembly of what you'd like to be done.  But on the surface, it doesn't look like it falls into the category of compiler intrinsics, more like library code.

--
November 16, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

--- Comment #6 from Илья Ярошенко <ilyayaroshenko@gmail.com> ---
(In reply to Walter Bright from comment #4)
> I also cannot find any documentation on extractRe() and extractIm(). I
> googled for "ldc extractre extractim" and there were no results.

LLVM has a very generic instruction
http://llvm.org/docs/LangRef.html#shufflevector-instruction /
https://github.com/ldc-developers/druntime/blob/1fa60c4f5516e63a5050255c5757f48c31273ec3/src/ldc/simd.di#L121,
which is used in GLAS to perform required permutations.

--
November 16, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

--- Comment #7 from Walter Bright <bugzilla@digitalmars.com> ---
Looks like a simple wrapper could be put around the PSHUFD instruction.

--
November 20, 2016
https://issues.dlang.org/show_bug.cgi?id=16550

Manu <turkeyman@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman@gmail.com

--- Comment #8 from Manu <turkeyman@gmail.com> ---
I've wanted to put a SIMD helper library in std for ages. Ie, not intended to
present raw arch-specific intrinsics like core.simd, but useful functions
typically implemented as small compound operations.
LLVM kinda does this already; it presents SIMD in a fairly abstract high-level
way, and codegen's aggressively. We could get a lot of that value from a phobos
lib I think.

--
« First   ‹ Prev
1 2